mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Delay all actions in the same module together. (#8123)
Back in December DougG added code to delay the formation of generic environments until all declarations from a particular module had been deserialized, to avoid circular dependencies caused by too-eager deserialization of protocol members. This worked great for fully-built modules, but still had some problems with module merging, the phase of multi-file compilation where the "partial" swiftmodules that correspond to each source file in a target are loaded and remitted as a single swiftmodule. Fix this by picking one of the partial swiftmodules as the representative one for delayed actions, and wait until deserialization is complete for /all/ of the serialized ASTs in the same target to form the generic environments. rdar://problem/30984417
This commit is contained in:
@@ -1279,7 +1279,11 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
|
||||
return getStatus();
|
||||
}
|
||||
|
||||
ModuleFile::~ModuleFile() = default;
|
||||
ModuleFile::~ModuleFile() {
|
||||
assert(DelayedGenericEnvironments.empty() &&
|
||||
"either finishPendingActions() was never called, or someone forgot "
|
||||
"to use getModuleFileForDelayedActions()");
|
||||
}
|
||||
|
||||
void ModuleFile::lookupValue(DeclName name,
|
||||
SmallVectorImpl<ValueDecl*> &results) {
|
||||
|
||||
Reference in New Issue
Block a user