Skip to content

Commit 8a194fa

Browse files
committed
[move-only] Chopping off two helper functions from a larger commit.
1 parent 0a2353f commit 8a194fa

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

include/swift/SIL/MemAccessUtils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,8 @@ struct AccessPathWithBase {
12541254
return AccessBase(base, accessPath.getStorage().getKind());
12551255
}
12561256

1257+
bool isValid() const { return base && accessPath.isValid(); }
1258+
12571259
bool operator==(AccessPathWithBase other) const {
12581260
return accessPath == other.accessPath && base == other.base;
12591261
}

lib/SILGen/ManagedValue.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,11 @@ class ManagedValue {
364364
return bool(getValue()) || valueAndFlag.getInt();
365365
}
366366

367+
SILFunction *getFunction() const {
368+
assert(getValue());
369+
return getValue()->getFunction();
370+
}
371+
367372
void dump() const;
368373
void dump(raw_ostream &os, unsigned indent = 0) const;
369374
void print(raw_ostream &os) const;

0 commit comments

Comments
 (0)