mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user