[ParseableInterface] Add module arguments if using supplemental output maps

Currently, the check for whether to serialize parseable interface
arguments doesn't handle the case where a supplementary output file map
is used, preferring only to check if the frontend is passed
`-emit*interface`. Instead, check if the frontend inputs and outputs
contains a parseable interface, and use that to determine if we need to
save args.

This also puts `-module-link-name` in the parseable interface arg list.
This commit is contained in:
Harlan Haskins
2018-10-30 18:17:14 -07:00
parent 4381735269
commit 9f44e2cf4c
3 changed files with 16 additions and 13 deletions

View File

@@ -159,9 +159,9 @@ static void PrintArg(raw_ostream &OS, const char *Arg, StringRef TempDir) {
/// Save a copy of any flags marked as ParseableInterfaceOption, if running
/// in a mode that is going to emit a .swiftinterface file.
static void SaveParseableInterfaceArgs(ParseableInterfaceOptions &Opts,
FrontendOptions &FOpts,
ArgList &Args, DiagnosticEngine &Diags) {
if (!Args.hasArg(options::OPT_emit_interface_path) &&
!Args.hasArg(options::OPT_emit_parseable_module_interface_path))
if (!FOpts.InputsAndOutputs.hasParseableInterfaceOutputPath())
return;
ArgStringList RenderedArgs;
for (auto A : Args) {
@@ -1188,13 +1188,14 @@ bool CompilerInvocation::parseArgs(
return true;
}
SaveParseableInterfaceArgs(ParseableInterfaceOpts, ParsedArgs, Diags);
if (ParseFrontendArgs(FrontendOpts, ParsedArgs, Diags,
ConfigurationFileBuffers)) {
return true;
}
SaveParseableInterfaceArgs(ParseableInterfaceOpts, FrontendOpts,
ParsedArgs, Diags);
if (ParseLangArgs(LangOpts, ParsedArgs, Diags, FrontendOpts)) {
return true;
}