Fix the getAddressAccess API.

The API was accidentally undefined, presumably because I checked in
the wrong code or there was a bad merge. The API will be used by
upcoming commits.

Meanwhile, getAccessedAddress was not stripping access markers, which
means some analysis may have been too conservative.

This fix could expose issues by making existing analyses more effective.
This commit is contained in:
Andrew Trick
2020-04-02 18:45:55 -07:00
parent 829f2588b3
commit ec1545fac2
2 changed files with 5 additions and 3 deletions

View File

@@ -47,7 +47,7 @@ SingleValueInstruction *swift::isAccessProjection(SILValue v) {
// TODO: When the optimizer stops stripping begin_access markers, then we should
// be able to assert that the result is a BeginAccessInst and the default case
// is unreachable.
SILValue swift::getAccessedAddress(SILValue v) {
SILValue swift::getAddressAccess(SILValue v) {
while (true) {
assert(v->getType().isAddress());
auto *projection = isAccessProjection(v);