remove ASTContext::buildObjCInterfaceType, which breaks canonical 
types.  It is no longer needed now that the code generator 
re-lays-out interfaces if they are defines after being laid out
from a forward decl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68194 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index 503c463..4287494 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -287,7 +287,6 @@
   /// specified typename decl.
   QualType getTypedefType(TypedefDecl *Decl);
   QualType getObjCInterfaceType(ObjCInterfaceDecl *Decl);
-  QualType buildObjCInterfaceType(ObjCInterfaceDecl *Decl);
 
   QualType getTemplateTypeParmType(unsigned Depth, unsigned Index, 
                                    IdentifierInfo *Name = 0);
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index bdc7e44..fc1e0a2 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1344,18 +1344,6 @@
   return QualType(Decl->TypeForDecl, 0);
 }
 
-/// buildObjCInterfaceType - Returns a new type for the interface
-/// declaration, regardless. It also removes any previously built 
-/// record declaration so caller can rebuild it.
-QualType ASTContext::buildObjCInterfaceType(ObjCInterfaceDecl *Decl) {
-  RecordDecl *&RD = ASTRecordForInterface[Decl];
-  if (RD)
-    RD = 0;
-  Decl->TypeForDecl = new(*this,8) ObjCInterfaceType(Type::ObjCInterface, Decl);
-  Types.push_back(Decl->TypeForDecl);
-  return QualType(Decl->TypeForDecl, 0);
-}
-
 /// \brief Retrieve the template type parameter type for a template
 /// parameter with the given depth, index, and (optionally) name.
 QualType ASTContext::getTemplateTypeParmType(unsigned Depth, unsigned Index, 
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index bde6fba..c081936 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -749,7 +749,7 @@
 
   std::string Name = Decl->getNameAsString();
 
-  QualType T = M->getContext().buildObjCInterfaceType(Decl);
+  QualType T = M->getContext().getObjCInterfaceType(Decl);
   if (T->isIncompleteArrayType()) {
     
     // CodeGen turns int[] into int[1] so we'll do the same here.
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index 75cf4e7..351f8e2 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -1459,7 +1459,7 @@
                      Interface->protocol_begin(),
                      Interface->protocol_end());
   const llvm::Type *InterfaceTy = 
-   CGM.getTypes().ConvertType(CGM.getContext().buildObjCInterfaceType(Interface));
+   CGM.getTypes().ConvertType(CGM.getContext().getObjCInterfaceType(Interface));
   unsigned Flags = eClassFlags_Factory;
   unsigned Size = CGM.getTargetData().getTypePaddedSize(InterfaceTy);
 
@@ -4246,9 +4246,6 @@
     SuperClassGV = GetClassGlobal(ObjCClassName + RootClassName);
   }
   // FIXME: Gross
-  ObjCInterfaceDecl *Interface =
-    const_cast<ObjCInterfaceDecl*>(ID->getClassInterface()); 
-  CGM.getTypes().ConvertType(CGM.getContext().buildObjCInterfaceType(Interface));
   InstanceStart = InstanceSize = 0;
   if (ObjCInterfaceDecl *OID = 
       const_cast<ObjCInterfaceDecl*>(ID->getClassInterface())) {