@@ -9331,8 +9331,28 @@ def err_atomic_builtin_pointer_size : Error<
93319331 "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
93329332 "type (%0 invalid)">;
93339333def err_atomic_exclusive_builtin_pointer_size : Error<
9334- "address argument to load or store exclusive builtin must be a pointer to"
9335- " 1,2,4 or 8 byte type (%0 invalid)">;
9334+ "address argument to load or store exclusive builtin must be a pointer to "
9335+ // Because the range of legal sizes for load/store exclusive varies with the
9336+ // Arm architecture version, this error message wants to be able to specify
9337+ // various different subsets of the sizes 1, 2, 4, 8. Rather than make a
9338+ // separate diagnostic for each subset, I've arranged here that _this_ error
9339+ // can display any combination of the sizes. For each size there are two
9340+ // %select parameters: the first chooses whether you need a "," or " or " to
9341+ // separate the number from a previous one (or neither), and the second
9342+ // parameter indicates whether to display the number itself.
9343+ //
9344+ // (The very first of these parameters isn't really necessary, since you
9345+ // never want to start with "," or " or " before the first number in the
9346+ // list, but it keeps it simple to make it look exactly like the other cases,
9347+ // and also allows a loop constructing this diagnostic to handle every case
9348+ // exactly the same.)
9349+ "%select{|,| or }1%select{|1}2"
9350+ "%select{|,| or }3%select{|2}4"
9351+ "%select{|,| or }5%select{|4}6"
9352+ "%select{|,| or }7%select{|8}8"
9353+ " byte type (%0 invalid)">;
9354+ def err_atomic_exclusive_builtin_pointer_size_none : Error<
9355+ "load and store exclusive builtins are not available on this architecture">;
93369356def err_atomic_builtin_ext_int_size : Error<
93379357 "atomic memory operand must have a power-of-two size">;
93389358def err_atomic_builtin_bit_int_prohibit : Error<
0 commit comments