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

Sergei Barannikov via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 19 05:30:05 PST 2023


================
@@ -274,20 +274,27 @@ class DefaultIntArgument<string name, int default> : IntArgument<name, 1> {
 }
 
 // This argument is more complex, it includes the enumerator type name,
-// a list of strings to accept, and a list of enumerators to map them to.
-class EnumArgument<string name, string type, list<string> values,
+// a list of possible values, and a list of enumerators to map them to.
+class EnumArgument<string name, string type, bit is_string, list<string> values,
----------------
s-barannikov wrote:

Sorry for late reply. All String arguments are already unevaluated as made by https://reviews.llvm.org/D156237.
This patch makes Enum arguments unevaluated too, but only those that are effectively strings
Consider:
`__attribute__((visibility("default" / "protected" /...)))`
`__attribute__((enum_extensibility(open / closed)))`).
Both attributes have enum arguments. The first one has a string enum argument (which should be parsed unevaluated), while the second has an identifier enum argument.


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


More information about the cfe-commits mailing list