[cfe-commits] r67894 - in /cfe/trunk: include/clang/AST/ASTConsumer.h lib/AST/ASTConsumer.cpp lib/Sema/ParseAST.cpp tools/clang-cc/Backend.cpp tools/clang-cc/RewriteObjC.cpp
Chris Lattner
sabre at nondot.org
Fri Mar 27 19:18:26 PDT 2009
Author: lattner
Date: Fri Mar 27 21:18:25 2009
New Revision: 67894
URL: http://llvm.org/viewvc/llvm-project?rev=67894&view=rev
Log:
eliminate ASTConsumer::InitializeTU, all clients are
happy with just ASTContext, they don't need a TU.
Modified:
cfe/trunk/include/clang/AST/ASTConsumer.h
cfe/trunk/lib/AST/ASTConsumer.cpp
cfe/trunk/lib/Sema/ParseAST.cpp
cfe/trunk/tools/clang-cc/Backend.cpp
cfe/trunk/tools/clang-cc/RewriteObjC.cpp
Modified: cfe/trunk/include/clang/AST/ASTConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTConsumer.h?rev=67894&r1=67893&r2=67894&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ASTConsumer.h (original)
+++ cfe/trunk/include/clang/AST/ASTConsumer.h Fri Mar 27 21:18:25 2009
@@ -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
Modified: cfe/trunk/lib/AST/ASTConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTConsumer.cpp?rev=67894&r1=67893&r2=67894&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTConsumer.cpp (original)
+++ cfe/trunk/lib/AST/ASTConsumer.cpp Fri Mar 27 21:18:25 2009
@@ -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());
-}
Modified: cfe/trunk/lib/Sema/ParseAST.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/ParseAST.cpp?rev=67894&r1=67893&r2=67894&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/ParseAST.cpp (original)
+++ cfe/trunk/lib/Sema/ParseAST.cpp Fri Mar 27 21:18:25 2009
@@ -42,7 +42,7 @@
// Initialize the parser.
P.Initialize();
- Consumer->InitializeTU(TU);
+ Consumer->Initialize(TU.getContext());
Parser::DeclTy *ADecl;
Modified: cfe/trunk/tools/clang-cc/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/Backend.cpp?rev=67894&r1=67893&r2=67894&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/Backend.cpp (original)
+++ cfe/trunk/tools/clang-cc/Backend.cpp Fri Mar 27 21:18:25 2009
@@ -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();
Modified: cfe/trunk/tools/clang-cc/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/RewriteObjC.cpp?rev=67894&r1=67893&r2=67894&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/RewriteObjC.cpp (original)
+++ cfe/trunk/tools/clang-cc/RewriteObjC.cpp Fri Mar 27 21:18:25 2009
@@ -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);
More information about the cfe-commits
mailing list