[driver] Added support for -Xfrontend, which passes arguments through to the frontend.

Swift SVN r11166
This commit is contained in:
Connor Wakamo
2013-12-12 01:14:06 +00:00
parent a3bb62d619
commit 85c2afcd90
2 changed files with 8 additions and 1 deletions

View File

@@ -177,6 +177,9 @@ def repl : Flag<["-"], "repl">, HelpText<"REPL mode">, Flags<[FrontendOption]>,
def i : Flag<["-"], "i">, HelpText<"Immediate mode">, Flags<[FrontendOption]>,
ModeOpt;
def Xfrontend : Separate<["-"], "Xfrontend">, Flags<[DriverOption]>,
MetaVarName<"<arg>">, HelpText<"Pass <arg> to the Swift frontend">;
def Xcc : Separate<["-"], "Xcc">, Flags<[DriverOption, FrontendOption]>,
MetaVarName<"<arg>">,
HelpText<"Pass <arg> to the C/C++/Objective-C compiler">;

View File

@@ -102,6 +102,10 @@ std::unique_ptr<Job> Swift::constructJob(const JobAction &JA,
// Set the SDK for the frontend.
Args.AddLastArg(Arguments, options::OPT_sdk);
// Pass through the values passed to -Xfrontend.
Args.AddAllArgValues(Arguments, options::OPT_Xfrontend);
// Add the output file argument.
Arguments.push_back("-o");
Arguments.push_back(Output->getFilename().data());