mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -251,7 +251,12 @@ validateControlBlock(llvm::BitstreamCursor &cursor,
|
||||
// These fields were added later; be resilient against their absence.
|
||||
switch (scratch.size()) {
|
||||
default:
|
||||
// Add new cases here, in descending order.
|
||||
// Add new cases here, in descending order.
|
||||
case 6:
|
||||
case 5: {
|
||||
result.userModuleVersion = llvm::VersionTuple(scratch[4], scratch[5]);
|
||||
LLVM_FALLTHROUGH;
|
||||
}
|
||||
case 4:
|
||||
if (scratch[3] != 0) {
|
||||
result.compatibilityVersion =
|
||||
@@ -1172,6 +1177,7 @@ ModuleFileSharedCore::ModuleFileSharedCore(
|
||||
Name = info.name;
|
||||
TargetTriple = info.targetTriple;
|
||||
CompatibilityVersion = info.compatibilityVersion;
|
||||
UserModuleVersion = info.userModuleVersion;
|
||||
Bits.ArePrivateImportsEnabled = extInfo.arePrivateImportsEnabled();
|
||||
Bits.IsSIB = extInfo.isSIB();
|
||||
Bits.IsTestable = extInfo.isTestable();
|
||||
|
||||
Reference in New Issue
Block a user