Skip to content

Commit 6434890

Browse files
authored
Merge pull request swiftlang#30786 from atrick/fix-access-api
Fix the getAddressAccess API.
2 parents e2014e3 + ec1545f commit 6434890

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

include/swift/SIL/MemAccessUtils.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ SingleValueInstruction *isAccessProjection(SILValue v);
7878
/// findAccessedStorage() on either \p v or the returned address.
7979
SILValue getAddressAccess(SILValue v);
8080

81-
/// Convenience for stripAccessMarkers(getAddressAccess(V)).
82-
SILValue getAccessedAddress(SILValue v);
81+
/// Convenience for stripAccessMarkers(getAddressAccess(v)).
82+
inline SILValue getAccessedAddress(SILValue v) {
83+
return stripAccessMarkers(getAddressAccess(v));
84+
}
8385

8486
/// Return true if \p accessedAddress points to a let-variable.
8587
///

lib/SIL/Utils/MemAccessUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ SingleValueInstruction *swift::isAccessProjection(SILValue v) {
4747
// TODO: When the optimizer stops stripping begin_access markers, then we should
4848
// be able to assert that the result is a BeginAccessInst and the default case
4949
// is unreachable.
50-
SILValue swift::getAccessedAddress(SILValue v) {
50+
SILValue swift::getAddressAccess(SILValue v) {
5151
while (true) {
5252
assert(v->getType().isAddress());
5353
auto *projection = isAccessProjection(v);

0 commit comments

Comments
 (0)