]> granicus.if.org Git - clang/commitdiff
Eliminate Sema::ObjCInterfaceDecls
authorDouglas Gregor <dgregor@apple.com>
Fri, 24 Apr 2009 00:16:12 +0000 (00:16 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 24 Apr 2009 00:16:12 +0000 (00:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69942 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.h
lib/Sema/SemaDeclObjC.cpp
lib/Sema/SemaLookup.cpp

index b5f4e0bc9e0482900624ac385454250ae5470306..d87d93105dd837f13f7c90b13a54a4bf5a6fe1c4 100644 (file)
@@ -172,13 +172,6 @@ public:
   /// 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
index e0cbdce7e0d5265acf9cfb2b0d7cbeae11c7f880..029770d3a923b1f95ead6f9f211ebb4ac13cea8d 100644 (file)
@@ -98,10 +98,7 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
     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 @@ Sema::DeclPtrTy Sema::ActOnStartClassImplementation(
     // 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 @@ Sema::ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
     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);
index 4b5a04b450fdf02c5fbdda9549a6379c44088476..df869d9a6b804b529d9f0a5ff91d246f907a41da 100644 (file)
@@ -935,9 +935,6 @@ Sema::LookupName(Scope *S, DeclarationName Name, LookupNameKind NameKind,
       // 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,