aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Driver/OptTable.cpp3
-rw-r--r--lib/Frontend/CompilerInvocation.cpp14
2 files changed, 15 insertions, 2 deletions
diff --git a/lib/Driver/OptTable.cpp b/lib/Driver/OptTable.cpp
index 618ba8e996..39530f211d 100644
--- a/lib/Driver/OptTable.cpp
+++ b/lib/Driver/OptTable.cpp
@@ -267,7 +267,7 @@ static std::string getOptionHelpName(const OptTable &Opts, OptSpecifier Id) {
case Option::GroupClass: case Option::InputClass: case Option::UnknownClass:
assert(0 && "Invalid option with help text.");
- case Option::MultiArgClass: case Option::JoinedAndSeparateClass:
+ case Option::MultiArgClass:
assert(0 && "Cannot print metavar for this kind of option.");
case Option::FlagClass:
@@ -277,6 +277,7 @@ static std::string getOptionHelpName(const OptTable &Opts, OptSpecifier Id) {
Name += ' ';
// FALLTHROUGH
case Option::JoinedClass: case Option::CommaJoinedClass:
+ case Option::JoinedAndSeparateClass:
if (const char *MetaVarName = Opts.getOptionMetaVar(Id))
Name += MetaVarName;
else
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index d74052fd99..a925047d94 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -397,6 +397,10 @@ static void FrontendOptsToArgs(const FrontendOptions &Opts,
if (!Opts.ActionName.empty()) {
Res.push_back("-plugin");
Res.push_back(Opts.ActionName);
+ for(unsigned i = 0, e = Opts.PluginArgs.size(); i != e; ++i) {
+ Res.push_back("-plugin-arg-" + Opts.ActionName);
+ Res.push_back(Opts.PluginArgs[i]);
+ }
}
for (unsigned i = 0, e = Opts.Plugins.size(); i != e; ++i) {
Res.push_back("-load");
@@ -989,9 +993,17 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
Opts.ProgramAction = frontend::RunPreprocessorOnly; break;
}
}
- if (const Arg *A = Args.getLastArg(OPT_plugin)) {
+
+ if (const Arg* A = Args.getLastArg(OPT_plugin)) {
+ Opts.Plugins.push_back(A->getValue(Args,0));
Opts.ProgramAction = frontend::PluginAction;
Opts.ActionName = A->getValue(Args);
+
+ for (arg_iterator it = Args.filtered_begin(OPT_plugin_arg),
+ end = Args.filtered_end(); it != end; ++it) {
+ if ((*it)->getValue(Args, 0) == Opts.ActionName)
+ Opts.PluginArgs.push_back((*it)->getValue(Args, 1));
+ }
}
if (const Arg *A = Args.getLastArg(OPT_code_completion_at)) {