Add CXXRecordType class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54488 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 002a51f..f47855a 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -13,6 +13,7 @@
 
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Decl.h"
+#include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/Basic/TargetInfo.h"
 #include "llvm/ADT/SmallVector.h"
@@ -851,16 +852,18 @@
   else if (ObjCInterfaceDecl *ObjCInterface 
              = dyn_cast_or_null<ObjCInterfaceDecl>(Decl))
     return getObjCInterfaceType(ObjCInterface);
-  else if (RecordDecl *Record = dyn_cast_or_null<RecordDecl>(Decl)) {
+
+  if (CXXRecordDecl *CXXRecord = dyn_cast_or_null<CXXRecordDecl>(Decl))
+    Decl->TypeForDecl = new CXXRecordType(CXXRecord);
+  else if (RecordDecl *Record = dyn_cast_or_null<RecordDecl>(Decl))
     Decl->TypeForDecl = new RecordType(Record);
-    Types.push_back(Decl->TypeForDecl);
-    return QualType(Decl->TypeForDecl, 0);
-  } else if (EnumDecl *Enum = dyn_cast_or_null<EnumDecl>(Decl)) {
+  else if (EnumDecl *Enum = dyn_cast_or_null<EnumDecl>(Decl))
     Decl->TypeForDecl = new EnumType(Enum);
-    Types.push_back(Decl->TypeForDecl);
-    return QualType(Decl->TypeForDecl, 0);    
-  } else
+  else
     assert(false && "TypeDecl without a type?");
+
+  Types.push_back(Decl->TypeForDecl);
+  return QualType(Decl->TypeForDecl, 0);
 }
 
 /// getTypedefType - Return the unique reference to the type for the
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index f9f6eca..c4b44af 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -13,6 +13,7 @@
 
 #include "clang/AST/Type.h"
 #include "clang/AST/Decl.h"
+#include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/Expr.h"
 #include "clang/Basic/IdentifierTable.h"
@@ -739,6 +740,10 @@
   return isa<RecordDecl>(TT->getDecl());
 }
 
+bool CXXRecordType::classof(const TagType *TT) {
+  return isa<CXXRecordDecl>(TT->getDecl());
+}
+
 bool EnumType::classof(const TagType *TT) {
   return isa<EnumDecl>(TT->getDecl());
 }