llvm.org GIT mirror llvm / ec62d53
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110555 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 9 years ago
2 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
6565
6666 Pass all arguments specified after B<--gcc-tool-args> to the invocation of
6767 B.
68
69 =item B<--opt-args> I
70
71 Pass all arguments specified after B<--opt-args> to the invocation of B.
6872
6973 =item B<--disable-{dce,simplifycfg}>
7074
8686 }
8787
8888 cl::opt SilencePasses("silence-passes", cl::desc("Suppress output of running passes (both stdout and stderr)"));
89
90 static cl::list OptArgs("opt-args", cl::Positional,
91 cl::desc("..."),
92 cl::ZeroOrMore, cl::PositionalEatsArgs);
8993
9094 /// runPasses - Run the specified passes on Program, outputting a bitcode file
9195 /// and writing the filename into OutputFile if successful. If the
153157
154158 Args.push_back("-o");
155159 Args.push_back(OutputFilename.c_str());
160 for (unsigned i = 0, e = OptArgs.size(); i != e; ++i)
161 Args.push_back(OptArgs[i].c_str());
156162 std::vector pass_args;
157163 for (unsigned i = 0, e = PluginLoader::getNumPlugins(); i != e; ++i) {
158164 pass_args.push_back( std::string("-load"));