File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,12 @@ class TransitiveAddressWalker {
61
61
// / understand. These cause us to return AddressUseKind::Unknown.
62
62
void onError (Operand *use) {}
63
63
64
+ // / Customization point that causes the walker to treat a specific transitive
65
+ // / use as an end point use.
66
+ // /
67
+ // / Example: Visiting a mutable or immutable open_existential_addr.
68
+ bool visitTransitiveUseAsEndPointUse (Operand *use) { return false ; }
69
+
64
70
void meet (AddressUseKind other) {
65
71
assert (!didInvalidate);
66
72
result = swift::meet (result, other);
@@ -103,11 +109,14 @@ TransitiveAddressWalker<Impl>::walk(SILValue projectedAddress) && {
103
109
auto transitiveResultUses = [&](Operand *use) {
104
110
auto *svi = cast<SingleValueInstruction>(use->getUser ());
105
111
if (svi->use_empty ()) {
106
- callVisitUse (use);
107
- } else {
108
- for (auto *use : svi->getUses ())
109
- addToWorklist (use);
112
+ return callVisitUse (use);
110
113
}
114
+
115
+ if (asImpl ().visitTransitiveUseAsEndPointUse (use))
116
+ return callVisitUse (use);
117
+
118
+ for (auto *use : svi->getUses ())
119
+ addToWorklist (use);
111
120
};
112
121
113
122
while (!worklist.empty ()) {
You can’t perform that action at this time.
0 commit comments