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
This commit is contained in:
Daniel Dunbar 2008-08-26 06:53:45 +00:00
Родитель 08a356cc2b
Коммит 3216dcdebb
2 изменённых файлов: 26 добавлений и 20 удалений

Просмотреть файл

@ -418,7 +418,7 @@ public:
// Get the local instance method declared in this interface. // Get the local instance method declared in this interface.
ObjCMethodDecl *getInstanceMethod(Selector Sel) { ObjCMethodDecl *getInstanceMethod(Selector Sel) const {
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end(); for (instmeth_iterator I = instmeth_begin(), E = instmeth_end();
I != E; ++I) { I != E; ++I) {
if ((*I)->getSelector() == Sel) if ((*I)->getSelector() == Sel)
@ -427,7 +427,7 @@ public:
return 0; return 0;
} }
// Get the local class method declared in this interface. // Get the local class method declared in this interface.
ObjCMethodDecl *getClassMethod(Selector Sel) { ObjCMethodDecl *getClassMethod(Selector Sel) const {
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end(); for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
I != E; ++I) { I != E; ++I) {
if ((*I)->getSelector() == Sel) if ((*I)->getSelector() == Sel)
@ -645,7 +645,7 @@ public:
} }
// Get the local instance method declared in this interface. // Get the local instance method declared in this interface.
ObjCMethodDecl *getInstanceMethod(Selector Sel) { ObjCMethodDecl *getInstanceMethod(Selector Sel) const {
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end(); for (instmeth_iterator I = instmeth_begin(), E = instmeth_end();
I != E; ++I) { I != E; ++I) {
if ((*I)->getSelector() == Sel) if ((*I)->getSelector() == Sel)
@ -654,7 +654,7 @@ public:
return 0; return 0;
} }
// Get the local class method declared in this interface. // Get the local class method declared in this interface.
ObjCMethodDecl *getClassMethod(Selector Sel) { ObjCMethodDecl *getClassMethod(Selector Sel) const {
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end(); for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
I != E; ++I) { I != E; ++I) {
if ((*I)->getSelector() == Sel) if ((*I)->getSelector() == Sel)
@ -884,7 +884,7 @@ public:
} }
// Get the local instance method declared in this interface. // Get the local instance method declared in this interface.
ObjCMethodDecl *getInstanceMethod(Selector Sel) { ObjCMethodDecl *getInstanceMethod(Selector Sel) const {
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end(); for (instmeth_iterator I = instmeth_begin(), E = instmeth_end();
I != E; ++I) { I != E; ++I) {
if ((*I)->getSelector() == Sel) if ((*I)->getSelector() == Sel)
@ -893,7 +893,7 @@ public:
return 0; return 0;
} }
// Get the local class method declared in this interface. // Get the local class method declared in this interface.
ObjCMethodDecl *getClassMethod(Selector Sel) { ObjCMethodDecl *getClassMethod(Selector Sel) const {
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end(); for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
I != E; ++I) { I != E; ++I) {
if ((*I)->getSelector() == Sel) if ((*I)->getSelector() == Sel)
@ -971,10 +971,10 @@ public:
ClassMethods.push_back(method); ClassMethods.push_back(method);
} }
// Get the instance method definition for this implementation. // Get the instance method definition for this implementation.
ObjCMethodDecl *getInstanceMethod(Selector Sel); ObjCMethodDecl *getInstanceMethod(Selector Sel) const;
// Get the class method definition for this implementation. // Get the class method definition for this implementation.
ObjCMethodDecl *getClassMethod(Selector Sel); ObjCMethodDecl *getClassMethod(Selector Sel) const;
void addPropertyImplementation(ObjCPropertyImplDecl *property) { void addPropertyImplementation(ObjCPropertyImplDecl *property) {
PropertyImplementations.push_back(property); PropertyImplementations.push_back(property);
@ -1114,10 +1114,10 @@ public:
classmeth_iterator classmeth_end() const { return ClassMethods.end(); } classmeth_iterator classmeth_end() const { return ClassMethods.end(); }
// Get the instance method definition for this implementation. // Get the instance method definition for this implementation.
ObjCMethodDecl *getInstanceMethod(Selector Sel); ObjCMethodDecl *getInstanceMethod(Selector Sel) const;
// Get the class method definition for this implementation. // Get the class method definition for this implementation.
ObjCMethodDecl *getClassMethod(Selector Sel); ObjCMethodDecl *getClassMethod(Selector Sel) const;
typedef ObjCIvarDecl * const *ivar_iterator; typedef ObjCIvarDecl * const *ivar_iterator;
ivar_iterator ivar_begin() const { return Ivars; } ivar_iterator ivar_begin() const { return Ivars; }

Просмотреть файл

@ -410,6 +410,12 @@ void ObjCInterfaceDecl::addPropertyMethods(
ASTContext &Context, ASTContext &Context,
ObjCPropertyDecl *property, ObjCPropertyDecl *property,
llvm::SmallVector<ObjCMethodDecl*, 32> &insMethods) { 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. // Find the default getter and if one not found, add one.
ObjCMethodDecl *GetterDecl = getInstanceMethod(property->getGetterName()); ObjCMethodDecl *GetterDecl = getInstanceMethod(property->getGetterName());
if (!GetterDecl) { if (!GetterDecl) {
@ -626,20 +632,20 @@ ObjCMethodDecl *ObjCInterfaceDecl::lookupClassMethod(Selector Sel) {
return NULL; return NULL;
} }
/// lookupInstanceMethod - This method returns an instance method by looking in /// getInstanceMethod - This method returns an instance method by
/// the class implementation. Unlike interfaces, we don't look outside the /// looking in the class implementation. Unlike interfaces, we don't
/// implementation. /// look outside the implementation.
ObjCMethodDecl *ObjCImplementationDecl::getInstanceMethod(Selector Sel) { ObjCMethodDecl *ObjCImplementationDecl::getInstanceMethod(Selector Sel) const {
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end(); I != E; ++I) for (instmeth_iterator I = instmeth_begin(), E = instmeth_end(); I != E; ++I)
if ((*I)->getSelector() == Sel) if ((*I)->getSelector() == Sel)
return *I; return *I;
return NULL; return NULL;
} }
/// lookupClassMethod - This method returns a class method by looking in /// getClassMethod - This method returns a class method by looking in
/// the class implementation. Unlike interfaces, we don't look outside the /// the class implementation. Unlike interfaces, we don't look outside
/// implementation. /// the implementation.
ObjCMethodDecl *ObjCImplementationDecl::getClassMethod(Selector Sel) { ObjCMethodDecl *ObjCImplementationDecl::getClassMethod(Selector Sel) const {
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end(); for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
I != E; ++I) I != E; ++I)
if ((*I)->getSelector() == Sel) if ((*I)->getSelector() == Sel)
@ -650,7 +656,7 @@ ObjCMethodDecl *ObjCImplementationDecl::getClassMethod(Selector Sel) {
// lookupInstanceMethod - This method returns an instance method by looking in // lookupInstanceMethod - This method returns an instance method by looking in
// the class implementation. Unlike interfaces, we don't look outside the // the class implementation. Unlike interfaces, we don't look outside the
// implementation. // implementation.
ObjCMethodDecl *ObjCCategoryImplDecl::getInstanceMethod(Selector Sel) { ObjCMethodDecl *ObjCCategoryImplDecl::getInstanceMethod(Selector Sel) const {
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end(); I != E; ++I) for (instmeth_iterator I = instmeth_begin(), E = instmeth_end(); I != E; ++I)
if ((*I)->getSelector() == Sel) if ((*I)->getSelector() == Sel)
return *I; return *I;
@ -660,7 +666,7 @@ ObjCMethodDecl *ObjCCategoryImplDecl::getInstanceMethod(Selector Sel) {
// lookupClassMethod - This method returns an instance method by looking in // lookupClassMethod - This method returns an instance method by looking in
// the class implementation. Unlike interfaces, we don't look outside the // the class implementation. Unlike interfaces, we don't look outside the
// implementation. // implementation.
ObjCMethodDecl *ObjCCategoryImplDecl::getClassMethod(Selector Sel) { ObjCMethodDecl *ObjCCategoryImplDecl::getClassMethod(Selector Sel) const {
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end(); for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
I != E; ++I) I != E; ++I)
if ((*I)->getSelector() == Sel) if ((*I)->getSelector() == Sel)