mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
To visit the nodes of a type that is formed by repeated product operations (struct and tuple), visitProductLeafAccessPathNodes is used. The caller provides a TypeExpansionContext to this function. Previously, though, visitProductLeafAccessPathNodes didn't respect the TypeExpansionContext when visiting struct types. Specifically, it looked through resilient structs to their fields. For a caller, such as SSADestroyHoisting, that cares about the number of non-trivial nodes, that is wrong--each resilient struct is a non-trivial node for its purposes. Here, this is corrected by having visitProductLeafAccessPathNodes consider whether a struct type is resilient in the specified TypeExpansionContext. Resilient structs are now correctly recognized as leaf nodes and the caller-provided lambda is invoked with each. rdar://92460184
89 KiB
89 KiB