mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SIL: Introduce a new @inout_aliasable parameter convention.
Modeling nonescaping captures as @inout parameters is wrong, because captures are allowed to share state, unlike 'inout' parameters, which are allowed to assume to some degree that there are no aliases during the parameter's scope. To model this, introduce a new @inout_aliasable parameter convention to indicate an indirect parameter that can be written to, not only by the current function, but by well-typed, well-synchronized aliasing accesses too. (This is unrelated to our discussions of adding a "type-unsafe-aliasable" annotation to pointer_to_address to allow for safe pointer punning.)
This commit is contained in:
@@ -51,7 +51,7 @@ const uint16_t VERSION_MAJOR = 0;
|
||||
/// To ensure that two separate changes don't silently get merged into one
|
||||
/// in source control, you should also update the comment to briefly
|
||||
/// describe what change you made.
|
||||
const uint16_t VERSION_MINOR = 222; // Last change: @_fixed_layout
|
||||
const uint16_t VERSION_MINOR = 223; // Last change: SIL @inout_aliasable
|
||||
|
||||
using DeclID = Fixnum<31>;
|
||||
using DeclIDField = BCFixed<31>;
|
||||
@@ -179,13 +179,14 @@ enum class ParameterConvention : uint8_t {
|
||||
Indirect_In,
|
||||
Indirect_Out,
|
||||
Indirect_Inout,
|
||||
Indirect_InoutAliasable,
|
||||
Direct_Owned,
|
||||
Direct_Unowned,
|
||||
Direct_Guaranteed,
|
||||
Indirect_In_Guaranteed,
|
||||
Direct_Deallocating,
|
||||
};
|
||||
using ParameterConventionField = BCFixed<3>;
|
||||
using ParameterConventionField = BCFixed<4>;
|
||||
|
||||
// These IDs must \em not be renumbered or reordered without incrementing
|
||||
// VERSION_MAJOR.
|
||||
|
||||
Reference in New Issue
Block a user