diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/CodeGen/CodeGenAction.h | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenAction.cpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/include/clang/CodeGen/CodeGenAction.h b/clang/include/clang/CodeGen/CodeGenAction.h index 2408bc4f9e7..f8fd56152f2 100644 --- a/clang/include/clang/CodeGen/CodeGenAction.h +++ b/clang/include/clang/CodeGen/CodeGenAction.h @@ -54,7 +54,7 @@ public: /// Take the generated LLVM module, for use after the action has been run. /// The result may be null on failure. - std::unique_ptr<llvm::Module> takeModule() { return std::move(TheModule); } + std::unique_ptr<llvm::Module> takeModule(); /// Take the LLVM context used by this action. llvm::LLVMContext *takeLLVMContext(); diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index ab0ca18a3de..53074a65504 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -579,6 +579,10 @@ void CodeGenAction::EndSourceFileAction() { TheModule.reset(BEConsumer->takeModule()); } +std::unique_ptr<llvm::Module> CodeGenAction::takeModule() { + return std::move(TheModule); +} + llvm::LLVMContext *CodeGenAction::takeLLVMContext() { OwnsVMContext = false; return VMContext; |