mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Serialize explicit module dependencies in swift module files
For clients, such as the debugger, who do not have access the full output of the dependency scanner, it is a huger performance and correctness improvement if each explicitly built Swift module not just serialized all its Clang .pcm dependencies (via the serialized Clang compiler invocation) but also its direct Swift module dependencies. This patch changes the Swift module format to store the absolute path or cas cache key for each dependency in the INPUT block, and makes sure the deserialization makes these available to the ESML. rdar://150969755
This commit is contained in:
@@ -103,8 +103,8 @@ protected:
|
||||
std::unique_ptr<llvm::MemoryBuffer> *moduleBuffer,
|
||||
std::unique_ptr<llvm::MemoryBuffer> *moduleDocBuffer,
|
||||
std::unique_ptr<llvm::MemoryBuffer> *moduleSourceInfoBuffer,
|
||||
bool isCanImportLookup, bool isTestableDependencyLookup,
|
||||
bool &isFramework, bool &isSystemModule);
|
||||
std::string *CacheKey, bool isCanImportLookup,
|
||||
bool isTestableDependencyLookup, bool &isFramework, bool &isSystemModule);
|
||||
|
||||
/// Attempts to search the provided directory for a loadable serialized
|
||||
/// .swiftmodule with the provided `ModuleFilename`. Subclasses must
|
||||
@@ -268,6 +268,8 @@ public:
|
||||
/// A textual reason why the compiler rejected a binary module load
|
||||
/// attempt with a given status, to be used for diagnostic output.
|
||||
static std::optional<std::string> invalidModuleReason(serialization::Status status);
|
||||
|
||||
virtual void addExplicitModulePath(StringRef name, std::string path) {};
|
||||
};
|
||||
|
||||
/// Imports serialized Swift modules into an ASTContext.
|
||||
|
||||
Reference in New Issue
Block a user