Cleanup/Refactoring of ivar collection. No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72827 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index 5e7eec9..a70f718 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -1544,14 +1544,8 @@
 static const ObjCInterfaceDecl *FindIvarInterface(ASTContext &Context,
                                                   const ObjCInterfaceDecl *OID,
                                                   const ObjCIvarDecl *OIVD) {
-  for (ObjCInterfaceDecl::ivar_iterator IVI = OID->ivar_begin(), 
-         IVE = OID->ivar_end(); IVI != IVE; ++IVI)
-    if (OIVD == *IVI)
-      return OID;
-  
-  // Also look in synthesized ivars.
   llvm::SmallVector<ObjCIvarDecl*, 16> Ivars;
-  Context.CollectSynthesizedIvars(OID, Ivars);
+  Context.ShallowCollectObjCIvars(OID, Ivars);
   for (unsigned k = 0, e = Ivars.size(); k != e; ++k) {
     if (OIVD == Ivars[k])
       return OID;