diff options
author | Nico Weber <nicolasweber@gmx.de> | 2011-01-25 20:34:14 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2011-01-25 20:34:14 +0000 |
commit | 2992efa403cde194341dae33dc7b165004b3c5d3 (patch) | |
tree | c030738e3c968b0c0f6f32b503f3491adeb35ce2 /clang/lib/CodeGen/CodeGenAction.cpp | |
parent | 08a4f8f197fd73be1b19e0124886b7d4f46690f6 (diff) | |
download | bcm5719-llvm-2992efa403cde194341dae33dc7b165004b3c5d3.tar.gz bcm5719-llvm-2992efa403cde194341dae33dc7b165004b3c5d3.zip |
Add -add-plugin flag, which runs plugins in addition to codegen.
llvm-svn: 124227
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenAction.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index 9660e68c707..69ac995a468 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -28,7 +28,7 @@ using namespace clang; using namespace llvm; -namespace { +namespace clang { class BackendConsumer : public ASTConsumer { Diagnostic &Diags; BackendAction Action; @@ -236,10 +236,7 @@ void CodeGenAction::EndSourceFileAction() { return; // Steal the module from the consumer. - BackendConsumer *Consumer = static_cast<BackendConsumer*>( - &getCompilerInstance().getASTConsumer()); - - TheModule.reset(Consumer->takeModule()); + TheModule.reset(BEConsumer->takeModule()); } llvm::Module *CodeGenAction::takeModule() { @@ -274,10 +271,12 @@ ASTConsumer *CodeGenAction::CreateASTConsumer(CompilerInstance &CI, if (BA != Backend_EmitNothing && !OS) return 0; - return new BackendConsumer(BA, CI.getDiagnostics(), - CI.getCodeGenOpts(), CI.getTargetOpts(), - CI.getFrontendOpts().ShowTimers, InFile, OS.take(), - CI.getLLVMContext()); + BEConsumer = + new BackendConsumer(BA, CI.getDiagnostics(), + CI.getCodeGenOpts(), CI.getTargetOpts(), + CI.getFrontendOpts().ShowTimers, InFile, OS.take(), + CI.getLLVMContext()); + return BEConsumer; } void CodeGenAction::ExecuteAction() { |