mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fixes a class of deserialization issues in the merge-modules step. The setup was the following: - File A defines a typealias A whose underlying type is a nested type S of a type T, defined in a different module. - File B defines an extension of T, and the extension member's type references A. When deserializing A, we would proceed to deserialize the underlying type, which references T.S. This would first deserialize T and perform a name lookup to find S, which would deserialize all members, including pulling in extensions. Deserialization of the extension defined in file B would then fail, because the declaration for A is not yet available. We had a previous fix for these problems in the single-module case; a per-file lookup table mapping mangled nested type names to declarations, allowing a nested type to be deserialized without pulling in all members and extensions of its parent type. This patch generalizes the nested type lookup table allowing it to be used to resolve cross-module references as well. Also, we were only writing out the nested type table when serializing a partial swiftmodule corresponding to a source file. Removing this check allows the nested type table to be serialized for modules built with WMO enabled as well, such as the standard library. Fixes <rdar://problem/30976604> and <https://bugs.swift.org/browse/SR-4208>.
164 KiB
164 KiB