[clang] [clang] Validate ABI tag attributes (PR #84272)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 7 07:36:22 PST 2024
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
More information about the cfe-commits
mailing list