diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2018-02-14 20:53:38 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2018-02-14 20:53:38 +0000 |
| commit | 2911841fba79347e35d381041ed678a2324484b9 (patch) | |
| tree | 256d3d72133ea50361d325a95ac71093f503d155 /llvm/tools | |
| parent | ad83ce4cb45771aecd4ed916abe368787da55b72 (diff) | |
| download | bcm5719-llvm-2911841fba79347e35d381041ed678a2324484b9.tar.gz bcm5719-llvm-2911841fba79347e35d381041ed678a2324484b9.zip | |
Use std::unique_ptr. NFC.
llvm-svn: 325170
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/bugpoint/CrashDebugger.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp index 1548d4d1442..a5c8f294d4b 100644 --- a/llvm/tools/bugpoint/CrashDebugger.cpp +++ b/llvm/tools/bugpoint/CrashDebugger.cpp @@ -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(std::vector<std::string> &NamedMDs) { 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; } |

