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/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 2f47c79..145a928 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -2250,12 +2250,8 @@
         Setter = FindMethodInNestedImplementations(IFace, 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, MemberLoc))
         return ExprError();
@@ -2431,12 +2427,8 @@
       Getter = FindMethodInNestedImplementations(IFace, Sel);
 
     // Look through local category implementations associated with the class.
-    if (!Getter) {
-      for (unsigned i = 0; i < ObjCCategoryImpls.size() && !Getter; i++) {
-        if (ObjCCategoryImpls[i]->getClassInterface() == IFace)
-          Getter = ObjCCategoryImpls[i]->getInstanceMethod(Sel);
-      }
-    }
+    if (!Getter)
+      Getter = IFace->getCategoryInstanceMethod(Sel);
     if (Getter) {
       // Check if we can reference this property.
       if (DiagnoseUseOfDecl(Getter, MemberLoc))
@@ -2454,12 +2446,8 @@
       Setter = FindMethodInNestedImplementations(IFace, 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]->getInstanceMethod(SetterSel);
-      }
-    }
+    if (!Setter)
+      Setter = IFace->getCategoryInstanceMethod(SetterSel);
 
     if (Setter && DiagnoseUseOfDecl(Setter, MemberLoc))
       return ExprError();