From 6964f33fc91423a0ba3b648c7aad070eb6d610b9 Mon Sep 17 00:00:00 2001 From: Michael Gottesman Date: Mon, 5 Aug 2013 21:07:07 +0000 Subject: [PATCH] [bugpoint] Allow the user to specify the path to opt on the commandline. llvm-svn: 187739 --- llvm/tools/bugpoint/OptimizerDriver.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp index 0c39b9d6fc46..20c609cc314e 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 ChildOutput("child-output", cl::ReallyHidden); + cl::opt 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;