mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add a swift3_migration attribute to describe how an API gets migrated.
Introduce a new attribute, swift3_migration, that lets us describe the transformation required to map a Swift 2.x API into its Swift 3 equivalent. The only transformation understood now is "renamed" (to some other declaration name), but there's a message field where we can record information about other changes. The attribute can grow somewhat (e.g., to represent parameter reordering) as we need it. Right now, we do nothing but store and validate this attribute.
This commit is contained in:
@@ -52,7 +52,7 @@ const uint16_t VERSION_MAJOR = 0;
|
||||
/// in source control, you should also update the comment to briefly
|
||||
/// 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.
|
||||
const uint16_t VERSION_MINOR = 233; // superclass requirement kind
|
||||
const uint16_t VERSION_MINOR = 234; // swift3_migration attribute added
|
||||
|
||||
using DeclID = Fixnum<31>;
|
||||
using DeclIDField = BCFixed<31>;
|
||||
@@ -1344,6 +1344,14 @@ namespace decls_block {
|
||||
BCArray<IdentifierIDField>
|
||||
>;
|
||||
|
||||
using Swift3MigrationDeclAttrLayout = BCRecordLayout<
|
||||
Swift3Migration_DECL_ATTR,
|
||||
BCFixed<1>, // implicit flag
|
||||
BCVBR<5>, // number of bytes in rename string
|
||||
BCVBR<5>, // number of bytes in message string
|
||||
BCBlob // rename, followed by message
|
||||
>;
|
||||
|
||||
using WarnUnusedResultDeclAttrLayout = BCRecordLayout<
|
||||
WarnUnusedResult_DECL_ATTR,
|
||||
BCFixed<1>, // implicit flag
|
||||
|
||||
Reference in New Issue
Block a user