@@ -303,7 +303,7 @@ static GuardStmt *returnIfNotEqualGuard(ASTContext &C,
303
303
}
304
304
305
305
static void
306
- deriveBodyEquatable_enum_uninhabited_eq (AbstractFunctionDecl *eqDecl) {
306
+ deriveBodyEquatable_enum_uninhabited_eq (AbstractFunctionDecl *eqDecl, void * ) {
307
307
auto parentDC = eqDecl->getDeclContext ();
308
308
ASTContext &C = parentDC->getASTContext ();
309
309
@@ -334,7 +334,8 @@ deriveBodyEquatable_enum_uninhabited_eq(AbstractFunctionDecl *eqDecl) {
334
334
// / values. This generates code that converts each value to its integer ordinal
335
335
// / and compares them, which produces an optimal single icmp instruction.
336
336
static void
337
- deriveBodyEquatable_enum_noAssociatedValues_eq (AbstractFunctionDecl *eqDecl) {
337
+ deriveBodyEquatable_enum_noAssociatedValues_eq (AbstractFunctionDecl *eqDecl,
338
+ void *) {
338
339
auto parentDC = eqDecl->getDeclContext ();
339
340
ASTContext &C = parentDC->getASTContext ();
340
341
@@ -389,7 +390,8 @@ deriveBodyEquatable_enum_noAssociatedValues_eq(AbstractFunctionDecl *eqDecl) {
389
390
// / Derive the body for an '==' operator for an enum where at least one of the
390
391
// / cases has associated values.
391
392
static void
392
- deriveBodyEquatable_enum_hasAssociatedValues_eq (AbstractFunctionDecl *eqDecl) {
393
+ deriveBodyEquatable_enum_hasAssociatedValues_eq (AbstractFunctionDecl *eqDecl,
394
+ void *) {
393
395
auto parentDC = eqDecl->getDeclContext ();
394
396
ASTContext &C = parentDC->getASTContext ();
395
397
@@ -503,7 +505,8 @@ deriveBodyEquatable_enum_hasAssociatedValues_eq(AbstractFunctionDecl *eqDecl) {
503
505
}
504
506
505
507
// / Derive the body for an '==' operator for a struct.
506
- static void deriveBodyEquatable_struct_eq (AbstractFunctionDecl *eqDecl) {
508
+ static void deriveBodyEquatable_struct_eq (AbstractFunctionDecl *eqDecl,
509
+ void *) {
507
510
auto parentDC = eqDecl->getDeclContext ();
508
511
ASTContext &C = parentDC->getASTContext ();
509
512
@@ -554,7 +557,7 @@ static void deriveBodyEquatable_struct_eq(AbstractFunctionDecl *eqDecl) {
554
557
// / Derive an '==' operator implementation for an enum or a struct.
555
558
static ValueDecl *
556
559
deriveEquatable_eq (DerivedConformance &derived,
557
- void (*bodySynthesizer)(AbstractFunctionDecl *)) {
560
+ void (*bodySynthesizer)(AbstractFunctionDecl *, void * )) {
558
561
// enum SomeEnum<T...> {
559
562
// case A, B(Int), C(String, Int)
560
563
//
@@ -731,7 +734,8 @@ static CallExpr *createHasherCombineCall(ASTContext &C,
731
734
732
735
static FuncDecl *
733
736
deriveHashable_hashInto (DerivedConformance &derived,
734
- void (*bodySynthesizer)(AbstractFunctionDecl *)) {
737
+ void (*bodySynthesizer)(AbstractFunctionDecl *,
738
+ void *)) {
735
739
// @derived func hash(into hasher: inout Hasher)
736
740
737
741
ASTContext &C = derived.TC .Context ;
@@ -792,7 +796,7 @@ deriveHashable_hashInto(DerivedConformance &derived,
792
796
// / Derive the body for the hash(into:) method when hashValue has a
793
797
// / user-supplied implementation.
794
798
static void
795
- deriveBodyHashable_compat_hashInto (AbstractFunctionDecl *hashIntoDecl) {
799
+ deriveBodyHashable_compat_hashInto (AbstractFunctionDecl *hashIntoDecl, void * ) {
796
800
// func hash(into hasher: inout Hasher) {
797
801
// hasher.combine(self.hashValue)
798
802
// }
@@ -817,8 +821,7 @@ deriveBodyHashable_compat_hashInto(AbstractFunctionDecl *hashIntoDecl) {
817
821
// / value.
818
822
static void
819
823
deriveBodyHashable_enum_rawValue_hashInto (
820
- AbstractFunctionDecl *hashIntoDecl
821
- ) {
824
+ AbstractFunctionDecl *hashIntoDecl, void *) {
822
825
// enum SomeEnum: Int {
823
826
// case A, B, C
824
827
// @derived func hash(into hasher: inout Hasher) {
@@ -846,8 +849,7 @@ deriveBodyHashable_enum_rawValue_hashInto(
846
849
// / values.
847
850
static void
848
851
deriveBodyHashable_enum_noAssociatedValues_hashInto (
849
- AbstractFunctionDecl *hashIntoDecl
850
- ) {
852
+ AbstractFunctionDecl *hashIntoDecl, void *) {
851
853
// enum SomeEnum {
852
854
// case A, B, C
853
855
// @derived func hash(into hasher: inout Hasher) {
@@ -888,8 +890,7 @@ deriveBodyHashable_enum_noAssociatedValues_hashInto(
888
890
// / values.
889
891
static void
890
892
deriveBodyHashable_enum_hasAssociatedValues_hashInto (
891
- AbstractFunctionDecl *hashIntoDecl
892
- ) {
893
+ AbstractFunctionDecl *hashIntoDecl, void *) {
893
894
// enum SomeEnumWithAssociatedValues {
894
895
// case A, B(Int), C(String, Int)
895
896
// @derived func hash(into hasher: inout Hasher) {
@@ -977,7 +978,7 @@ deriveBodyHashable_enum_hasAssociatedValues_hashInto(
977
978
978
979
// / Derive the body for the 'hash(into:)' method for a struct.
979
980
static void
980
- deriveBodyHashable_struct_hashInto (AbstractFunctionDecl *hashIntoDecl) {
981
+ deriveBodyHashable_struct_hashInto (AbstractFunctionDecl *hashIntoDecl, void * ) {
981
982
// struct SomeStruct {
982
983
// var x: Int
983
984
// var y: String
@@ -1019,7 +1020,7 @@ deriveBodyHashable_struct_hashInto(AbstractFunctionDecl *hashIntoDecl) {
1019
1020
1020
1021
// / Derive the body for the 'hashValue' getter.
1021
1022
static void
1022
- deriveBodyHashable_hashValue (AbstractFunctionDecl *hashValueDecl) {
1023
+ deriveBodyHashable_hashValue (AbstractFunctionDecl *hashValueDecl, void * ) {
1023
1024
auto parentDC = hashValueDecl->getDeclContext ();
1024
1025
ASTContext &C = parentDC->getASTContext ();
1025
1026
@@ -1194,7 +1195,7 @@ ValueDecl *DerivedConformance::deriveHashable(ValueDecl *requirement) {
1194
1195
return nullptr ;
1195
1196
1196
1197
if (auto ED = dyn_cast<EnumDecl>(Nominal)) {
1197
- void (*bodySynthesizer)(AbstractFunctionDecl *);
1198
+ void (*bodySynthesizer)(AbstractFunctionDecl *, void * );
1198
1199
if (ED->isObjC ())
1199
1200
bodySynthesizer = deriveBodyHashable_enum_rawValue_hashInto;
1200
1201
else if (ED->hasOnlyCasesWithoutAssociatedValues ())
0 commit comments