constify ObjC*::getClassMethod,getInstanceMethod
No (intended) functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55362 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index 9da6daf..2e03802 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -410,6 +410,12 @@
ASTContext &Context,
ObjCPropertyDecl *property,
llvm::SmallVector<ObjCMethodDecl*, 32> &insMethods) {
+ // FIXME: The synthesized property we set here is misleading. We
+ // almost always synthesize these methods unless the user explicitly
+ // provided prototypes (which is odd, but allowed). Sema should be
+ // typechecking that the declarations jive in that situation (which
+ // it is not currently).
+
// Find the default getter and if one not found, add one.
ObjCMethodDecl *GetterDecl = getInstanceMethod(property->getGetterName());
if (!GetterDecl) {
@@ -626,20 +632,20 @@
return NULL;
}
-/// lookupInstanceMethod - This method returns an instance method by looking in
-/// the class implementation. Unlike interfaces, we don't look outside the
-/// implementation.
-ObjCMethodDecl *ObjCImplementationDecl::getInstanceMethod(Selector Sel) {
+/// getInstanceMethod - This method returns an instance method by
+/// looking in the class implementation. Unlike interfaces, we don't
+/// look outside the implementation.
+ObjCMethodDecl *ObjCImplementationDecl::getInstanceMethod(Selector Sel) const {
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end(); I != E; ++I)
if ((*I)->getSelector() == Sel)
return *I;
return NULL;
}
-/// lookupClassMethod - This method returns a class method by looking in
-/// the class implementation. Unlike interfaces, we don't look outside the
-/// implementation.
-ObjCMethodDecl *ObjCImplementationDecl::getClassMethod(Selector Sel) {
+/// getClassMethod - This method returns a class method by looking in
+/// the class implementation. Unlike interfaces, we don't look outside
+/// the implementation.
+ObjCMethodDecl *ObjCImplementationDecl::getClassMethod(Selector Sel) const {
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
I != E; ++I)
if ((*I)->getSelector() == Sel)
@@ -650,7 +656,7 @@
// lookupInstanceMethod - This method returns an instance method by looking in
// the class implementation. Unlike interfaces, we don't look outside the
// implementation.
-ObjCMethodDecl *ObjCCategoryImplDecl::getInstanceMethod(Selector Sel) {
+ObjCMethodDecl *ObjCCategoryImplDecl::getInstanceMethod(Selector Sel) const {
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end(); I != E; ++I)
if ((*I)->getSelector() == Sel)
return *I;
@@ -660,7 +666,7 @@
// lookupClassMethod - This method returns an instance method by looking in
// the class implementation. Unlike interfaces, we don't look outside the
// implementation.
-ObjCMethodDecl *ObjCCategoryImplDecl::getClassMethod(Selector Sel) {
+ObjCMethodDecl *ObjCCategoryImplDecl::getClassMethod(Selector Sel) const {
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
I != E; ++I)
if ((*I)->getSelector() == Sel)