@@ -1449,7 +1449,7 @@ namespace {
14491449// load %elt1 // non-use (unseen)
14501450// %elt2 = struct_element_addr %base, #2 // outer projection (followed)
14511451// load %elt2 // exact use
1452- // %sub = struct_element_addr %elt2, # i // inner projection (followed)
1452+ // %sub = struct_element_addr %elt2, % i // inner projection (followed)
14531453// load %sub // inner use
14541454//
14551455// A use may be a BranchInst if the corresponding phi does not have common
@@ -1467,8 +1467,12 @@ class AccessPathDefUseTraversal {
14671467 // The origin of the def-use traversal.
14681468 AccessStorage storage;
14691469
1470- // Remaining access path indices from the most recently visited def to any
1471- // exact use in def-use order.
1470+ // Indices of the path to match from inner to outer component.
1471+ // A cursor is used to represent the most recently visited def.
1472+ // During def-use traversal, the cursor starts at the end of pathIndicies and
1473+ // decrements with each projection.
1474+ // The first index represents an exact match.
1475+ // Index < 0 represents some subobject of the requested path.
14721476 SmallVector<AccessPath::Index, 4 > pathIndices;
14731477
14741478 // A point in the def-use traversal. isRef() is true only for object access
@@ -1884,8 +1888,8 @@ bool swift::visitAccessPathUses(AccessUseVisitor &visitor,
18841888}
18851889
18861890bool swift::visitAccessStorageUses (AccessUseVisitor &visitor,
1887- AccessStorage storage,
1888- SILFunction *function) {
1891+ AccessStorage storage,
1892+ SILFunction *function) {
18891893 IndexTrieNode *emptyPath = function->getModule ().getIndexTrieRoot ();
18901894 return visitAccessPathUses (visitor, AccessPath (storage, emptyPath, 0 ),
18911895 function);
0 commit comments