File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -821,6 +821,10 @@ class AccessPath {
821
821
// / access, thus not within an access scope.
822
822
static AccessPath computeInScope (SILValue address);
823
823
824
+ // / Creates an AccessPass, which identifies the first tail-element of the
825
+ // / object \p rootReference.
826
+ static AccessPath forTailStorage (SILValue rootReference);
827
+
824
828
// Encode a dynamic index_addr as an UnknownOffset.
825
829
static constexpr int UnknownOffset = std::numeric_limits<int >::min() >> 1 ;
826
830
@@ -984,6 +988,12 @@ class AccessPath {
984
988
SILFunction *function,
985
989
unsigned useLimit = std::numeric_limits<unsigned >::max()) const ;
986
990
991
+ // / Returns a new AccessPass, identical to this AccessPath, except that the
992
+ // / offset is replaced with \p newOffset.
993
+ AccessPath withOffset (int newOffset) const {
994
+ return AccessPath (storage, pathNode, newOffset);
995
+ }
996
+
987
997
void printPath (raw_ostream &os) const ;
988
998
void print (raw_ostream &os) const ;
989
999
void dump () const ;
Original file line number Diff line number Diff line change @@ -763,6 +763,13 @@ AccessedStorage AccessedStorage::computeInScope(SILValue sourceAddress) {
763
763
// MARK: AccessPath
764
764
// ===----------------------------------------------------------------------===//
765
765
766
+ AccessPath AccessPath::forTailStorage (SILValue rootReference) {
767
+ return AccessPath (
768
+ AccessedStorage::forClass (rootReference, AccessedStorage::TailIndex),
769
+ PathNode (rootReference->getModule ()->getIndexTrieRoot ()),
770
+ /* offset*/ 0 );
771
+ }
772
+
766
773
bool AccessPath::contains (AccessPath subPath) const {
767
774
if (!isValid () || !subPath.isValid ()) {
768
775
return false ;
You can’t perform that action at this time.
0 commit comments