Introduce a package interface.

It has an extension .package.swiftinterface and contains package decls
as well as SPIs and public/inlinable decls. When a module is loaded
from interface, it now looks up the package-name in the interface
and checks if the importer is in the same package. If so, it uses
that package interface found to load the module. If not, uses the existing
logic to load modules.

Resolves rdar://104617854
This commit is contained in:
Ellie Shin
2023-10-27 17:40:49 -07:00
parent 24dc3721bd
commit aba3b6c24e
27 changed files with 367 additions and 64 deletions

View File

@@ -55,8 +55,8 @@ struct ModuleInterfaceOptions {
/// e.g. -package-name PACKAGE_ID
std::string IgnorablePrivateFlags;
/// Print for a private swiftinterface file, SPI decls and attributes.
bool PrintPrivateInterfaceContent = false;
/// Prints package, SPIs, or public/inlinable decls depending on the mode.
PrintInterfaceContentMode InterfaceContentMode = PrintInterfaceContentMode::Public;
/// Print imports with both @_implementationOnly and @_spi, only applies
/// when PrintSPIs is true.