summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/BugDriver.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2016-09-06 04:45:37 +0000
committerJustin Bogner <mail@justinbogner.com>2016-09-06 04:45:37 +0000
commit24dac6afe29ccbd4455dc44d6d6bc85b04bfbc31 (patch)
tree704eecd1c2c20265e79bd4f4863ba1f5232d67c7 /llvm/tools/bugpoint/BugDriver.cpp
parent46b1a9a70c171c44eb2fe0948f9b6f1be2387aa3 (diff)
downloadbcm5719-llvm-24dac6afe29ccbd4455dc44d6d6bc85b04bfbc31.tar.gz
bcm5719-llvm-24dac6afe29ccbd4455dc44d6d6bc85b04bfbc31.zip
Revert "bugpoint: Stop threading errors through APIs that never fail"
This isn't the right thing to do - it turns out a number of the APIs that "never fail" just exit(1) if something bad happens. We can and should thread Error through this instead. That diff will make more sense with this reverted. Sorry for the noise. This reverts r280690 llvm-svn: 280691
Diffstat (limited to 'llvm/tools/bugpoint/BugDriver.cpp')
-rw-r--r--llvm/tools/bugpoint/BugDriver.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/tools/bugpoint/BugDriver.cpp b/llvm/tools/bugpoint/BugDriver.cpp
index 9bca91accba..dde552174b4 100644
--- a/llvm/tools/bugpoint/BugDriver.cpp
+++ b/llvm/tools/bugpoint/BugDriver.cpp
@@ -146,11 +146,11 @@ bool BugDriver::addSources(const std::vector<std::string> &Filenames) {
/// run - The top level method that is invoked after all of the instance
/// variables are set up from command line arguments.
///
-bool BugDriver::run() {
+bool BugDriver::run(std::string &ErrMsg) {
if (run_find_bugs) {
// Rearrange the passes and apply them to the program. Repeat this process
// until the user kills the program or we find a bug.
- return runManyPasses(PassesToRun);
+ return runManyPasses(PassesToRun, ErrMsg);
}
// If we're not running as a child, the first thing that we must do is
@@ -176,7 +176,7 @@ bool BugDriver::run() {
compileProgram(Program, &Error);
if (!Error.empty()) {
outs() << Error;
- return debugCodeGeneratorCrash();
+ return debugCodeGeneratorCrash(ErrMsg);
}
outs() << '\n';
@@ -188,7 +188,7 @@ bool BugDriver::run() {
if (ReferenceOutputFile.empty()) {
outs() << "Generating reference output from raw program: ";
if (!createReferenceFile(Program)) {
- return debugCodeGeneratorCrash();
+ return debugCodeGeneratorCrash(ErrMsg);
}
CreatedOutput = true;
}
@@ -205,14 +205,14 @@ bool BugDriver::run() {
bool Diff = diffProgram(Program, "", "", false, &Error);
if (!Error.empty()) {
errs() << Error;
- return debugCodeGeneratorCrash();
+ return debugCodeGeneratorCrash(ErrMsg);
}
if (!Diff) {
outs() << "\n*** Output matches: Debugging miscompilation!\n";
debugMiscompilation(&Error);
if (!Error.empty()) {
errs() << Error;
- return debugCodeGeneratorCrash();
+ return debugCodeGeneratorCrash(ErrMsg);
}
return false;
}
@@ -222,7 +222,7 @@ bool BugDriver::run() {
bool Failure = debugCodeGenerator(&Error);
if (!Error.empty()) {
errs() << Error;
- return debugCodeGeneratorCrash();
+ return debugCodeGeneratorCrash(ErrMsg);
}
return Failure;
}
OpenPOWER on IntegriCloud