[llvm] r325176 - Use std::uniue_ptr. NFC.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 14 13:25:07 PST 2018
Author: rafael
Date: Wed Feb 14 13:25:07 2018
New Revision: 325176
URL: http://llvm.org/viewvc/llvm-project?rev=325176&view=rev
Log:
Use std::uniue_ptr. NFC.
Modified:
llvm/trunk/tools/bugpoint/Miscompilation.cpp
Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=325176&r1=325175&r2=325176&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original)
+++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Wed Feb 14 13:25:07 2018
@@ -501,8 +501,8 @@ ReduceMiscompiledBlocks::TestFuncs(const
// Split the module into the two halves of the program we want.
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;
std::vector<BasicBlock *> BBsOnClone;
for (unsigned i = 0, e = FunctionsBeingTested.size(); i != e; ++i) {
@@ -524,10 +524,10 @@ ReduceMiscompiledBlocks::TestFuncs(const
if (std::unique_ptr<Module> New =
BD.extractMappedBlocksFromModule(BBsOnClone, ToOptimize.get())) {
Expected<bool> Ret = TestFn(BD, std::move(New), std::move(ToNotOptimize));
- delete BD.swapProgramIn(Orig);
+ delete BD.swapProgramIn(Orig.release());
return Ret;
}
- delete BD.swapProgramIn(Orig);
+ delete BD.swapProgramIn(Orig.release());
return false;
}
More information about the llvm-commits
mailing list