mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add the @exclusivity attribute.
The `@exclusivity(unchecked)` attribute can be used on variables to selectively disable exclusivity checking. For completeness, also the `@exclusivity(checked)` variant is supported: it turns on exclusivity checking for specific variables if exclusivity enforcement is disabled by the command line option. This new attribute is a missing implementation part of SE-0176 (https://github.com/apple/swift-evolution/blob/main/proposals/0176-enforce-exclusive-access-to-memory.md). rdar://31121356
This commit is contained in:
@@ -4416,6 +4416,14 @@ llvm::Error DeclDeserializer::deserializeDeclCommon() {
|
||||
break;
|
||||
}
|
||||
|
||||
case decls_block::Exclusivity_DECL_ATTR: {
|
||||
unsigned kind;
|
||||
serialization::decls_block::ExclusivityDeclAttrLayout::readRecord(
|
||||
scratch, kind);
|
||||
Attr = new (ctx) ExclusivityAttr((ExclusivityAttr::Mode)kind);
|
||||
break;
|
||||
}
|
||||
|
||||
case decls_block::Effects_DECL_ATTR: {
|
||||
unsigned kind;
|
||||
serialization::decls_block::EffectsDeclAttrLayout::readRecord(scratch,
|
||||
|
||||
Reference in New Issue
Block a user