mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user