summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-08-19 14:32:16 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-08-19 14:32:16 +0000
commitaca3be852a29801635294a8238e9b80af6732b92 (patch)
tree216e9a74eeed51a34c68a7e7ff1c3d9796250d83 /clang
parent85618b3194d40c8df5eb6d096113f7532dfe26cb (diff)
downloadbcm5719-llvm-aca3be852a29801635294a8238e9b80af6732b92.tar.gz
bcm5719-llvm-aca3be852a29801635294a8238e9b80af6732b92.zip
Go back to having a takeModule instead of a getModule.
Returning a std::unique_ptr is more constrained. Thanks to David Blaikie for the suggestion. llvm-svn: 215979
Diffstat (limited to 'clang')
-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