summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-02-14 20:59:39 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-02-14 20:59:39 +0000
commit02a3fb15038a943bc1347df8397d72ec56ee3a80 (patch)
treea900576d23cc4204d488bca854fe4013632bce4b /llvm/tools/bugpoint
parenta06ca4bd9016e396badf29252d982198bebb8283 (diff)
downloadbcm5719-llvm-02a3fb15038a943bc1347df8397d72ec56ee3a80.tar.gz
bcm5719-llvm-02a3fb15038a943bc1347df8397d72ec56ee3a80.zip
Use std::unique_ptr. NFC.
llvm-svn: 325172
Diffstat (limited to 'llvm/tools/bugpoint')
-rw-r--r--llvm/tools/bugpoint/CrashDebugger.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp
index a5c8f294d4b..c0a92bc6d82 100644
--- a/llvm/tools/bugpoint/CrashDebugger.cpp
+++ b/llvm/tools/bugpoint/CrashDebugger.cpp
@@ -854,7 +854,7 @@ bool ReduceCrashingNamedMDOps::TestNamedMDOps(
outs() << " named metadata operands: ";
ValueToValueMapTy VMap;
- Module *M = CloneModule(*BD.getProgram(), VMap).release();
+ std::unique_ptr<Module> M = CloneModule(*BD.getProgram(), VMap);
// This is a little wasteful. In the future it might be good if we could have
// these dropped during cloning.
@@ -874,17 +874,17 @@ bool ReduceCrashingNamedMDOps::TestNamedMDOps(
Passes.run(*M);
// Try running on the hacked up program...
- if (TestFn(BD, M)) {
+ if (TestFn(BD, M.get())) {
// Make sure to use instruction pointers that point into the now-current
// module, and that they don't include any deleted blocks.
NamedMDOps.clear();
for (const MDNode *Node : OldMDNodeOps)
NamedMDOps.push_back(cast<MDNode>(*VMap.getMappedMD(Node)));
- BD.setNewProgram(M); // It crashed, keep the trimmed version...
+ BD.setNewProgram(M.release()); // It crashed, keep the trimmed version...
return true;
}
- delete M; // It didn't crash, try something else.
+ // It didn't crash, try something else.
return false;
}
OpenPOWER on IntegriCloud