@@ -8236,16 +8236,16 @@ ERROR(attr_abi_mismatched_kind,none,
8236
8236
8237
8237
ERROR(attr_abi_mismatched_arity,none,
8238
8238
" cannot give %kind0 the ABI of a %kindonly0 with a different number of "
8239
- " low-level parameters " ,
8240
- (ValueDecl * ))
8239
+ " %select{|generic }1parameters " ,
8240
+ (Decl *, /* genericParams= */ bool ))
8241
8241
8242
8242
ERROR(attr_abi_mismatched_throws,none,
8243
8243
" cannot give %0 the ABI of a %kindonly0 which %select{cannot|can}1 throw" ,
8244
- (ValueDecl *, /* abiCanThrow=*/ bool ))
8244
+ (Decl *, /* abiCanThrow=*/ bool ))
8245
8245
8246
8246
ERROR(attr_abi_mismatched_async,none,
8247
8247
" cannot give %0 the ABI of %select{a non-async|an async}1 %kindonly0" ,
8248
- (ValueDecl *, /* abiIsAsync=*/ bool ))
8248
+ (Decl *, /* abiIsAsync=*/ bool ))
8249
8249
8250
8250
ERROR(attr_abi_mismatched_pbd_size,none,
8251
8251
" cannot give pattern binding the ABI of a binding with "
@@ -8254,13 +8254,86 @@ ERROR(attr_abi_mismatched_pbd_size,none,
8254
8254
8255
8255
ERROR(attr_abi_mismatched_var,none,
8256
8256
" no match for %select{%kind0 in the ABI|ABI %kind0}1" ,
8257
- (ValueDecl *, /* isABI=*/ bool ))
8257
+ (Decl *, /* isABI=*/ bool ))
8258
8258
8259
8259
ERROR(attr_abi_incompatible_with_silgen_name,none,
8260
8260
" cannot use '@_silgen_name' and '@abi' on the same %0 because they serve "
8261
8261
" the same purpose" ,
8262
8262
(DescriptiveDeclKind))
8263
8263
8264
+ ERROR(attr_abi_missing_attr,none,
8265
+ " missing '%0' %select{attribute|modifier}1 in '@abi'" ,
8266
+ (StringRef, bool ))
8267
+ ERROR(attr_abi_extra_attr,none,
8268
+ " extra %select{|implicit }2'%0' %select{attribute|modifier}1 in '@abi'" ,
8269
+ (StringRef, bool , /* isImplicit=*/ bool ))
8270
+ ERROR(attr_abi_forbidden_attr,none,
8271
+ " unused '%0' %select{attribute|modifier}1 in '@abi'" ,
8272
+ (StringRef, bool ))
8273
+ REMARK(abi_attr_inferred_attribute,none,
8274
+ " inferred '%0' in '@abi' to match %select{attribute|modifier}1 on API" ,
8275
+ (StringRef, bool ))
8276
+
8277
+ ERROR(attr_abi_mismatched_attr,none,
8278
+ " '%0' %select{attribute|modifier}1 in '@abi' should match '%2'" ,
8279
+ (StringRef, bool , StringRef))
8280
+ NOTE(attr_abi_matching_attr_here,none,
8281
+ " %select{should match|matches}0 %select{attribute|modifier}1 "
8282
+ " %select{|implicitly added }2here" ,
8283
+ (/* matches=*/ bool , /* isModifier=*/ bool , /* isImplicit=*/ bool ))
8284
+
8285
+ ERROR(attr_abi_mismatched_type,none,
8286
+ " type %0 in '@abi' should match %1" ,
8287
+ (Type, Type))
8288
+ NOTE(attr_abi_should_match_type_here,none,
8289
+ " should match type here" , ())
8290
+
8291
+ ERROR(attr_abi_mismatched_generic_signature,none,
8292
+ " generic signature '%0' in '@abi' is not compatible with '%1'" ,
8293
+ (StringRef, StringRef))
8294
+ ERROR(attr_abi_missing_generic_signature,none,
8295
+ " declaration in '@abi' should have generic signature compatible with "
8296
+ " '%0'" ,
8297
+ (StringRef))
8298
+ ERROR(attr_abi_extra_generic_signature,none,
8299
+ " declaration in '@abi' should not have generic signature because %0 "
8300
+ " is not generic" ,
8301
+ (Decl *))
8302
+
8303
+ ERROR(attr_abi_mismatched_param_modifier,none,
8304
+ " %select{default |}0%3 %select{attribute|modifier}2 "
8305
+ " %select{|'%0' }0in '@abi' is not compatible with %select{default|'%1'}1" ,
8306
+ (StringRef, StringRef, /* isModifier=*/ bool , DescriptiveDeclKind))
8307
+ ERROR(attr_abi_no_default_arguments,none,
8308
+ " %kind0 in '@abi' should not have a default argument; it does not "
8309
+ " affect the parameter's ABI" ,
8310
+ (Decl *))
8311
+
8312
+ // These macros insert 'final', 'non-final', or nothing depending on both the
8313
+ // current decl and its counterpart, such that 'non-final' is used if the
8314
+ // counterpart would be described as 'final' or 'static'. They must be kept in
8315
+ // sync with `StaticnessAndFinality`.
8316
+ #define NONFINAL_OR_NOTHING (COUNTERPART ) \
8317
+ " %select{||non-final |non-final |non-final |%error}" #COUNTERPART
8318
+ #define FINAL_OR_NONFINAL_OR_NOTHING (CURRENT, COUNTERPART, FINAL_OK ) \
8319
+ " %select{|%select{" NONFINAL_OR_NOTHING(COUNTERPART) \
8320
+ "|" NONFINAL_OR_NOTHING(COUNTERPART) \
8321
+ "|final |final ||%error}" #CURRENT " }" #FINAL_OK
8322
+
8323
+ ERROR(attr_abi_static_final_mismatch,none,
8324
+ FINAL_OR_NONFINAL_OR_NOTHING(0, 2, 4) " %kind1 in ' @abi' should be "
8325
+ FINAL_OR_NONFINAL_OR_NOTHING(2, 0, 4) " %kindonly3 to ensure ABI "
8326
+ " compatibility" ,
8327
+ (uint8_t, Decl *, uint8_t, Decl *, /*isClass=*/bool))
8328
+
8329
+ #undef NONFINAL_OR_NOTHING
8330
+ #undef FINAL_OR_NONFINAL_OR_NOTHING
8331
+
8332
+ ERROR(attr_abi_failable_mismatch,none,
8333
+ " cannot give %select{non-failable|failable}1 %kind0 the ABI of a "
8334
+ " %select{non-failable|failable}2 %kindonly0" ,
8335
+ (Decl *, bool, bool))
8336
+
8264
8337
//===----------------------------------------------------------------------===//
8265
8338
// MARK: @execution Attribute
8266
8339
//===----------------------------------------------------------------------===//
0 commit comments