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
This commit is contained in:
Rafael Espindola 2014-08-19 14:32:16 +00:00
parent 85618b3194
commit aca3be852a
2 changed files with 2 additions and 2 deletions

View File

@ -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.

View File

@ -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();