aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-11 23:59:49 +0000
committerChris Lattner <sabre@nondot.org>2009-01-11 23:59:49 +0000
commitf728a4a05df2455e1c6e62173ab720a92cd4a074 (patch)
tree387afeda30d35711e8261ae778e23cedd6956717
parent32f6209ea9a5a88ad3f8d7ad5e5b160b403d12da (diff)
simplify these predicates a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62061 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/Type.cpp15
1 files changed, 6 insertions, 9 deletions
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<RecordType>(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<RecordType>(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<RecordType>(CanonicalType))
- if (RT->getDecl()->isUnion())
- return true;
+ if (const RecordType *RT = getAsRecordType())
+ return RT->getDecl()->isUnion();
return false;
}