From: Chris Lattner Date: Sat, 28 Mar 2009 02:18:25 +0000 (+0000) Subject: eliminate ASTConsumer::InitializeTU, all clients are X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bb0da001fc579410035cec00b6bca499251a318;p=clang eliminate ASTConsumer::InitializeTU, all clients are happy with just ASTContext, they don't need a TU. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67894 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ASTConsumer.h b/include/clang/AST/ASTConsumer.h index efb701e6d5..545192c4f6 100644 --- a/include/clang/AST/ASTConsumer.h +++ b/include/clang/AST/ASTConsumer.h @@ -32,8 +32,6 @@ public: /// ASTContext. virtual void Initialize(ASTContext &Context) {} - virtual void InitializeTU(TranslationUnit& TU); - /// HandleTopLevelDecl - Handle the specified top-level declaration. This is /// called by the parser to process every top-level Decl*. Note that D can /// be the head of a chain of Decls (e.g. for `int a, b` the chain will have diff --git a/lib/AST/ASTConsumer.cpp b/lib/AST/ASTConsumer.cpp index bf6a0cb761..b3919f1771 100644 --- a/lib/AST/ASTConsumer.cpp +++ b/lib/AST/ASTConsumer.cpp @@ -14,11 +14,6 @@ #include "clang/AST/ASTConsumer.h" #include "clang/AST/Decl.h" #include "clang/AST/TranslationUnit.h" - using namespace clang; ASTConsumer::~ASTConsumer() {} - -void ASTConsumer::InitializeTU(TranslationUnit& TU) { - Initialize(TU.getContext()); -} diff --git a/lib/Sema/ParseAST.cpp b/lib/Sema/ParseAST.cpp index 6b40d7fd18..bbca551521 100644 --- a/lib/Sema/ParseAST.cpp +++ b/lib/Sema/ParseAST.cpp @@ -42,7 +42,7 @@ void clang::ParseAST(Preprocessor &PP, ASTConsumer *Consumer, // Initialize the parser. P.Initialize(); - Consumer->InitializeTU(TU); + Consumer->Initialize(TU.getContext()); Parser::DeclTy *ADecl; diff --git a/tools/clang-cc/Backend.cpp b/tools/clang-cc/Backend.cpp index c5eeb640b6..39d5c905f8 100644 --- a/tools/clang-cc/Backend.cpp +++ b/tools/clang-cc/Backend.cpp @@ -102,18 +102,17 @@ namespace { delete PerFunctionPasses; } - virtual void InitializeTU(TranslationUnit& TU) { - Context = &TU.getContext(); + virtual void Initialize(ASTContext &Ctx) { + Context = &Ctx; if (CompileOpts.TimePasses) LLVMIRGeneration.startTimer(); - Gen->InitializeTU(TU); + Gen->Initialize(Ctx); TheModule = Gen->GetModule(); ModuleProvider = new ExistingModuleProvider(TheModule); - TheTargetData = - new llvm::TargetData(TU.getContext().Target.getTargetDescription()); + TheTargetData = new llvm::TargetData(Ctx.Target.getTargetDescription()); if (CompileOpts.TimePasses) LLVMIRGeneration.stopTimer(); diff --git a/tools/clang-cc/RewriteObjC.cpp b/tools/clang-cc/RewriteObjC.cpp index 2ce983ca85..2a3460492c 100644 --- a/tools/clang-cc/RewriteObjC.cpp +++ b/tools/clang-cc/RewriteObjC.cpp @@ -126,11 +126,6 @@ namespace { public: virtual void Initialize(ASTContext &context); - virtual void InitializeTU(TranslationUnit &TU) { - Initialize(TU.getContext()); - } - - // Top Level Driver code. virtual void HandleTopLevelDecl(Decl *D); void HandleDeclInMainFile(Decl *D);