]> granicus.if.org Git - clang/commitdiff
eliminate ASTConsumer::InitializeTU, all clients are
authorChris Lattner <sabre@nondot.org>
Sat, 28 Mar 2009 02:18:25 +0000 (02:18 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 28 Mar 2009 02:18:25 +0000 (02:18 +0000)
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

include/clang/AST/ASTConsumer.h
lib/AST/ASTConsumer.cpp
lib/Sema/ParseAST.cpp
tools/clang-cc/Backend.cpp
tools/clang-cc/RewriteObjC.cpp

index efb701e6d5acb7e3b99f9f069fe94f6c4fa9f9fe..545192c4f698a395a0904c0a12aa3432879f5532 100644 (file)
@@ -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
index bf6a0cb761373a0350c6c4df514b4701dcec45fb..b3919f17714a1716615610b657bb0498cf3dc996 100644 (file)
 #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());
-}
index 6b40d7fd185d4f0713692bb8c60da50b6e9a4bd7..bbca5515216c365a5785fa2cf45e0155c274a026 100644 (file)
@@ -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;
   
index c5eeb640b6c9e5f16deb6a16f6a7c589e506f7ae..39d5c905f826416f11ce9c8ded4e9023386f4a70 100644 (file)
@@ -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();
index 2ce983ca8582bf113d4a25595b9f77d3a8e4199f..2a3460492c505a01026e800d5161a249fa4a4171 100644 (file)
@@ -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);