mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[AST] Introduce "ValueOwnership" collecting __shared, inout, etc.
This is designed to stop having to n bits to track each of the mutually exclusive 'shared', 'inout' and eventually 'owned'.
This commit is contained in:
@@ -55,7 +55,7 @@ const uint16_t VERSION_MAJOR = 0;
|
||||
/// describe what change you made. The content of this comment isn't important;
|
||||
/// it just ensures a conflict if two people change the module format.
|
||||
/// Don't worry about adhering to the 80-column limit for this line.
|
||||
const uint16_t VERSION_MINOR = 400; // Last change: sil_property
|
||||
const uint16_t VERSION_MINOR = 401; // Last change: ValueOwnership
|
||||
|
||||
using DeclIDField = BCFixed<31>;
|
||||
|
||||
@@ -319,6 +319,15 @@ enum ReferenceOwnership : uint8_t {
|
||||
};
|
||||
using ReferenceOwnershipField = BCFixed<2>;
|
||||
|
||||
// These IDs must \em not be renumbered or reordered without incrementing
|
||||
// VERSION_MAJOR.
|
||||
enum ValueOwnership : uint8_t {
|
||||
Default = 0,
|
||||
InOut,
|
||||
Shared,
|
||||
};
|
||||
using ValueOwnershipField = BCFixed<2>;
|
||||
|
||||
// These IDs must \em not be renumbered or reordered without incrementing
|
||||
// VERSION_MAJOR.
|
||||
enum class DefaultArgumentKind : uint8_t {
|
||||
@@ -656,8 +665,7 @@ namespace decls_block {
|
||||
BCFixed<1>, // vararg?
|
||||
BCFixed<1>, // autoclosure?
|
||||
BCFixed<1>, // escaping?
|
||||
BCFixed<1>, // inout?
|
||||
BCFixed<1> // shared?
|
||||
ValueOwnershipField // inout, shared or owned?
|
||||
>;
|
||||
|
||||
using TupleTypeLayout = BCRecordLayout<
|
||||
@@ -671,8 +679,7 @@ namespace decls_block {
|
||||
BCFixed<1>, // vararg?
|
||||
BCFixed<1>, // autoclosure?
|
||||
BCFixed<1>, // escaping?
|
||||
BCFixed<1>, // inout?
|
||||
BCFixed<1> // shared?
|
||||
ValueOwnershipField // inout, shared or owned?
|
||||
>;
|
||||
|
||||
using FunctionTypeLayout = BCRecordLayout<
|
||||
|
||||
Reference in New Issue
Block a user