From: Chris Lattner Date: Sun, 11 Jan 2009 23:59:49 +0000 (+0000) Subject: simplify these predicates a bit. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f728a4a05df2455e1c6e62173ab720a92cd4a074;p=clang simplify these predicates a bit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62061 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 1d42b64bb1..b9db41e95e 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -122,21 +122,18 @@ bool Type::isDerivedType() const { } bool Type::isClassType() const { - if (const RecordType *RT = dyn_cast(CanonicalType)) - if (RT->getDecl()->isClass()) - return true; + if (const RecordType *RT = getAsRecordType()) + return RT->getDecl()->isClass(); return false; } bool Type::isStructureType() const { - if (const RecordType *RT = dyn_cast(CanonicalType)) - if (RT->getDecl()->isStruct()) - return true; + if (const RecordType *RT = getAsRecordType()) + return RT->getDecl()->isStruct(); return false; } bool Type::isUnionType() const { - if (const RecordType *RT = dyn_cast(CanonicalType)) - if (RT->getDecl()->isUnion()) - return true; + if (const RecordType *RT = getAsRecordType()) + return RT->getDecl()->isUnion(); return false; }