[llvm-commits] [llvm] r110555 - in /llvm/trunk: docs/CommandGuide/bugpoint.pod tools/bugpoint/OptimizerDriver.cpp

Rafael Espindola rafael.espindola at gmail.com
Sun Aug 8 15:14:20 PDT 2010


Author: rafael
Date: Sun Aug  8 17:14:20 2010
New Revision: 110555

URL: http://llvm.org/viewvc/llvm-project?rev=110555&view=rev
Log:
Add a opt-args option that can be used to pass arguments to every opt
invocation. Fixes PR7793:

bugpoint -debug test.ll --opt-args -unroll-count=4

Modified:
    llvm/trunk/docs/CommandGuide/bugpoint.pod
    llvm/trunk/tools/bugpoint/OptimizerDriver.cpp

Modified: llvm/trunk/docs/CommandGuide/bugpoint.pod
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/bugpoint.pod?rev=110555&r1=110554&r2=110555&view=diff
==============================================================================
--- llvm/trunk/docs/CommandGuide/bugpoint.pod (original)
+++ llvm/trunk/docs/CommandGuide/bugpoint.pod Sun Aug  8 17:14:20 2010
@@ -67,6 +67,10 @@
 Pass all arguments specified after B<--gcc-tool-args> to the invocation of
 B<gcc>.
 
+=item B<--opt-args> I<opt args>
+
+Pass all arguments specified after B<--opt-args> to the invocation of B<opt>.
+
 =item B<--disable-{dce,simplifycfg}>
 
 Do not run the specified passes to clean up and reduce the size of the test

Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=110555&r1=110554&r2=110555&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Sun Aug  8 17:14:20 2010
@@ -88,6 +88,10 @@
 
 cl::opt<bool> SilencePasses("silence-passes", cl::desc("Suppress output of running passes (both stdout and stderr)"));
 
+static cl::list<std::string> OptArgs("opt-args", cl::Positional,
+                                     cl::desc("<opt arguments>..."),
+                                     cl::ZeroOrMore, cl::PositionalEatsArgs);
+
 /// runPasses - Run the specified passes on Program, outputting a bitcode file
 /// and writing the filename into OutputFile if successful.  If the
 /// optimizations fail for some reason (optimizer crashes), return true,
@@ -154,6 +158,8 @@
 
   Args.push_back("-o");
   Args.push_back(OutputFilename.c_str());
+  for (unsigned i = 0, e = OptArgs.size(); i != e; ++i)
+    Args.push_back(OptArgs[i].c_str());
   std::vector<std::string> pass_args;
   for (unsigned i = 0, e = PluginLoader::getNumPlugins(); i != e; ++i) {
     pass_args.push_back( std::string("-load"));





More information about the llvm-commits mailing list