Eliminate the three SmallVectors in ObjCImplDecl (for instance
methods, class methods, and property implementations) and instead
place all of these entities into the DeclContext.

This eliminates more linear walks when looking for class or instance
methods and should make PCH (de-)serialization of ObjCDecls trivial
(and lazy).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69849 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CheckObjCInstMethSignature.cpp b/lib/Analysis/CheckObjCInstMethSignature.cpp
index 97e77cc..9fec7c1 100644
--- a/lib/Analysis/CheckObjCInstMethSignature.cpp
+++ b/lib/Analysis/CheckObjCInstMethSignature.cpp
@@ -79,13 +79,15 @@
   if (!C)
     return;
   
+  ASTContext& Ctx = BR.getContext();
+  
   // Build a DenseMap of the methods for quick querying.
   typedef llvm::DenseMap<Selector,ObjCMethodDecl*> MapTy;
   MapTy IMeths;
   unsigned NumMethods = 0;
   
-  for (ObjCImplementationDecl::instmeth_iterator I=ID->instmeth_begin(),
-       E=ID->instmeth_end(); I!=E; ++I) {    
+  for (ObjCImplementationDecl::instmeth_iterator I=ID->instmeth_begin(Ctx),
+       E=ID->instmeth_end(Ctx); I!=E; ++I) {    
     
     ObjCMethodDecl* M = *I;
     IMeths[M->getSelector()] = M;
@@ -94,8 +96,6 @@
 
   // Now recurse the class hierarchy chain looking for methods with the
   // same signatures.
-  ASTContext& Ctx = BR.getContext();
-  
   while (C && NumMethods) {
     for (ObjCInterfaceDecl::instmeth_iterator I=C->instmeth_begin(Ctx),
          E=C->instmeth_end(Ctx); I!=E; ++I) {