Patch to make ObjcQualifiedInterfaceType inherit ObjcInterfaceType



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45014 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp
index 322f34c..4351b89 100644
--- a/AST/ASTContext.cpp
+++ b/AST/ASTContext.cpp
@@ -687,7 +687,7 @@
 QualType ASTContext::getObjcInterfaceType(ObjcInterfaceDecl *Decl) {
   if (Decl->TypeForDecl) return QualType(Decl->TypeForDecl, 0);
   
-  Decl->TypeForDecl = new ObjcInterfaceType(Decl);
+  Decl->TypeForDecl = new ObjcInterfaceType(Type::ObjcInterface, Decl);
   Types.push_back(Decl->TypeForDecl);
   return QualType(Decl->TypeForDecl, 0);
 }
@@ -697,11 +697,8 @@
 /// the conforming protocol list.
 QualType ASTContext::getObjcQualifiedInterfaceType(ObjcInterfaceDecl *Decl,
                        ObjcProtocolDecl **Protocols, unsigned NumProtocols) {
-  ObjcInterfaceType *IType = 
-    cast<ObjcInterfaceType>(getObjcInterfaceType(Decl));
-  
   llvm::FoldingSetNodeID ID;
-  ObjcQualifiedInterfaceType::Profile(ID, IType, Protocols, NumProtocols);
+  ObjcQualifiedInterfaceType::Profile(ID, Protocols, NumProtocols);
   
   void *InsertPos = 0;
   if (ObjcQualifiedInterfaceType *QT =
@@ -710,7 +707,7 @@
   
   // No Match;
   ObjcQualifiedInterfaceType *QType =
-    new ObjcQualifiedInterfaceType(IType, Protocols, NumProtocols);
+    new ObjcQualifiedInterfaceType(Decl, Protocols, NumProtocols);
   Types.push_back(QType);
   ObjcQualifiedInterfaceTypes.InsertNode(QType, InsertPos);
   return QualType(QType, 0);
@@ -1204,8 +1201,8 @@
   ObjcQualifiedInterfaceType *rhsQI = 
     dyn_cast<ObjcQualifiedInterfaceType>(rhs.getCanonicalType().getTypePtr());
   assert(rhsQI && "QualifiedInterfaceTypesAreCompatible - bad rhs type");
-  if (!interfaceTypesAreCompatible(QualType(lhsQI->getInterfaceType(), 0), 
-			           QualType(rhsQI->getInterfaceType(), 0)))
+  if (!interfaceTypesAreCompatible(getObjcInterfaceType(lhsQI->getDecl()), 
+                                   getObjcInterfaceType(rhsQI->getDecl())))
     return false;
   /* All protocols in lhs must have a presense in rhs. */
   for (unsigned i =0; i < lhsQI->getNumProtocols(); i++) {