[NFC] AST: Extract helper method.

Several callers of `AbstractStorageDecl::getAccessStrategy` only cared
about whether the the access would be via physical storage.  Before
adding more arguments to `getAccessStrategy` for which such callers
would have to pass a sentinel value, add a convenience method for this.
This commit is contained in:
Nate Chandler
2025-04-15 16:38:23 -07:00
parent 198a802719
commit 347689fb30
5 changed files with 24 additions and 16 deletions

View File

@@ -4407,11 +4407,9 @@ ConstraintSystem::isConversionEphemeral(ConversionRestrictionKind conversion,
// Check what access strategy is used for a read-write access. It must be
// direct-to-storage in order for the conversion to be non-ephemeral.
auto access = asd->getAccessStrategy(
return asd->isAccessedViaPhysicalStorage(
AccessSemantics::Ordinary, AccessKind::ReadWrite,
DC->getParentModule(), DC->getResilienceExpansion(),
/*useOldABI=*/false);
return access.getKind() == AccessStrategy::Storage;
DC->getParentModule(), DC->getResilienceExpansion());
};
SourceRange range;