summaryrefslogtreecommitdiff
path: root/tools/bugpoint
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-03-19 23:42:11 +0000
committerChris Lattner <sabre@nondot.org>2012-03-19 23:42:11 +0000
commit1aa73cc05a81f592c376a9f7c0ff2543079b22ca (patch)
treeb099d8408e99c9fcf3b4aca4d6d645c858cfc2ef /tools/bugpoint
parente0ac6f8a7d390945c626d8548e1054cf857e3e07 (diff)
downloadllvm-1aa73cc05a81f592c376a9f7c0ff2543079b22ca.tar.gz
llvm-1aa73cc05a81f592c376a9f7c0ff2543079b22ca.tar.bz2
llvm-1aa73cc05a81f592c376a9f7c0ff2543079b22ca.tar.xz
Fix two bugpoint bugs:
1) opt is not usually in the same path as the target program. Even for the bugpoint as a standalone app, it should be more portable to search in PATH, isn't it? 2) bugpoint driver accounts opt plugins, but does not list them in the final output command. Patch by Dmitry Mikushin! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153066 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint')
-rw-r--r--tools/bugpoint/OptimizerDriver.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp
index 336c83d7b1..fb090ee176 100644
--- a/tools/bugpoint/OptimizerDriver.cpp
+++ b/tools/bugpoint/OptimizerDriver.cpp
@@ -85,8 +85,11 @@ void BugDriver::EmitProgressBitcode(const Module *M,
if (NoFlyer || PassesToRun.empty()) return;
outs() << "\n*** You can reproduce the problem with: ";
if (UseValgrind) outs() << "valgrind ";
- outs() << "opt " << Filename << " ";
- outs() << getPassesString(PassesToRun) << "\n";
+ outs() << "opt " << Filename;
+ for (unsigned i = 0, e = PluginLoader::getNumPlugins(); i != e; ++i) {
+ outs() << " -load " << PluginLoader::getPlugin(i);
+ }
+ outs() << " " << getPassesString(PassesToRun) << "\n";
}
cl::opt<bool> SilencePasses("silence-passes",
@@ -145,10 +148,9 @@ bool BugDriver::runPasses(Module *Program,
return 1;
}
- sys::Path tool = PrependMainExecutablePath("opt", getToolName(),
- (void*)"opt");
+ sys::Path tool = sys::Program::FindProgramByName("opt");
if (tool.empty()) {
- errs() << "Cannot find `opt' in executable directory!\n";
+ errs() << "Cannot find `opt' in PATH!\n";
return 1;
}