summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/examples/clang-interpreter/main.cpp2
-rw-r--r--clang/include/clang/CodeGen/CodeGenAction.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/examples/clang-interpreter/main.cpp b/clang/examples/clang-interpreter/main.cpp
index 5cc5d524f19..60cb7041070 100644
--- a/clang/examples/clang-interpreter/main.cpp
+++ b/clang/examples/clang-interpreter/main.cpp
@@ -165,7 +165,7 @@ int main(int argc, const char **argv, char * const *envp) {
return 1;
int Res = 255;
- if (std::unique_ptr<llvm::Module> &Module = Act->getModule())
+ if (std::unique_ptr<llvm::Module> Module = Act->takeModule())
Res = Execute(std::move(Module), envp);
// Shutdown.
diff --git a/clang/include/clang/CodeGen/CodeGenAction.h b/clang/include/clang/CodeGen/CodeGenAction.h
index 282202184b6..2408bc4f9e7 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> &getModule() { return TheModule; }
+ std::unique_ptr<llvm::Module> takeModule() { return std::move(TheModule); }
/// Take the LLVM context used by this action.
llvm::LLVMContext *takeLLVMContext();
OpenPOWER on IntegriCloud