Remove the ObjCCategoryImpls vector from Sema class.
Use ObjCInterfaceDecl::getCategoryClassMethod() and ObjCInterfaceDecl::getCategoryInstanceMethod() for the same functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76510 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 141cd80..068b386 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -245,12 +245,8 @@
       Method = ImpDecl->getClassMethod(Sel);
     
     // Look through local category implementations associated with the class.
-    if (!Method) {
-      for (unsigned i = 0; i < ObjCCategoryImpls.size() && !Method; i++) {
-        if (ObjCCategoryImpls[i]->getClassInterface() == ClassDecl)
-          Method = ObjCCategoryImpls[i]->getClassMethod(Sel);
-      }
-    }
+    if (!Method)
+      Method = ClassDecl->getCategoryClassMethod(Sel);
     
     // Before we give up, check if the selector is an instance method.
     // But only in the root. This matches gcc's behaviour and what the
@@ -277,12 +273,8 @@
       Method = ImpDecl->getInstanceMethod(Sel);
     
     // Look through local category implementations associated with the class.
-    if (!Method) {
-      for (unsigned i = 0; i < ObjCCategoryImpls.size() && !Method; i++) {
-        if (ObjCCategoryImpls[i]->getClassInterface() == ClassDecl)
-          Method = ObjCCategoryImpls[i]->getInstanceMethod(Sel);
-      }
-    }
+    if (!Method)
+      Method = ClassDecl->getCategoryInstanceMethod(Sel);
     ClassDecl = ClassDecl->getSuperClass();
   }
   return Method;
@@ -330,12 +322,8 @@
           Setter = ImpDecl->getClassMethod(SetterSel);
   }
   // Look through local category implementations associated with the class.
-  if (!Setter) {
-    for (unsigned i = 0; i < ObjCCategoryImpls.size() && !Setter; i++) {
-      if (ObjCCategoryImpls[i]->getClassInterface() == IFace)
-        Setter = ObjCCategoryImpls[i]->getClassMethod(SetterSel);
-    }
-  }
+  if (!Setter)
+    Setter = IFace->getCategoryClassMethod(SetterSel);
 
   if (Setter && DiagnoseUseOfDecl(Setter, propertyNameLoc))
     return ExprError();