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

Michael Gottesman mgottesman at apple.com
Mon Aug 5 14:07:07 PDT 2013


Author: mgottesman
Date: Mon Aug  5 16:07:07 2013
New Revision: 187739

URL: http://llvm.org/viewvc/llvm-project?rev=187739&view=rev
Log:
[bugpoint] Allow the user to specify the path to opt on the commandline.

Modified:
    llvm/trunk/tools/bugpoint/OptimizerDriver.cpp

Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=187739&r1=187738&r2=187739&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Mon Aug  5 16:07:07 2013
@@ -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 *Progra
     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;





More information about the llvm-commits mailing list