diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-27 19:04:32 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-27 19:04:32 +0000 |
commit | aecae629269fae3bf484baf1d109e9a89d14eead (patch) | |
tree | 3a0af3603b7277b0d54e10ff7368f7f93c996ce8 /lib | |
parent | 6779647c8922c60184873bacdc6743eba6b4942c (diff) |
Make ObjCImplDecl inherit from ObjCContainerDecl.
ObjCContainerDecl now is the root class for objc decls that contain methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77235 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/DeclObjC.cpp | 22 | ||||
-rw-r--r-- | lib/Frontend/PCHReaderDecl.cpp | 3 | ||||
-rw-r--r-- | lib/Frontend/PCHWriterDecl.cpp | 3 | ||||
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 4 |
4 files changed, 4 insertions, 28 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index d9005f8f3c..e082a41551 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -587,28 +587,6 @@ FindPropertyImplDecl(IdentifierInfo *Id) const { return 0; } -// getMethod - This method returns an instance/class method by looking in -// the class implementation. Unlike interfaces, we don't look outside the -// implementation. -ObjCMethodDecl *ObjCImplDecl::getMethod(Selector Sel, bool isInstance) const { - // Since instance & class methods can have the same name, the loop below - // ensures we get the correct method. - // - // @interface Whatever - // - (int) class_method; - // + (float) class_method; - // @end - // - lookup_const_iterator Meth, MethEnd; - for (llvm::tie(Meth, MethEnd) = lookup(Sel); - Meth != MethEnd; ++Meth) { - ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(*Meth); - if (MD && MD->isInstanceMethod() == isInstance) - return MD; - } - return 0; -} - //===----------------------------------------------------------------------===// // ObjCImplementationDecl //===----------------------------------------------------------------------===// diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp index 3dbea5e8b0..99a1a16835 100644 --- a/lib/Frontend/PCHReaderDecl.cpp +++ b/lib/Frontend/PCHReaderDecl.cpp @@ -304,10 +304,9 @@ void PCHDeclReader::VisitObjCPropertyDecl(ObjCPropertyDecl *D) { } void PCHDeclReader::VisitObjCImplDecl(ObjCImplDecl *D) { - VisitNamedDecl(D); + VisitObjCContainerDecl(D); D->setClassInterface( cast_or_null<ObjCInterfaceDecl>(Reader.GetDecl(Record[Idx++]))); - D->setLocEnd(SourceLocation::getFromRawEncoding(Record[Idx++])); } void PCHDeclReader::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D) { diff --git a/lib/Frontend/PCHWriterDecl.cpp b/lib/Frontend/PCHWriterDecl.cpp index fba11f8e95..4239798ac8 100644 --- a/lib/Frontend/PCHWriterDecl.cpp +++ b/lib/Frontend/PCHWriterDecl.cpp @@ -297,9 +297,8 @@ void PCHDeclWriter::VisitObjCPropertyDecl(ObjCPropertyDecl *D) { } void PCHDeclWriter::VisitObjCImplDecl(ObjCImplDecl *D) { - VisitNamedDecl(D); + VisitObjCContainerDecl(D); Writer.AddDeclRef(D->getClassInterface(), Record); - Writer.AddSourceLocation(D->getLocEnd(), Record); // Abstract class (no need to define a stable pch::DECL code). } diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 8bd2f530e4..26f590578c 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1555,12 +1555,12 @@ void Sema::ActOnAtEnd(SourceLocation AtEndLoc, DeclPtrTy classDecl, CDecl->setAtEndLoc(AtEndLoc); } if (ObjCImplementationDecl *IC=dyn_cast<ObjCImplementationDecl>(ClassDecl)) { - IC->setLocEnd(AtEndLoc); + IC->setAtEndLoc(AtEndLoc); if (ObjCInterfaceDecl* IDecl = IC->getClassInterface()) ImplMethodsVsClassMethods(IC, IDecl); } else if (ObjCCategoryImplDecl* CatImplClass = dyn_cast<ObjCCategoryImplDecl>(ClassDecl)) { - CatImplClass->setLocEnd(AtEndLoc); + CatImplClass->setAtEndLoc(AtEndLoc); // Find category interface decl and then check that all methods declared // in this interface are implemented in the category @implementation. |