diff options
author | Chris Lattner <sabre@nondot.org> | 2003-04-24 17:02:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-04-24 17:02:17 +0000 |
commit | 640f22e66d90439857a97a83896ee68c4f7128c9 (patch) | |
tree | 47bce45dc762178d2e8f5e9d03cbbcae4be925bc /tools/bugpoint/OptimizerDriver.cpp | |
parent | 7899b74fdbb58bcb50641703b6f1f212a3aebcb0 (diff) |
Implement support for bugpoint to identify which FUNCTION an optimization
is miscompiling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r-- | tools/bugpoint/OptimizerDriver.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp index 300ba95069..610c524c26 100644 --- a/tools/bugpoint/OptimizerDriver.cpp +++ b/tools/bugpoint/OptimizerDriver.cpp @@ -35,8 +35,7 @@ bool BugDriver::writeProgramToFile(const std::string &Filename, /// EmitProgressBytecode - This function is used to output the current Program /// to a file named "bugpoing-ID.bc". /// -void BugDriver::EmitProgressBytecode(const PassInfo *Pass, - const std::string &ID) { +void BugDriver::EmitProgressBytecode(const std::string &ID, bool NoFlyer) { // Output the input to the current pass to a bytecode file, emit a message // telling the user how to reproduce it: opt -foo blah.bc // @@ -47,9 +46,13 @@ void BugDriver::EmitProgressBytecode(const PassInfo *Pass, } std::cout << "Emitted bytecode to '" << Filename << "'\n"; + if (NoFlyer) return; std::cout << "\n*** You can reproduce the problem with: "; - unsigned PassType = Pass->getPassType(); + unsigned PassType = PassesToRun[0]->getPassType(); + for (unsigned i = 1, e = PassesToRun.size(); i != e; ++i) + PassType &= PassesToRun[i]->getPassType(); + if (PassType & PassInfo::Analysis) std::cout << "analyze"; else if (PassType & PassInfo::Optimization) @@ -58,7 +61,8 @@ void BugDriver::EmitProgressBytecode(const PassInfo *Pass, std::cout << "llc"; else std::cout << "bugpoint"; - std::cout << " " << Filename << " -" << Pass->getPassArgument() << "\n"; + std::cout << " " << Filename << " "; + std::cout << getPassesString(PassesToRun) << "\n"; } /// FIXME: This should be parameterizable!! |