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 1d42b64..b9db41e 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -122,21 +122,18 @@
 }
 
 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;
 }