Use std::unique_ptr. NFC.
llvm-svn: 325170
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp
index 1548d4d..a5c8f29 100644
--- a/llvm/tools/bugpoint/CrashDebugger.cpp
+++ b/llvm/tools/bugpoint/CrashDebugger.cpp
@@ -775,7 +775,7 @@
bool ReduceCrashingNamedMD::TestNamedMDs(std::vector<std::string> &NamedMDs) {
ValueToValueMapTy VMap;
- Module *M = CloneModule(*BD.getProgram(), VMap).release();
+ std::unique_ptr<Module> M = CloneModule(*BD.getProgram(), VMap);
outs() << "Checking for crash with only these named metadata nodes:";
unsigned NumPrint = std::min<size_t>(NamedMDs.size(), 10);
@@ -809,11 +809,10 @@
Passes.run(*M);
// Try running on the hacked up program...
- if (TestFn(BD, M)) {
- BD.setNewProgram(M); // It crashed, keep the trimmed version...
+ if (TestFn(BD, M.get())) {
+ BD.setNewProgram(M.release()); // It crashed, keep the trimmed version...
return true;
}
- delete M; // It didn't crash, try something else.
return false;
}