mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add the ability for a owning addressor to return
a non-native owner. This is required by Slice, which will use an ObjC immutable array object as the owner as long as all the elements are contiguous. As part of this, I decided it was best to encode the native requirement in the accessor names. This makes some of these accessors really long; we can revisit this if we productize this feature. Note that pinning addressors still require a native owner, since pinning as a feature is specific to swift refcounting. Swift SVN r24420
This commit is contained in:
@@ -672,8 +672,10 @@ void PrintAST::printAccessors(AbstractStorageDecl *ASD) {
|
||||
return PrintAccessor(accessor, "unsafeAddress");
|
||||
case AddressorKind::Owning:
|
||||
return PrintAccessor(accessor, "addressWithOwner");
|
||||
case AddressorKind::Pinning:
|
||||
return PrintAccessor(accessor, "addressWithPinnedOwner");
|
||||
case AddressorKind::NativeOwning:
|
||||
return PrintAccessor(accessor, "addressWithNativeOwner");
|
||||
case AddressorKind::NativePinning:
|
||||
return PrintAccessor(accessor, "addressWithPinnedNativeOwner");
|
||||
}
|
||||
llvm_unreachable("bad addressor kind");
|
||||
};
|
||||
@@ -687,8 +689,10 @@ void PrintAST::printAccessors(AbstractStorageDecl *ASD) {
|
||||
return PrintAccessor(accessor, "unsafeMutableAddress");
|
||||
case AddressorKind::Owning:
|
||||
return PrintAccessor(accessor, "mutableAddressWithOwner");
|
||||
case AddressorKind::Pinning:
|
||||
return PrintAccessor(accessor, "mutableAddressWithPinnedOwner");
|
||||
case AddressorKind::NativeOwning:
|
||||
return PrintAccessor(accessor, "mutableAddressWithNativeOwner");
|
||||
case AddressorKind::NativePinning:
|
||||
return PrintAccessor(accessor, "mutableAddressWithPinnedNativeOwner");
|
||||
}
|
||||
llvm_unreachable("bad addressor kind");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user