diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-16 23:16:33 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-16 23:16:33 +0000 |
commit | 434e95618176ee4eb29237859eb6fa04e3c52e06 (patch) | |
tree | 9e9ad1c9ffba868edee4811937a0703a27b32755 /llvm/tools/bugpoint/Miscompilation.cpp | |
parent | bfba572425bd2f88c7ae406efe350c323812643f (diff) | |
download | bcm5719-llvm-434e95618176ee4eb29237859eb6fa04e3c52e06.tar.gz bcm5719-llvm-434e95618176ee4eb29237859eb6fa04e3c52e06.zip |
Change linkInModule to take a std::unique_ptr.
Passing in a std::unique_ptr should help find errors when the module
is used after being linked into another module.
llvm-svn: 255842
Diffstat (limited to 'llvm/tools/bugpoint/Miscompilation.cpp')
-rw-r--r-- | llvm/tools/bugpoint/Miscompilation.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp index 2c64e372256..16919f5a449 100644 --- a/llvm/tools/bugpoint/Miscompilation.cpp +++ b/llvm/tools/bugpoint/Miscompilation.cpp @@ -221,7 +221,7 @@ static std::unique_ptr<Module> testMergedProgram(const BugDriver &BD, std::unique_ptr<Module> M2, std::string &Error, bool &Broken) { - if (Linker::linkModules(*M1, *M2)) + if (Linker::linkModules(*M1, std::move(M2))) exit(1); // Execute the program. @@ -387,7 +387,8 @@ static bool ExtractLoops(BugDriver &BD, MisCompFunctions.emplace_back(F->getName(), F->getFunctionType()); } - if (Linker::linkModules(*ToNotOptimize, *ToOptimizeLoopExtracted)) + if (Linker::linkModules(*ToNotOptimize, + std::move(ToOptimizeLoopExtracted))) exit(1); MiscompiledFunctions.clear(); @@ -414,7 +415,7 @@ static bool ExtractLoops(BugDriver &BD, // extraction both didn't break the program, and didn't mask the problem. // Replace the current program with the loop extracted version, and try to // extract another loop. - if (Linker::linkModules(*ToNotOptimize, *ToOptimizeLoopExtracted)) + if (Linker::linkModules(*ToNotOptimize, std::move(ToOptimizeLoopExtracted))) exit(1); // All of the Function*'s in the MiscompiledFunctions list are in the old @@ -582,7 +583,7 @@ static bool ExtractBlocks(BugDriver &BD, if (!I->isDeclaration()) MisCompFunctions.emplace_back(I->getName(), I->getFunctionType()); - if (Linker::linkModules(*ProgClone, *Extracted)) + if (Linker::linkModules(*ProgClone, std::move(Extracted))) exit(1); // Set the new program and delete the old one. |