[llvm] [Offload] Define `_NUM_VARIANTS` macros for generated enumerations (PR #147314)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 7 08:16:17 PDT 2025


================
@@ -151,6 +151,12 @@ static void ProcessEnum(const EnumRec &Enum, raw_ostream &OS) {
                 Enum.getEnumValNamePrefix());
 
   OS << formatv("} {0};\n", Enum.getName());
+
+  // Add field for the number of variants
+  OS << formatv(TAB_1
----------------
jhuber6 wrote:

Normally there's like a `ENUM_LAST` member. Do we have that?

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


More information about the llvm-commits mailing list