[llvm] r274083 - [bugpoint] Simplify code by moving exception to only caller
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 28 17:26:22 PDT 2016
Author: reames
Date: Tue Jun 28 19:26:21 2016
New Revision: 274083
URL: http://llvm.org/viewvc/llvm-project?rev=274083&view=rev
Log:
[bugpoint] Simplify code by moving exception to only caller
Modified:
llvm/trunk/tools/bugpoint/BugDriver.h
llvm/trunk/tools/bugpoint/ExtractFunction.cpp
llvm/trunk/tools/bugpoint/Miscompilation.cpp
llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
Modified: llvm/trunk/tools/bugpoint/BugDriver.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.h?rev=274083&r1=274082&r2=274083&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/BugDriver.h (original)
+++ llvm/trunk/tools/bugpoint/BugDriver.h Tue Jun 28 19:26:21 2016
@@ -248,7 +248,6 @@ public:
/// never return null.
std::unique_ptr<Module> runPassesOn(Module *M,
const std::vector<std::string> &Passes,
- bool AutoDebugCrashes = false,
unsigned NumExtraArgs = 0,
const char *const *ExtraArgs = nullptr);
Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=274083&r1=274082&r2=274083&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original)
+++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Tue Jun 28 19:26:21 2016
@@ -411,7 +411,7 @@ BugDriver::extractMappedBlocksFromModule
std::vector<std::string> PI;
PI.push_back("extract-blocks");
- std::unique_ptr<Module> Ret = runPassesOn(M, PI, false, 1, &ExtraArg);
+ std::unique_ptr<Module> Ret = runPassesOn(M, PI, 1, &ExtraArg);
sys::fs::remove(Filename.c_str());
Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=274083&r1=274082&r2=274083&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original)
+++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Tue Jun 28 19:26:21 2016
@@ -697,8 +697,14 @@ static bool TestOptimizer(BugDriver &BD,
// of the functions being tested.
outs() << " Optimizing functions being tested: ";
std::unique_ptr<Module> Optimized =
- BD.runPassesOn(Test.get(), BD.getPassesToRun(),
- /*AutoDebugCrashes*/ true);
+ BD.runPassesOn(Test.get(), BD.getPassesToRun());
+ if (!Optimized) {
+ errs() << " Error running this sequence of passes"
+ << " on the input program!\n";
+ delete BD.swapProgramIn(Test.get());
+ BD.EmitProgressBitcode(Test.get(), "pass-error", false);
+ return BD.debugOptimizerCrash();
+ }
outs() << "done.\n";
outs() << " Checking to see if the merged program executes correctly: ";
Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=274083&r1=274082&r2=274083&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Tue Jun 28 19:26:21 2016
@@ -267,18 +267,11 @@ bool BugDriver::runPasses(Module *Progra
std::unique_ptr<Module>
BugDriver::runPassesOn(Module *M, const std::vector<std::string> &Passes,
- bool AutoDebugCrashes, unsigned NumExtraArgs,
+ unsigned NumExtraArgs,
const char *const *ExtraArgs) {
std::string BitcodeResult;
if (runPasses(M, Passes, BitcodeResult, false/*delete*/, true/*quiet*/,
NumExtraArgs, ExtraArgs)) {
- if (AutoDebugCrashes) {
- errs() << " Error running this sequence of passes"
- << " on the input program!\n";
- delete swapProgramIn(M);
- EmitProgressBitcode(M, "pass-error", false);
- exit(debugOptimizerCrash());
- }
return nullptr;
}
More information about the llvm-commits
mailing list