-bool BugDriver::run() {
- // The first thing that we must do is determine what the problem is. Does the
- // optimization series crash the compiler, or does it produce illegal code?
- // We make the top-level decision by trying to run all of the passes on the
- // the input program, which should generate a bytecode file. If it does
- // generate a bytecode file, then we know the compiler didn't crash, so try
- // to diagnose a miscompilation.
+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, ErrMsg);
+ }
+
+ // If we're not running as a child, the first thing that we must do is
+ // determine what the problem is. Does the optimization series crash the
+ // compiler, or does it produce illegal code? We make the top-level
+ // decision by trying to run all of the passes on the input program,
+ // which should generate a bitcode file. If it does generate a bitcode
+ // file, then we know the compiler didn't crash, so try to diagnose a
+ // miscompilation.