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

@@ -245,6 +245,7 @@ bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
SerializationOpts.ModuleLinkName = FEOpts.ModuleLinkName;
SerializationOpts.AutolinkForceLoad =
!subInvocation.getIRGenOptions().ForceLoadSymbolName.empty();
SerializationOpts.UserModuleVersion = FEOpts.UserModuleVersion;
// Record any non-SDK module interface files for the debug info.
StringRef SDKPath = SubInstance.getASTContext().SearchPathOpts.SDKPath;