forked from OSchip/llvm-project
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! llvm-svn: 153066
This commit is contained in:
parent
633ab168a8
commit
0a2ac90525
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue