diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-24 00:11:27 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-24 00:11:27 +0000 |
commit | 8fc463adf0116fdcbff86e9cca11955aad1649fe (patch) | |
tree | fed115bbf0f5550469216d9d11094c4c558e6763 /lib/Sema/SemaDeclObjC.cpp | |
parent | f97364a022bb4d12b119fab0b5934b4d420878c7 (diff) |
Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's good for uniformity is good for PCH (or is it the other way around?).
As part of this, make ObjCImplDecl inherit from NamedDecl (since
ObjCImplementationDecls now need to have names so that they can be
found). This brings ObjCImplDecl very, very close to
ObjCContainerDecl; we may be able to merge them soon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69941 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 7badaa3130..e0cbdce7e0 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -677,18 +677,15 @@ Sema::DeclPtrTy Sema::ActOnStartClassImplementation( ObjCImplementationDecl::Create(Context, CurContext, AtClassImplLoc, IDecl, SDecl); - // FIXME: PushOnScopeChains? - CurContext->addDecl(Context, IMPDecl); - if (CheckObjCDeclScope(IMPDecl)) return DeclPtrTy::make(IMPDecl); // Check that there is no duplicate implementation of this class. - if (ObjCImplementations[ClassName]) + if (LookupObjCImplementation(ClassName)) // FIXME: Don't leak everything! Diag(ClassLoc, diag::err_dup_implementation_class) << ClassName; else // add it to the list. - ObjCImplementations[ClassName] = IMPDecl; + PushOnScopeChains(IMPDecl, TUScope); return DeclPtrTy::make(IMPDecl); } @@ -832,8 +829,8 @@ bool Sema::isPropertyReadonly(ObjCPropertyDecl *PDecl, } } // Lastly, look through the implementation (if one is in scope). - if (ObjCImplementationDecl *ImpDecl = - ObjCImplementations[IDecl->getIdentifier()]) + if (ObjCImplementationDecl *ImpDecl + = LookupObjCImplementation(IDecl->getIdentifier())) if (ImpDecl->getInstanceMethod(Context, PDecl->getSetterName())) return false; // If all fails, look at the super class. |