[cfe-commits] r69942 - in /cfe/trunk/lib/Sema: Sema.h SemaDeclObjC.cpp SemaLookup.cpp

Douglas Gregor dgregor at apple.com
Thu Apr 23 17:16:12 PDT 2009


Author: dgregor
Date: Thu Apr 23 19:16:12 2009
New Revision: 69942

URL: http://llvm.org/viewvc/llvm-project?rev=69942&view=rev
Log:
Eliminate Sema::ObjCInterfaceDecls

Modified:
    cfe/trunk/lib/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaDeclObjC.cpp
    cfe/trunk/lib/Sema/SemaLookup.cpp

Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=69942&r1=69941&r2=69942&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Thu Apr 23 19:16:12 2009
@@ -172,13 +172,6 @@
   /// we can check for duplicates and find local method declarations.
   llvm::SmallVector<ObjCCategoryImplDecl*, 8> ObjCCategoryImpls;
   
-  /// ObjCInterfaceDecls - Keep track of all class declarations declared
-  /// with @interface, so that we can emit errors on duplicates and
-  /// find the declarations when needed. 
-  typedef llvm::DenseMap<const IdentifierInfo*, 
-                         ObjCInterfaceDecl*> ObjCInterfaceDeclsTy;
-  ObjCInterfaceDeclsTy ObjCInterfaceDecls;
-    
   /// ObjCAliasDecls - Keep track of all class declarations declared
   /// with @compatibility_alias, so that we can emit errors on duplicates and
   /// find the declarations when needed. This construct is ancient and will

Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=69942&r1=69941&r2=69942&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Thu Apr 23 19:16:12 2009
@@ -98,10 +98,7 @@
     if (AttrList)
       ProcessDeclAttributeList(IDecl, AttrList);
   
-    ObjCInterfaceDecls[ClassName] = IDecl;
     PushOnScopeChains(IDecl, TUScope);
-    // Remember that this needs to be removed when the scope is popped.
-    TUScope->AddDecl(DeclPtrTy::make(IDecl));
   }
   
   if (SuperName) {
@@ -658,11 +655,10 @@
     // we should copy them over.
     IDecl = ObjCInterfaceDecl::Create(Context, CurContext, AtClassImplLoc, 
                                       ClassName, ClassLoc, false, true);
-    ObjCInterfaceDecls[ClassName] = IDecl;
     IDecl->setSuperClass(SDecl);
     IDecl->setLocEnd(ClassLoc);
-    
-    // FIXME: PushOnScopeChains?
+
+    PushOnScopeChains(IDecl, TUScope);
     CurContext->addDecl(Context, IDecl);
     // Remember that this needs to be removed when the scope is popped.
     TUScope->AddDecl(DeclPtrTy::make(IDecl));
@@ -1042,11 +1038,7 @@
     if (!IDecl) {  // Not already seen?  Make a forward decl.
       IDecl = ObjCInterfaceDecl::Create(Context, CurContext, AtClassLoc, 
                                         IdentList[i], SourceLocation(), true);
-      ObjCInterfaceDecls[IdentList[i]] = IDecl;
-
       PushOnScopeChains(IDecl, TUScope);
-      // Remember that this needs to be removed when the scope is popped.
-      TUScope->AddDecl(DeclPtrTy::make(IDecl));
     }
 
     Interfaces.push_back(IDecl);

Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=69942&r1=69941&r2=69942&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Thu Apr 23 19:16:12 2009
@@ -935,9 +935,6 @@
       // Unlike typedef's, they can only be introduced at file-scope (and are 
       // therefore not scoped decls). They can, however, be shadowed by
       // other names in IDNS_Ordinary.
-      ObjCInterfaceDeclsTy::iterator IDI = ObjCInterfaceDecls.find(II);
-      if (IDI != ObjCInterfaceDecls.end())
-        return LookupResult::CreateLookupResult(Context, IDI->second);
       ObjCAliasTy::iterator I = ObjCAliasDecls.find(II);
       if (I != ObjCAliasDecls.end())
         return LookupResult::CreateLookupResult(Context, 





More information about the cfe-commits mailing list