diff options
author | Vedant Kumar <vsk@apple.com> | 2018-02-09 05:09:50 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2018-02-09 05:09:50 +0000 |
commit | e84e7675b29c356001a4e5fa7c71354fec13b402 (patch) | |
tree | 3e998cbf331e5e12b24054df8022a2e030f8364a /llvm/tools/bugpoint/ExtractFunction.cpp | |
parent | 226fa54ab14ad304097ebcf75efa8d72ecd3718b (diff) | |
download | bcm5719-llvm-e84e7675b29c356001a4e5fa7c71354fec13b402.tar.gz bcm5719-llvm-e84e7675b29c356001a4e5fa7c71354fec13b402.zip |
[bugpoint] Simplify reducers which can fail verification, NFC
More unique_ptr-ification, ranged for loops, etc.
llvm-svn: 324705
Diffstat (limited to 'llvm/tools/bugpoint/ExtractFunction.cpp')
-rw-r--r-- | llvm/tools/bugpoint/ExtractFunction.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/tools/bugpoint/ExtractFunction.cpp b/llvm/tools/bugpoint/ExtractFunction.cpp index d5a2a0b211b..a9023573f9d 100644 --- a/llvm/tools/bugpoint/ExtractFunction.cpp +++ b/llvm/tools/bugpoint/ExtractFunction.cpp @@ -85,7 +85,7 @@ std::unique_ptr<Module> BugDriver::deleteInstructionFromProgram(const Instruction *I, unsigned Simplification) { // FIXME, use vmap? - Module *Clone = CloneModule(Program).release(); + std::unique_ptr<Module> Clone = CloneModule(Program); const BasicBlock *PBB = I->getParent(); const Function *PF = PBB->getParent(); @@ -118,8 +118,7 @@ BugDriver::deleteInstructionFromProgram(const Instruction *I, Passes.push_back("simplifycfg"); // Delete dead control flow Passes.push_back("verify"); - std::unique_ptr<Module> New = runPassesOn(Clone, Passes); - delete Clone; + std::unique_ptr<Module> New = runPassesOn(Clone.get(), Passes); if (!New) { errs() << "Instruction removal failed. Sorry. :( Please report a bug!\n"; exit(1); |