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

@@ -20,6 +20,7 @@
#define SWIFT_INTERFACE_FORMAT_VERSION_KEY "swift-interface-format-version"
#define SWIFT_COMPILER_VERSION_KEY "swift-compiler-version"
#define SWIFT_MODULE_FLAGS_KEY "swift-module-flags"
#define SWIFT_MODULE_FLAGS_IGNORABLE_KEY "swift-module-flags-ignorable"
namespace swift {
@@ -41,6 +42,10 @@ struct ModuleInterfaceOptions {
/// back .swiftinterface and reconstructing .swiftmodule.
std::string Flags;
/// Flags that should be emitted to the .swiftinterface file but are OK to be
/// ignored by the earlier version of the compiler.
std::string IgnorableFlags;
/// Print SPI decls and attributes.
bool PrintSPIs = false;