mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
Serialize library level into .swiftmodule binary format
Add a LIBRARY_LEVEL record to the .swiftmodule options block so the declared -library-level value survives across compilations. Without this, imported modules have to always fell back to a path heuristic that could only distinguish API vs SPI and never returned IPI. rdar://174255626
This commit is contained in:
@@ -237,6 +237,12 @@ static bool readOptionsBlock(llvm::BitstreamCursor &cursor,
|
||||
case options_block::AGGRESSIVE_CMO:
|
||||
extendedInfo.setAggressiveCMOEnabled(true);
|
||||
break;
|
||||
case options_block::LIBRARY_LEVEL: {
|
||||
unsigned rawLevel;
|
||||
options_block::LibraryLevelLayout::readRecord(scratch, rawLevel);
|
||||
extendedInfo.setLibraryLevel(LibraryLevel(rawLevel));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// Unknown options record, possibly for use by a future version of the
|
||||
// module format.
|
||||
@@ -1605,6 +1611,7 @@ ModuleFileSharedCore::ModuleFileSharedCore(
|
||||
Bits.StrictMemorySafety = extInfo.strictMemorySafety();
|
||||
Bits.DeferredCodeGen = extInfo.deferredCodeGen();
|
||||
Bits.AggressiveCMOEnabled = extInfo.isAggressiveCMOEnabled();
|
||||
Bits.LibraryLevel = unsigned(extInfo.getLibraryLevel());
|
||||
MiscVersion = info.miscVersion;
|
||||
SDKVersion = info.sdkVersion;
|
||||
ModuleABIName = extInfo.getModuleABIName();
|
||||
|
||||
Reference in New Issue
Block a user