diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-27 22:43:10 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-27 22:43:10 +0000 |
commit | 375bb1413c041055262c8a416f20d10474a5eda9 (patch) | |
tree | 66e5d219fe54a005bd13828eaab0234e08ca13fc /lib/AST | |
parent | fedb6ecbed93c6bf12a02d61b2421d6f0da3b4fc (diff) |
Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDecl
covers both declarations (@class) and definitions (@interface) of an
Objective-C class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/ASTImporter.cpp | 30 | ||||
-rw-r--r-- | lib/AST/DeclBase.cpp | 6 | ||||
-rw-r--r-- | lib/AST/DeclObjC.cpp | 22 | ||||
-rw-r--r-- | lib/AST/DeclPrinter.cpp | 5 | ||||
-rw-r--r-- | lib/AST/DumpXML.cpp | 5 |
5 files changed, 0 insertions, 68 deletions
diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index a95c941e02..67045059cf 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -128,7 +128,6 @@ namespace clang { Decl *VisitObjCPropertyDecl(ObjCPropertyDecl *D); Decl *VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D); Decl *VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D); - Decl *VisitObjCClassDecl(ObjCClassDecl *D); Decl *VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D); Decl *VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D); Decl *VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D); @@ -3605,35 +3604,6 @@ ASTNodeImporter::VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D) { return ToForward; } -Decl *ASTNodeImporter::VisitObjCClassDecl(ObjCClassDecl *D) { - // Import the context of this declaration. - DeclContext *DC = Importer.ImportContext(D->getDeclContext()); - if (!DC) - return 0; - - DeclContext *LexicalDC = DC; - if (D->getDeclContext() != D->getLexicalDeclContext()) { - LexicalDC = Importer.ImportContext(D->getLexicalDeclContext()); - if (!LexicalDC) - return 0; - } - - // Import the location of this declaration. - SourceLocation Loc = Importer.Import(D->getLocation()); - ObjCInterfaceDecl *ToIface - = cast_or_null<ObjCInterfaceDecl>( - Importer.Import(D->getForwardInterfaceDecl())); - ObjCClassDecl *ToClass = ObjCClassDecl::Create(Importer.getToContext(), DC, - Loc, - ToIface, - Importer.Import(D->getNameLoc())); - - ToClass->setLexicalDeclContext(LexicalDC); - LexicalDC->addDeclInternal(ToClass); - Importer.Imported(D, ToClass); - return ToClass; -} - Decl *ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { // For template arguments, we adopt the translation unit as our declaration // context. This context will be fixed when the actual template declaration diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 024f370c56..983673fec8 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -495,7 +495,6 @@ unsigned Decl::getIdentifierNamespaceForKind(Kind DeclKind) { case LinkageSpec: case FileScopeAsm: case StaticAssert: - case ObjCClass: case ObjCPropertyImpl: case ObjCForwardProtocol: case Block: @@ -1062,11 +1061,6 @@ void DeclContext::buildLookup(DeclContext *DCtx) { if (D->getDeclContext() == DCtx) makeDeclVisibleInContextImpl(ND, false); - // Insert any forward-declared Objective-C interface into the lookup - // data structure. - if (ObjCClassDecl *Class = dyn_cast<ObjCClassDecl>(*D)) - makeDeclVisibleInContextImpl(Class->getForwardInterfaceDecl(), false); - // If this declaration is itself a transparent declaration context or // inline namespace, add its members (recursively). if (DeclContext *InnerCtx = dyn_cast<DeclContext>(*D)) diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index a204e45bac..75100ecb3c 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -1011,28 +1011,6 @@ void ObjCProtocolDecl::completedForwardDecl() { } //===----------------------------------------------------------------------===// -// ObjCClassDecl -//===----------------------------------------------------------------------===// - -ObjCClassDecl::ObjCClassDecl(DeclContext *DC, SourceLocation L, - ObjCInterfaceDecl *Interface, - SourceLocation InterfaceLoc) - : Decl(ObjCClass, DC, L), Interface(Interface), InterfaceLoc(InterfaceLoc) -{ -} - -ObjCClassDecl *ObjCClassDecl::Create(ASTContext &C, DeclContext *DC, - SourceLocation L, - ObjCInterfaceDecl *Interface, - SourceLocation InterfaceLoc) { - return new (C) ObjCClassDecl(DC, L, Interface, InterfaceLoc); -} - -SourceRange ObjCClassDecl::getSourceRange() const { - return SourceRange(getLocation(), InterfaceLoc); -} - -//===----------------------------------------------------------------------===// // ObjCForwardProtocolDecl //===----------------------------------------------------------------------===// diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index 03a69a0418..9b72bb416a 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -70,7 +70,6 @@ namespace { void VisitFunctionTemplateDecl(FunctionTemplateDecl *D); void VisitClassTemplateDecl(ClassTemplateDecl *D); void VisitObjCMethodDecl(ObjCMethodDecl *D); - void VisitObjCClassDecl(ObjCClassDecl *D); void VisitObjCImplementationDecl(ObjCImplementationDecl *D); void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D); void VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D); @@ -847,10 +846,6 @@ void DeclPrinter::VisitClassTemplateDecl(ClassTemplateDecl *D) { // Objective-C declarations //---------------------------------------------------------------------------- -void DeclPrinter::VisitObjCClassDecl(ObjCClassDecl *D) { - Out << "@class " << *D->getForwardInterfaceDecl(); -} - void DeclPrinter::VisitObjCMethodDecl(ObjCMethodDecl *OMD) { if (OMD->isInstanceMethod()) Out << "- "; diff --git a/lib/AST/DumpXML.cpp b/lib/AST/DumpXML.cpp index e0ea612dc2..959bbcbb17 100644 --- a/lib/AST/DumpXML.cpp +++ b/lib/AST/DumpXML.cpp @@ -740,11 +740,6 @@ struct XMLDumper : public XMLDeclVisitor<XMLDumper>, visitDeclContext(D); } - // ObjCClassDecl - void visitObjCClassDeclChildren(ObjCClassDecl *D) { - visitDeclRef(D->getForwardInterfaceDecl()); - } - // ObjCInterfaceDecl void visitCategoryList(ObjCCategoryDecl *D) { if (!D) return; |