[llvm] [Offload] Make EnumValueRec::getTaggedType() optional (PR #147998)
Kenneth Benzie via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 14 03:28:20 PDT 2025
https://github.com/kbenzie updated https://github.com/llvm/llvm-project/pull/147998
>From 3eda0598be6112031bc3252bfbac31856ea5f841 Mon Sep 17 00:00:00 2001
From: "Kenneth Benzie (Benie)" <k.benzie83 at gmail.com>
Date: Thu, 10 Jul 2025 17:33:18 +0100
Subject: [PATCH] [Offload] Make EnumValueRec::getTaggedType() optional
Not all `EnumValue`s specify a tagged type, this patch reflects that in
the record definitions whilst also including the tagged type in the docs
when it is specified.
---
offload/tools/offload-tblgen/DocGen.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/offload/tools/offload-tblgen/DocGen.cpp b/offload/tools/offload-tblgen/DocGen.cpp
index 29d00cb3b5098..56526112f69eb 100644
--- a/offload/tools/offload-tblgen/DocGen.cpp
+++ b/offload/tools/offload-tblgen/DocGen.cpp
@@ -86,7 +86,11 @@ void processEnum(const EnumRec &E, raw_ostream &OS) {
for (const EnumValueRec Etor : E.getValues()) {
OS << formatv(" .. c:enumerator:: {0}_{1}\n\n", E.getEnumValNamePrefix(),
Etor.getName());
- OS << " " << Etor.getDesc() << "\n\n";
+ OS << " ";
+ if (E.isTyped()) {
+ OS << ":c:expr:`" << Etor.getTaggedType() << "` — ";
+ }
+ OS << Etor.getDesc() << "\n\n";
}
}
More information about the llvm-commits
mailing list