diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-08-26 06:53:45 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-08-26 06:53:45 +0000 |
commit | 6962f5a73bf014c45503753400f974806240a124 (patch) | |
tree | 551868d8ed6315615c673b22713a67b74ca32225 /clang/lib/AST/DeclObjC.cpp | |
parent | 345dcce5a6715c29f5966e2aad121d1b43b91063 (diff) | |
download | bcm5719-llvm-6962f5a73bf014c45503753400f974806240a124.tar.gz bcm5719-llvm-6962f5a73bf014c45503753400f974806240a124.zip |
constify ObjC*::getClassMethod,getInstanceMethod
No (intended) functionality change.
llvm-svn: 55362
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 9da6dafb98d..2e038024363 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -410,6 +410,12 @@ void ObjCInterfaceDecl::addPropertyMethods( 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 @@ ObjCMethodDecl *ObjCInterfaceDecl::lookupClassMethod(Selector Sel) { 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 @@ ObjCMethodDecl *ObjCImplementationDecl::getClassMethod(Selector Sel) { // 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 @@ ObjCMethodDecl *ObjCCategoryImplDecl::getInstanceMethod(Selector Sel) { // 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) |