mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ModuleInterface] Allow falling back to prefer TypeReprs
There are still cases (a module with a type that's the same name as the module) where we cannot fully qualify all types. In those cases, allow them to remain unqualified with a flag, `-Xfrontend -preserve-types-as-written-in-module-interface`.
This commit is contained in:
@@ -197,6 +197,14 @@ static void PrintArg(raw_ostream &OS, const char *Arg, StringRef TempDir) {
|
||||
OS << '"';
|
||||
}
|
||||
|
||||
static void ParseParseableInterfaceArgs(ParseableInterfaceOptions &Opts,
|
||||
ArgList &Args) {
|
||||
using namespace options;
|
||||
|
||||
Opts.PreserveTypesAsWrittenInModuleInterface |=
|
||||
Args.hasArg(OPT_preserve_types_as_written_in_module_interface);
|
||||
}
|
||||
|
||||
/// Save a copy of any flags marked as ModuleInterfaceOption, if running
|
||||
/// in a mode that is going to emit a .swiftinterface file.
|
||||
static void SaveParseableInterfaceArgs(ParseableInterfaceOptions &Opts,
|
||||
@@ -1305,6 +1313,7 @@ bool CompilerInvocation::parseArgs(
|
||||
return true;
|
||||
}
|
||||
|
||||
ParseParseableInterfaceArgs(ParseableInterfaceOpts, ParsedArgs);
|
||||
SaveParseableInterfaceArgs(ParseableInterfaceOpts, FrontendOpts,
|
||||
ParsedArgs, Diags);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user