aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-07-17 22:34:12 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-07-17 22:34:12 +0000
commit62a56f39b7c5587a1b2144880500689bea5f32e4 (patch)
treec6f21dd30c4dfd02f50e4ca54712b24f2022a6f4 /clang/lib/CodeGen/CodeGenAction.cpp
parent5bae2c87d5946ee72ad31d88033ed5ecbd01ada2 (diff)
downloadllvm-62a56f39b7c5587a1b2144880500689bea5f32e4.zip
llvm-62a56f39b7c5587a1b2144880500689bea5f32e4.tar.gz
llvm-62a56f39b7c5587a1b2144880500689bea5f32e4.tar.bz2
Revert "unique_ptr-ify ownership of ASTConsumers"
This reverts commit r213307. Reverting to have some on-list discussion/confirmation about the ongoing direction of smart pointer usage in the LLVM project. llvm-svn: 213325
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 0c94949..559c2ef 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -590,8 +590,8 @@ static raw_ostream *GetOutputStream(CompilerInstance &CI,
llvm_unreachable("Invalid action!");
}
-std::unique_ptr<ASTConsumer>
-CodeGenAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
+ASTConsumer *CodeGenAction::CreateASTConsumer(CompilerInstance &CI,
+ StringRef InFile) {
BackendAction BA = static_cast<BackendAction>(Act);
std::unique_ptr<raw_ostream> OS(GetOutputStream(CI, InFile, BA));
if (BA != Backend_EmitNothing && !OS)
@@ -623,12 +623,11 @@ CodeGenAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
LinkModuleToUse = ModuleOrErr.get();
}
- auto Result = llvm::make_unique<BackendConsumer>(
- BA, CI.getDiagnostics(), CI.getCodeGenOpts(), CI.getTargetOpts(),
- CI.getLangOpts(), (bool)CI.getFrontendOpts().ShowTimers, InFile,
- LinkModuleToUse, OS.release(), *VMContext);
- BEConsumer = Result.get();
- return std::move(Result);
+ BEConsumer = new BackendConsumer(BA, CI.getDiagnostics(), CI.getCodeGenOpts(),
+ CI.getTargetOpts(), CI.getLangOpts(),
+ CI.getFrontendOpts().ShowTimers, InFile,
+ LinkModuleToUse, OS.release(), *VMContext);
+ return BEConsumer;
}
void CodeGenAction::ExecuteAction() {