summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-28 18:42:10 +0000
committerChris Lattner <sabre@nondot.org>2009-02-28 18:42:10 +0000
commita9ca0529a18becaa10d3c8866fc0c424150140bc (patch)
tree0845210c58d557b37ed685a8efcdd7c44921098b /clang/lib/AST/DeclObjC.cpp
parent361bfcd9323cb9932c3c7d8f5e3f9c7fc5195276 (diff)
downloadbcm5719-llvm-a9ca0529a18becaa10d3c8866fc0c424150140bc.tar.gz
bcm5719-llvm-a9ca0529a18becaa10d3c8866fc0c424150140bc.zip
"This patch addresses two FIXME on ObjCCategoryImplDecl:
/// FIXME: Like ObjCImplementationDecl, this should not be a NamedDecl! /// FIXME: Introduce a new common base class for ObjCImplementationDecl and ObjCCategoryImplDecl It adds an IndentifierInfo ivar to the ObjCCategoryImplDecl, so it can inherits from Decl and not NamedDecl (I'm not sure about the memory management of this ivar). And now that both ObjCImplementationDecl and ObjCCategoryImplDecl have the same super classes, it allow creation of a common base class: ObjCImplDecl" Patch by Jean-Daniel Dupas! llvm-svn: 65703
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp62
1 files changed, 6 insertions, 56 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 1d2ad16479c..bdbcce750d0 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -525,7 +525,7 @@ ObjCCategoryImplDecl::Create(ASTContext &C, DeclContext *DC,
/// properties implemented in this category @implementation block and returns
/// the implemented property that uses it.
///
-ObjCPropertyImplDecl *ObjCCategoryImplDecl::
+ObjCPropertyImplDecl *ObjCImplDecl::
FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const {
for (propimpl_iterator i = propimpl_begin(), e = propimpl_end(); i != e; ++i){
ObjCPropertyImplDecl *PID = *i;
@@ -540,7 +540,7 @@ FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const {
/// added to the list of those properties @synthesized/@dynamic in this
/// category @implementation block.
///
-ObjCPropertyImplDecl *ObjCCategoryImplDecl::
+ObjCPropertyImplDecl *ObjCImplDecl::
FindPropertyImplDecl(IdentifierInfo *Id) const {
for (propimpl_iterator i = propimpl_begin(), e = propimpl_end(); i != e; ++i){
ObjCPropertyImplDecl *PID = *i;
@@ -550,20 +550,20 @@ FindPropertyImplDecl(IdentifierInfo *Id) const {
return 0;
}
-// lookupInstanceMethod - This method returns an instance method by looking in
+// getInstanceMethod - 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) const {
+ObjCMethodDecl *ObjCImplDecl::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 an instance method by looking in
+// getClassMethod - 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) const {
+ObjCMethodDecl *ObjCImplDecl::getClassMethod(Selector Sel) const {
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
I != E; ++I)
if ((*I)->getSelector() == Sel)
@@ -589,56 +589,6 @@ void ObjCImplementationDecl::Destroy(ASTContext &C) {
Decl::Destroy(C);
}
-/// 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;
-}
-
-/// 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)
- return *I;
- return NULL;
-}
-
-/// FindPropertyImplDecl - This method looks up a previous ObjCPropertyImplDecl
-/// added to the list of those properties @synthesized/@dynamic in this
-/// @implementation block.
-///
-ObjCPropertyImplDecl *ObjCImplementationDecl::
-FindPropertyImplDecl(IdentifierInfo *Id) const {
- for (propimpl_iterator i = propimpl_begin(), e = propimpl_end(); i != e; ++i){
- ObjCPropertyImplDecl *PID = *i;
- if (PID->getPropertyDecl()->getIdentifier() == Id)
- return PID;
- }
- return 0;
-}
-
-/// FindPropertyImplIvarDecl - This method lookup the ivar in the list of
-/// properties implemented in this @implementation block and returns the
-/// implemented property that uses it.
-///
-ObjCPropertyImplDecl *ObjCImplementationDecl::
-FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const {
- for (propimpl_iterator i = propimpl_begin(), e = propimpl_end(); i != e; ++i){
- ObjCPropertyImplDecl *PID = *i;
- if (PID->getPropertyIvarDecl() &&
- PID->getPropertyIvarDecl()->getIdentifier() == ivarId)
- return PID;
- }
- return 0;
-}
-
//===----------------------------------------------------------------------===//
// ObjCCompatibleAliasDecl
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud