AaronBallman wrote:

> Second: We create a new `Argument` type in `Attr.td`, and the code-gen 
> infrastructure for it that takes an "identifier surrounded by quotes" (sort 
> of a mix between `IdentifierArgument` and `StringArgument`). This has the 
> effect of using our 'normal' parsing rules and diagnostics for the identifier.

I'm a bit less sold on this approach, but only due to the user confusion that 
stems from it. Enum arguments can be strings or identifiers and that's caused 
some surprise for people in the past. Users are used to enumerations being 
identifiers not strings, and I think users are similarly used to identifiers 
being identifiers and not strings.

I kind of think "no enforcement for invalid input" is reasonable here. That 
would be consistent with things like the `alias` attribute where we accept a 
string that has to conform to ABI mangling rules (which could be a matter of 
poor QoI rather than precedent).

https://github.com/llvm/llvm-project/pull/84272
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to