Files
swift-mirror/lib/SIL/Utils/MemAccessUtils.cpp
Nate Chandler 3e2efa59b7 [MemAccessUtils] Resilient node is a product leaf.
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
2022-04-30 17:07:25 -07:00

89 KiB