[cfe-commits] r68194 - in /cfe/trunk: include/clang/AST/ASTContext.h lib/AST/ASTContext.cpp lib/CodeGen/CGDebugInfo.cpp lib/CodeGen/CGObjCMac.cpp

Chris Lattner sabre at nondot.org
Tue Mar 31 23:23:52 PDT 2009


Author: lattner
Date: Wed Apr  1 01:23:52 2009
New Revision: 68194

URL: http://llvm.org/viewvc/llvm-project?rev=68194&view=rev
Log:
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.


Modified:
    cfe/trunk/include/clang/AST/ASTContext.h
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp

Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=68194&r1=68193&r2=68194&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Wed Apr  1 01:23:52 2009
@@ -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);

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=68194&r1=68193&r2=68194&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Wed Apr  1 01:23:52 2009
@@ -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, 

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=68194&r1=68193&r2=68194&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Apr  1 01:23:52 2009
@@ -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.

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=68194&r1=68193&r2=68194&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Wed Apr  1 01:23:52 2009
@@ -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())) {





More information about the cfe-commits mailing list