- Add ObjcInterfaceDecl::lookupInstanceMethod(), lookupClassMethod().
- Add ObjcMessageExpr::getSelector(), getClassName().
- Change Sema::getObjCInterfaceDecl() to simply take an IdentifierInfo (no Scope needed).
- Remove FIXME for printing ObjCMessageExpr's.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42543 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index d23f3cb..9e02607 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -408,4 +408,36 @@
   }
 }
 
+// FIXME: look through categories...
+ObjcMethodDecl *ObjcInterfaceDecl::lookupInstanceMethod(Selector &Sel) {
+  ObjcInterfaceDecl* ClassDecl = this;
+  while (ClassDecl != NULL) {
+    ObjcMethodDecl **methods = ClassDecl->getInsMethods();
+    int methodCount = ClassDecl->getNumInsMethods();
+    for (int i = 0; i < methodCount; ++i) {
+      if (methods[i]->getSelector() == Sel) {
+        return methods[i];
+      }
+    }
+    ClassDecl = ClassDecl->getSuperClass();
+  }
+  return NULL;
+}
+
+// FIXME: look through categories...
+ObjcMethodDecl *ObjcInterfaceDecl::lookupClassMethod(Selector &Sel) {
+  ObjcInterfaceDecl* ClassDecl = this;
+  while (ClassDecl != NULL) {
+    ObjcMethodDecl **methods = ClassDecl->getClsMethods();
+    int methodCount = ClassDecl->getNumClsMethods();
+    for (int i = 0; i < methodCount; ++i) {
+      if (methods[i]->getSelector() == Sel) {
+        return methods[i];
+      }
+    }
+    ClassDecl = ClassDecl->getSuperClass();
+  }
+  return NULL;
+}
+