/// 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
#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());
-}
// Initialize the parser.
P.Initialize();
- Consumer->InitializeTU(TU);
+ Consumer->Initialize(TU.getContext());
Parser::DeclTy *ADecl;
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();
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);