Only mangle borrowing/consuming when they would change ABI.

`__shared` and `__owned` would always get mangled, even when they don't have any effect
on ABI, making it unnecessarily ABI-breaking to apply them to existing API to make
calling conventions explicit. Avoid this issue by only mangling them in cases where they
change the ABI from the default.
This commit is contained in:
Joe Groff
2023-03-02 20:41:40 -08:00
parent f3a6ce144c
commit 5345e982e9
16 changed files with 281 additions and 138 deletions

View File

@@ -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 = 749; // added DeclContextKind::Package used by Serialization
const uint16_t SWIFTMODULE_VERSION_MINOR = 750; // serialize param specifiers into ParamTypeFlags
/// A standard hash seed used for all string hashes in a serialized module.
///
@@ -485,16 +485,6 @@ enum ReferenceOwnership : uint8_t {
};
using ReferenceOwnershipField = BCFixed<2>;
// These IDs must \em not be renumbered or reordered without incrementing
// the module version.
enum ValueOwnership : uint8_t {
Default = 0,
InOut,
Shared,
Owned
};
using ValueOwnershipField = BCFixed<2>;
// These IDs must \em not be renumbered or reordered without incrementing
// the module version.
enum class DefaultArgumentKind : uint8_t {
@@ -1163,7 +1153,7 @@ namespace decls_block {
BCFixed<1>, // vararg?
BCFixed<1>, // autoclosure?
BCFixed<1>, // non-ephemeral?
ValueOwnershipField, // inout, shared or owned?
ParamDeclSpecifierField, // inout, shared or owned?
BCFixed<1>, // isolated
BCFixed<1>, // noDerivative?
BCFixed<1> // compileTimeConst