[clang] [clang] Differentiate between identifier and string EnumArgument (PR #68550)

Sergei Barannikov via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 27 14:25:03 PDT 2023


================
@@ -886,7 +893,7 @@ def ARMInterrupt : InheritableAttr, TargetSpecificAttr<TargetARM> {
   // MSP430Interrupt's, MipsInterrupt's and AnyX86Interrupt's spellings
   // must match.
   let Spellings = [GCC<"interrupt">];
-  let Args = [EnumArgument<"Interrupt", "InterruptType",
+  let Args = [EnumArgument<"Interrupt", "InterruptType", /*is_string=*/true,
----------------
s-barannikov wrote:

It appears that named arguments can only be specified [after all positional arguments](https://github.com/llvm/llvm-project/commit/91ccbc6c1c4c121935ee4fbfa0db13ad86590a59#diff-059342ba8068cf430c4000171f8873858823c8fd473cc38aa1dc719bf0b8104aR3194-R3197).
If I move `is_string` before `opt`, this can break downstream code because values supplied for `opt` will now be passed to `is_string. The other option is to make `is_string` optional and to move it to the end of the list, but I really wouldn't want to do this because there is no valid default value for this argument.


https://github.com/llvm/llvm-project/pull/68550


More information about the cfe-commits mailing list