[bugpoint] Allow the user to specify the path to opt on the commandline.

llvm-svn: 187739
This commit is contained in:
Michael Gottesman 2013-08-05 21:07:07 +00:00
parent 07e6c407bc
commit 6964f33fc9
1 changed files with 4 additions and 1 deletions

View File

@ -44,6 +44,9 @@ namespace {
// ChildOutput - This option captures the name of the child output file that
// is set up by the parent bugpoint process
cl::opt<std::string> ChildOutput("child-output", cl::ReallyHidden);
cl::opt<std::string> OptCmd("opt-command", cl::init(""),
cl::desc("Path to opt. (default: search path "
"for 'opt'.)"));
}
/// writeProgramToFile - This writes the current "Program" to the named bitcode
@ -154,7 +157,7 @@ bool BugDriver::runPasses(Module *Program,
return 1;
}
std::string tool = sys::FindProgramByName("opt");
std::string tool = OptCmd.empty()? sys::FindProgramByName("opt") : OptCmd;
if (tool.empty()) {
errs() << "Cannot find `opt' in PATH!\n";
return 1;