@@ -54,7 +54,7 @@ const uint16_t VERSION_MAJOR = 0;
54
54
// / in source control, you should also update the comment to briefly
55
55
// / describe what change you made. The content of this comment isn't important;
56
56
// / it just ensures a conflict if two people change the module format.
57
- const uint16_t VERSION_MINOR = 380 ; // Last change: IUO decl attribute
57
+ const uint16_t VERSION_MINOR = 381 ; // Last change: generic signature
58
58
59
59
using DeclIDField = BCFixed<31 >;
60
60
@@ -77,6 +77,11 @@ using DeclContextIDField = DeclIDField;
77
77
using NormalConformanceID = DeclID;
78
78
using NormalConformanceIDField = DeclIDField;
79
79
80
+ // GenericSignatureID must be the same as DeclID because it is stored in the
81
+ // same way.
82
+ using GenericSignatureID = DeclID;
83
+ using GenericSignatureIDField = DeclIDField;
84
+
80
85
// GenericEnvironmentID must be the same as DeclID because it is stored in the
81
86
// same way.
82
87
using GenericEnvironmentID = DeclID;
@@ -738,8 +743,7 @@ namespace decls_block {
738
743
TypeIDField, // output
739
744
FunctionTypeRepresentationField, // representation
740
745
BCFixed<1 >, // throws?
741
- BCArray<TypeIDField> // generic parameters
742
- // followed by requirements
746
+ GenericSignatureIDField // generic signture
743
747
>;
744
748
745
749
using SILFunctionTypeLayout = BCRecordLayout<
@@ -753,12 +757,11 @@ namespace decls_block {
753
757
BCFixed<30 >, // number of parameters
754
758
BCFixed<30 >, // number of yields
755
759
BCFixed<30 >, // number of results
760
+ GenericSignatureIDField, // generic signature
756
761
BCArray<TypeIDField> // parameter types/conventions, alternating
757
762
// followed by result types/conventions, alternating
758
763
// followed by error result type/convention
759
- // followed by generic parameter types
760
764
// Optionally a protocol conformance (for witness_methods)
761
- // Trailed by its generic requirements, if any.
762
765
>;
763
766
764
767
using SILBlockStorageTypeLayout = BCRecordLayout<
@@ -768,10 +771,9 @@ namespace decls_block {
768
771
769
772
using SILLayoutLayout = BCRecordLayout<
770
773
SIL_LAYOUT,
774
+ GenericSignatureIDField, // generic signature
771
775
BCFixed<31 >, // number of fields
772
776
BCArray<TypeIDWithBitField> // field types with mutability
773
- // followed by generic parameters
774
- // trailed by generic requirements, if any
775
777
>;
776
778
777
779
using SILBoxTypeLayout = BCRecordLayout<
@@ -1165,9 +1167,9 @@ namespace decls_block {
1165
1167
DeclIDField // Typealias
1166
1168
>;
1167
1169
1168
- using GenericEnvironmentLayout = BCRecordLayout<
1169
- GENERIC_ENVIRONMENT ,
1170
- BCArray<TypeIDField> // sugared interface types
1170
+ using GenericSignatureLayout = BCRecordLayout<
1171
+ GENERIC_SIGNATURE ,
1172
+ BCArray<TypeIDField> // generic parameter types
1171
1173
>;
1172
1174
1173
1175
using SILGenericEnvironmentLayout = BCRecordLayout<
@@ -1282,8 +1284,8 @@ namespace decls_block {
1282
1284
using XRefExtensionPathPieceLayout = BCRecordLayout<
1283
1285
XREF_EXTENSION_PATH_PIECE,
1284
1286
ModuleIDField, // module ID
1285
- BCArray<TypeIDField> // for a constrained extension, the type parameters
1286
- // for a constrained extension, requirements follow
1287
+ GenericSignatureIDField // for a constrained extension,
1288
+ // the generic signature
1287
1289
>;
1288
1290
1289
1291
using XRefOperatorOrAccessorPathPieceLayout = BCRecordLayout<
@@ -1535,7 +1537,8 @@ namespace index_block {
1535
1537
NESTED_TYPE_DECLS,
1536
1538
DECL_MEMBER_NAMES,
1537
1539
1538
- LastRecordKind = DECL_MEMBER_NAMES,
1540
+ GENERIC_SIGNATURE_OFFSETS,
1541
+ LastRecordKind = GENERIC_SIGNATURE_OFFSETS,
1539
1542
};
1540
1543
1541
1544
constexpr const unsigned RecordIDFieldWidth = 5 ;
0 commit comments