mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[frontend] Added temporary support for setting MainInputFilename, Triple, and OutputFilename in IRGenOptions.
MainInputFilename and OutputFilename are pulled from the FrontendOptions, while Triple is parsed directly from the ArgList. Eventually, MainInputFilename and OutputFilename should likely be removed from IRGenOptions, in favor of the values in FrontendOptions, while Triple will be in a separate TargetOptions class. Swift SVN r11455
This commit is contained in:
@@ -273,7 +273,8 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
|
||||
}
|
||||
|
||||
static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
DiagnosticEngine &Diags) {
|
||||
DiagnosticEngine &Diags,
|
||||
const FrontendOptions &FrontendOpts) {
|
||||
using namespace options;
|
||||
|
||||
if (Args.hasArg(OPT_g)) {
|
||||
@@ -326,6 +327,15 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
Opts.EnableDynamicValueTypeLayout = true;
|
||||
}
|
||||
|
||||
// TODO: investigate whether these should be removed, in favor of definitions
|
||||
// in other classes.
|
||||
Opts.MainInputFilename = FrontendOpts.InputFilenames[0];
|
||||
Opts.OutputFilename = FrontendOpts.OutputFilename;
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_target)) {
|
||||
Opts.Triple = A->getValue();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -391,7 +401,7 @@ bool CompilerInvocation::parseArgs(ArrayRef<const char *> Args,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ParseIRGenArgs(IRGenOpts, *ParsedArgs, Diags)) {
|
||||
if (ParseIRGenArgs(IRGenOpts, *ParsedArgs, Diags, FrontendOpts)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user