forked from OSchip/llvm-project
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:
parent
85618b3194
commit
aca3be852a
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue