ModuleInterface/Serialization: allow library authors to define a custom module version number

This allows library authors to pass down a project version number so that library users can conditionally
import that library based on the available version in the search paths.

Needed for rdar://73992299
This commit is contained in:
Xi Ge
2021-04-29 15:59:56 -07:00
parent dfec9e6434
commit fe5c7ef995
17 changed files with 79 additions and 6 deletions

View File

@@ -56,7 +56,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
/// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format.
/// Don't worry about adhering to the 80-column limit for this line.
const uint16_t SWIFTMODULE_VERSION_MINOR = 610; // async initializers for nominal types
const uint16_t SWIFTMODULE_VERSION_MINOR = 611; // add user-defined module version
/// A standard hash seed used for all string hashes in a serialized module.
///
@@ -763,6 +763,8 @@ namespace control_block {
BCFixed<16>, // Module format minor version
BCVBR<8>, // length of "short version string" in the blob
BCVBR<8>, // length of "short compatibility version string" in the blob
BCVBR<17>, // User module format major version
BCVBR<17>, // User module format minor version
BCBlob // misc. version information
>;