summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/OptimizerDriver.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-24 17:02:17 +0000
committerChris Lattner <sabre@nondot.org>2003-04-24 17:02:17 +0000
commit16a413103c666526a9a10eb6194ee484c7b8ae78 (patch)
treebe47a1220d984393c7f47085267d2156bfc60d54 /llvm/tools/bugpoint/OptimizerDriver.cpp
parent0aebf8f80a76514ddcc6483a771a13ddf215e062 (diff)
downloadbcm5719-llvm-16a413103c666526a9a10eb6194ee484c7b8ae78.tar.gz
bcm5719-llvm-16a413103c666526a9a10eb6194ee484c7b8ae78.zip
Implement support for bugpoint to identify which FUNCTION an optimization
is miscompiling. llvm-svn: 5893
Diffstat (limited to 'llvm/tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r--llvm/tools/bugpoint/OptimizerDriver.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp
index 300ba950697..610c524c26c 100644
--- a/llvm/tools/bugpoint/OptimizerDriver.cpp
+++ b/llvm/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!!
OpenPOWER on IntegriCloud