summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-02-14 21:10:29 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-02-14 21:10:29 +0000
commita7b0794042e3857f5cd12cdde747fa57ee3a39e8 (patch)
treeae7c163b6543d3ea93acb747d9835ba1fa2045d2 /llvm/tools
parent02a3fb15038a943bc1347df8397d72ec56ee3a80 (diff)
downloadbcm5719-llvm-a7b0794042e3857f5cd12cdde747fa57ee3a39e8.tar.gz
bcm5719-llvm-a7b0794042e3857f5cd12cdde747fa57ee3a39e8.zip
Use std::unique_ptr. NFC.
llvm-svn: 325173
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/bugpoint/Miscompilation.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp
index 4661ffd9f90..fe50492f820 100644
--- a/llvm/tools/bugpoint/Miscompilation.cpp
+++ b/llvm/tools/bugpoint/Miscompilation.cpp
@@ -243,10 +243,9 @@ static Expected<std::unique_ptr<Module>> testMergedProgram(const BugDriver &BD,
return std::move(Merged);
}
-/// TestFuncs - split functions in a Module into two groups: those that are
-/// under consideration for miscompilation vs. those that are not, and test
+/// split functions in a Module into two groups: those that are under
+/// consideration for miscompilation vs. those that are not, and test
/// accordingly. Each group of functions becomes a separate Module.
-///
Expected<bool>
ReduceMiscompilingFunctions::TestFuncs(const std::vector<Function *> &Funcs) {
// Test to see if the function is misoptimized if we ONLY run it on the
@@ -266,8 +265,8 @@ ReduceMiscompilingFunctions::TestFuncs(const std::vector<Function *> &Funcs) {
// we can conclude that a function triggers the bug when in fact one
// needs a larger set of original functions to do so.
ValueToValueMapTy VMap;
- Module *Clone = CloneModule(*BD.getProgram(), VMap).release();
- Module *Orig = BD.swapProgramIn(Clone);
+ std::unique_ptr<Module> Clone = CloneModule(*BD.getProgram(), VMap);
+ std::unique_ptr<Module> Orig(BD.swapProgramIn(Clone.release()));
std::vector<Function *> FuncsOnClone;
for (unsigned i = 0, e = Funcs.size(); i != e; ++i) {
@@ -284,7 +283,7 @@ ReduceMiscompilingFunctions::TestFuncs(const std::vector<Function *> &Funcs) {
Expected<bool> Broken =
TestFn(BD, std::move(ToOptimize), std::move(ToNotOptimize));
- delete BD.swapProgramIn(Orig);
+ delete BD.swapProgramIn(Orig.release());
return Broken;
}
OpenPOWER on IntegriCloud