summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/OptimizerDriver.cpp
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-08-05 21:07:07 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-08-05 21:07:07 +0000
commit6964f33fc91423a0ba3b648c7aad070eb6d610b9 (patch)
tree705635a3a5d208e6df5953314f5a83c4d20f0a0c /llvm/tools/bugpoint/OptimizerDriver.cpp
parent07e6c407bc67ed4f5fc88d2382df26bb7b3def4f (diff)
downloadbcm5719-llvm-6964f33fc91423a0ba3b648c7aad070eb6d610b9.tar.gz
bcm5719-llvm-6964f33fc91423a0ba3b648c7aad070eb6d610b9.zip
[bugpoint] Allow the user to specify the path to opt on the commandline.
llvm-svn: 187739
Diffstat (limited to 'llvm/tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r--llvm/tools/bugpoint/OptimizerDriver.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp
index 0c39b9d6fc4..20c609cc314 100644
--- a/llvm/tools/bugpoint/OptimizerDriver.cpp
+++ b/llvm/tools/bugpoint/OptimizerDriver.cpp
@@ -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;
OpenPOWER on IntegriCloud