]> granicus.if.org Git - clang/commitdiff
remove ASTContext::buildObjCInterfaceType, which breaks canonical
authorChris Lattner <sabre@nondot.org>
Wed, 1 Apr 2009 06:23:52 +0000 (06:23 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 1 Apr 2009 06:23:52 +0000 (06:23 +0000)
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

include/clang/AST/ASTContext.h
lib/AST/ASTContext.cpp
lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGObjCMac.cpp

index 503c4639ccd906b8c1f3bcd6896efa2210371267..4287494b3d371c35c891309151c1864d80c398aa 100644 (file)
@@ -287,7 +287,6 @@ public:
   /// specified typename decl.
   QualType getTypedefType(TypedefDecl *Decl);
   QualType getObjCInterfaceType(ObjCInterfaceDecl *Decl);
-  QualType buildObjCInterfaceType(ObjCInterfaceDecl *Decl);
 
   QualType getTemplateTypeParmType(unsigned Depth, unsigned Index, 
                                    IdentifierInfo *Name = 0);
index bdc7e4484c2b9d49dc5a1475a842849d05f103e5..fc1e0a2062752ad5a07c1c28d66c79c6705aaf4f 100644 (file)
@@ -1344,18 +1344,6 @@ QualType ASTContext::getObjCInterfaceType(ObjCInterfaceDecl *Decl) {
   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, 
index bde6fba137f6952108333457ec06a94be8f17420..c0819369b1f5e1b7009d435f461a0fe31f9a412c 100644 (file)
@@ -749,7 +749,7 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
 
   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.
index 75cf4e76abad8499ce7ec2284aab223ae39489e0..351f8e25270540992df8d4dd1c008e2a5888675d 100644 (file)
@@ -1459,7 +1459,7 @@ void CGObjCMac::GenerateClass(const ObjCImplementationDecl *ID) {
                      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 @@ void CGObjCNonFragileABIMac::GenerateClass(const ObjCImplementationDecl *ID) {
     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())) {