- Minor cleanup to yesterday's changes to Sema::ObjcActOnStartOfMethodDef();
- Add Sema::CurMethodDecl, in preparation for adding ObjcIvarRefExpr.
- Add ObjcInterfaceDecl::lookupInstanceVariable(), in prep for adding ivars.
- A couple renames in ObjcInterfaceDecl, while I was in the vicinity:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44015 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index 584fbf5..b09960e 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -408,6 +408,23 @@
   }
 }
 
+ObjcIvarDecl *ObjcInterfaceDecl::lookupInstanceVariable(
+  IdentifierInfo *ID, ObjcInterfaceDecl *&clsDeclared) {
+  ObjcInterfaceDecl* ClassDecl = this;
+  while (ClassDecl != NULL) {
+    ObjcIvarDecl **ivars = ClassDecl->getInstanceVariables();
+    int ivarCount = ClassDecl->getNumInstanceVariables();
+    for (int i = 0; i < ivarCount; ++i) {
+      if (ivars[i]->getIdentifier() == ID) {
+        clsDeclared = ClassDecl;
+        return ivars[i];
+      }
+    }
+    ClassDecl = ClassDecl->getSuperClass();
+  }
+  return NULL;
+}
+
 // lookupInstanceMethod - This method returns an instance method by looking in
 // the class, it's categories, and it's super classes (using a linear search).
 ObjcMethodDecl *ObjcInterfaceDecl::lookupInstanceMethod(Selector &Sel) {