aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}