[llvm] r325170 - Use std::unique_ptr. NFC.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 14 12:53:38 PST 2018
Author: rafael
Date: Wed Feb 14 12:53:38 2018
New Revision: 325170
URL: http://llvm.org/viewvc/llvm-project?rev=325170&view=rev
Log:
Use std::unique_ptr. NFC.
Modified:
llvm/trunk/tools/bugpoint/CrashDebugger.cpp
Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CrashDebugger.cpp?rev=325170&r1=325169&r2=325170&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original)
+++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Wed Feb 14 12:53:38 2018
@@ -775,7 +775,7 @@ public:
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 @@ bool ReduceCrashingNamedMD::TestNamedMDs
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;
}
More information about the llvm-commits
mailing list