mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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:
@@ -210,6 +210,10 @@ ModuleFile::loadDependenciesForFileContext(const FileUnit *file,
|
||||
auto importPath = builder.copyTo(ctx);
|
||||
auto modulePath = importPath.getModulePath(dependency.isScoped());
|
||||
auto accessPath = importPath.getAccessPath(dependency.isScoped());
|
||||
if (!getContext().LangOpts.DisableDeserializationOfExplicitPaths &&
|
||||
!dependency.Core.BinaryModulePath.empty())
|
||||
ctx.addExplicitModulePath(modulePath.front().Item.str(),
|
||||
dependency.Core.BinaryModulePath.str());
|
||||
|
||||
auto module = getModule(modulePath, /*allowLoading*/true);
|
||||
if (!module || module->failedToLoad()) {
|
||||
|
||||
Reference in New Issue
Block a user