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 | deafd0b2a42b16568f416fbe218db82d56e2d89d (patch) | |
tree | 95d9f29e2f42e149a9aa1275d62d2b829da42c7f /clang/lib/AST | |
parent | 45146a12cf0f3c0ebacc83ef936650c69e3303c8 (diff) | |
download | bcm5719-llvm-deafd0b2a42b16568f416fbe218db82d56e2d89d.tar.gz bcm5719-llvm-deafd0b2a42b16568f416fbe218db82d56e2d89d.zip |
Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDecl
covers both declarations (@class) and definitions (@interface) of an
Objective-C class.
llvm-svn: 147299
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 30 | ||||
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 6 | ||||
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 22 | ||||
-rw-r--r-- | clang/lib/AST/DeclPrinter.cpp | 5 | ||||
-rw-r--r-- | clang/lib/AST/DumpXML.cpp | 5 |
5 files changed, 0 insertions, 68 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index a95c941e02e..67045059cfd 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/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/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 024f370c56d..983673fec8f 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/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/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index a204e45bac9..75100ecb3cb 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/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/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index 03a69a04185..9b72bb416af 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/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/clang/lib/AST/DumpXML.cpp b/clang/lib/AST/DumpXML.cpp index e0ea612dc29..959bbcbb174 100644 --- a/clang/lib/AST/DumpXML.cpp +++ b/clang/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; |