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 efb701e..545192c 100644
--- a/include/clang/AST/ASTConsumer.h
+++ b/include/clang/AST/ASTConsumer.h
@@ -32,8 +32,6 @@
   /// 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 bf6a0cb..b3919f1 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 6b40d7f..bbca551 100644
--- a/lib/Sema/ParseAST.cpp
+++ b/lib/Sema/ParseAST.cpp
@@ -42,7 +42,7 @@
   // 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 c5eeb64..39d5c90 100644
--- a/tools/clang-cc/Backend.cpp
+++ b/tools/clang-cc/Backend.cpp
@@ -102,18 +102,17 @@
       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 2ce983c..2a34604 100644
--- a/tools/clang-cc/RewriteObjC.cpp
+++ b/tools/clang-cc/RewriteObjC.cpp
@@ -126,11 +126,6 @@
   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);