mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[transferring] Change transferring to no longer be a ParamSpecifier.
Instead it is a bit on ParamDecl and SILParameterInfo. I preserve the consuming behavior by making it so that the type checker changes the ParamSpecifier to ImplicitlyCopyableConsuming if we have a default param specifier and transferring is set. NOTE: The user can never write ImplicitlyCopyableConsuming. NOTE: I had to expand the amount of flags that can be stored in ParamDecl so I stole bits from TypeRepr and added some logic for packing option bits into TyRepr and DefaultValue. rdar://121324715
This commit is contained in:
@@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_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 SWIFTMODULE_VERSION_MINOR = 852; // SILFunctionType::ErasedIsolation
|
||||
const uint16_t SWIFTMODULE_VERSION_MINOR = 853; // transferring fixes
|
||||
|
||||
/// A standard hash seed used for all string hashes in a serialized module.
|
||||
///
|
||||
@@ -359,7 +359,7 @@ enum class ParamDeclSpecifier : uint8_t {
|
||||
Consuming = 3,
|
||||
LegacyShared = 4,
|
||||
LegacyOwned = 5,
|
||||
Transferring = 6,
|
||||
ImplicitlyCopyableConsuming = 6,
|
||||
};
|
||||
using ParamDeclSpecifierField = BCFixed<3>;
|
||||
|
||||
@@ -402,6 +402,7 @@ enum class SILParameterDifferentiability : uint8_t {
|
||||
enum class SILParameterInfoFlags : uint8_t {
|
||||
NotDifferentiable = 0x1,
|
||||
Isolated = 0x2,
|
||||
Transferring = 0x4,
|
||||
};
|
||||
|
||||
using SILParameterInfoOptions = OptionSet<SILParameterInfoFlags>;
|
||||
@@ -1605,6 +1606,7 @@ namespace decls_block {
|
||||
BCFixed<1>, // isAutoClosure?
|
||||
BCFixed<1>, // isIsolated?
|
||||
BCFixed<1>, // isCompileTimeConst?
|
||||
BCFixed<1>, // isTransferring?
|
||||
DefaultArgumentField, // default argument kind
|
||||
TypeIDField, // default argument type
|
||||
ActorIsolationField, // default argument isolation
|
||||
|
||||
Reference in New Issue
Block a user