mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -62,11 +62,16 @@ struct SerializedModuleBaseName {
|
||||
/// Gets the filename with a particular extension appended to it.
|
||||
std::string getName(file_types::ID fileTy) const;
|
||||
|
||||
/// If the interface with \p baseName exists, returns its path (which may be
|
||||
/// the private interface if there is one). Return an empty optional
|
||||
/// otherwise.
|
||||
/// If the interface with \p baseName exists, returns its path (which may be the
|
||||
/// package interface if applicable (in the same package as the main module) or
|
||||
/// private interface if there is one, else public). Return an empty optional otherwise.
|
||||
llvm::Optional<std::string>
|
||||
findInterfacePath(llvm::vfs::FileSystem &fs) const;
|
||||
findInterfacePath(llvm::vfs::FileSystem &fs, ASTContext &ctx) const;
|
||||
|
||||
/// Returns the .package.swiftinterface path if its package-name also applies to
|
||||
/// the the importing module. Returns an empty optional otherwise.
|
||||
llvm::Optional<std::string>
|
||||
getPackageInterfacePathIfInSamePackage(llvm::vfs::FileSystem &fs, ASTContext &ctx) const;
|
||||
};
|
||||
|
||||
/// Common functionality shared between \c ImplicitSerializedModuleLoader,
|
||||
|
||||
Reference in New Issue
Block a user