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
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 1df7f3d..d48ba44 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -222,8 +222,8 @@
ObjCMethodDecl *Method = 0;
// lookup in class and all superclasses
while (ClassDecl && !Method) {
- if (ObjCImplementationDecl *ImpDecl =
- ObjCImplementations[ClassDecl->getIdentifier()])
+ if (ObjCImplementationDecl *ImpDecl
+ = LookupObjCImplementation(ClassDecl->getIdentifier()))
Method = ImpDecl->getClassMethod(Context, Sel);
// Look through local category implementations associated with the class.
@@ -255,8 +255,8 @@
ObjCMethodDecl *Method = 0;
while (ClassDecl && !Method) {
// If we have implementations in scope, check "private" methods.
- if (ObjCImplementationDecl *ImpDecl =
- ObjCImplementations[ClassDecl->getIdentifier()])
+ if (ObjCImplementationDecl *ImpDecl
+ = LookupObjCImplementation(ClassDecl->getIdentifier()))
Method = ImpDecl->getInstanceMethod(Context, Sel);
// Look through local category implementations associated with the class.
@@ -288,8 +288,8 @@
if (!Getter)
if (ObjCMethodDecl *CurMeth = getCurMethodDecl())
if (ObjCInterfaceDecl *ClassDecl = CurMeth->getClassInterface())
- if (ObjCImplementationDecl *ImpDecl =
- ObjCImplementations[ClassDecl->getIdentifier()])
+ if (ObjCImplementationDecl *ImpDecl
+ = LookupObjCImplementation(ClassDecl->getIdentifier()))
Getter = ImpDecl->getClassMethod(Context, Sel);
if (Getter) {
@@ -310,8 +310,8 @@
// methods.
if (ObjCMethodDecl *CurMeth = getCurMethodDecl())
if (ObjCInterfaceDecl *ClassDecl = CurMeth->getClassInterface())
- if (ObjCImplementationDecl *ImpDecl =
- ObjCImplementations[ClassDecl->getIdentifier()])
+ if (ObjCImplementationDecl *ImpDecl
+ = LookupObjCImplementation(ClassDecl->getIdentifier()))
Setter = ImpDecl->getClassMethod(Context, SetterSel);
}
// Look through local category implementations associated with the class.