ModuleInterface: move -user-module-version to a new field

Titled as "// swift-module-flags-ignorable:", this new field contains new
frontend arguments that can be safely ignored by the older version of the compiler.
For compilers that don't know the field at all, all arguments in it are ignored.

rdar://78233352
This commit is contained in:
Xi Ge
2021-05-21 14:48:34 -07:00
parent 53264a64d9
commit 03e0006a48
7 changed files with 78 additions and 6 deletions

View File

@@ -56,6 +56,10 @@ static void printToolVersionAndFlagsComment(raw_ostream &out,
<< ToolsVersion << "\n";
out << "// " SWIFT_MODULE_FLAGS_KEY ": "
<< Opts.Flags << "\n";
if (!Opts.IgnorableFlags.empty()) {
out << "// " SWIFT_MODULE_FLAGS_IGNORABLE_KEY ": "
<< Opts.IgnorableFlags << "\n";
}
}
std::string