summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2016-06-29 00:26:21 +0000
committerPhilip Reames <listmail@philipreames.com>2016-06-29 00:26:21 +0000
commit78153a6d6e0d073ac54c0a6a39bbeeb0102bd4d4 (patch)
tree85159318e6d365ec251ac1a6596935378cfb52d3 /llvm/tools/bugpoint
parent29e641cd26eafb1e0f3a43116043d45e1126135e (diff)
downloadbcm5719-llvm-78153a6d6e0d073ac54c0a6a39bbeeb0102bd4d4.tar.gz
bcm5719-llvm-78153a6d6e0d073ac54c0a6a39bbeeb0102bd4d4.zip
[bugpoint] Simplify code by moving exception to only caller
llvm-svn: 274083
Diffstat (limited to 'llvm/tools/bugpoint')
-rw-r--r--llvm/tools/bugpoint/BugDriver.h1
-rw-r--r--llvm/tools/bugpoint/ExtractFunction.cpp2
-rw-r--r--llvm/tools/bugpoint/Miscompilation.cpp10
-rw-r--r--llvm/tools/bugpoint/OptimizerDriver.cpp9
4 files changed, 10 insertions, 12 deletions
diff --git a/llvm/tools/bugpoint/BugDriver.h b/llvm/tools/bugpoint/BugDriver.h
index 56ed8ab712e..719350f8b33 100644
--- a/llvm/tools/bugpoint/BugDriver.h
+++ b/llvm/tools/bugpoint/BugDriver.h
@@ -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);
diff --git a/llvm/tools/bugpoint/ExtractFunction.cpp b/llvm/tools/bugpoint/ExtractFunction.cpp
index ae202c3f77e..de596a57d83 100644
--- a/llvm/tools/bugpoint/ExtractFunction.cpp
+++ b/llvm/tools/bugpoint/ExtractFunction.cpp
@@ -411,7 +411,7 @@ BugDriver::extractMappedBlocksFromModule(const std::vector<BasicBlock *> &BBs,
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());
diff --git a/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp
index 863aaa24780..40955ed3caa 100644
--- a/llvm/tools/bugpoint/Miscompilation.cpp
+++ b/llvm/tools/bugpoint/Miscompilation.cpp
@@ -697,8 +697,14 @@ static bool TestOptimizer(BugDriver &BD, std::unique_ptr<Module> Test,
// 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: ";
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp
index 344e7b588fb..2cc2f4471a5 100644
--- a/llvm/tools/bugpoint/OptimizerDriver.cpp
+++ b/llvm/tools/bugpoint/OptimizerDriver.cpp
@@ -267,18 +267,11 @@ bool BugDriver::runPasses(Module *Program,
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;
}
OpenPOWER on IntegriCloud