Skip to content

Commit b520d21

Browse files
authored
[Offload] Add tagged type to enumerator docs (#147998)
When `EnumRec::isTyped()` is true, include the `EnumValueRec::getTaggedType()` to the documentation.
1 parent d214f07 commit b520d21

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

offload/tools/offload-tblgen/DocGen.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ void processEnum(const EnumRec &E, raw_ostream &OS) {
8686
for (const EnumValueRec Etor : E.getValues()) {
8787
OS << formatv(" .. c:enumerator:: {0}_{1}\n\n", E.getEnumValNamePrefix(),
8888
Etor.getName());
89-
OS << " " << Etor.getDesc() << "\n\n";
89+
OS << " ";
90+
if (E.isTyped()) {
91+
OS << ":c:expr:`" << Etor.getTaggedType() << "` — ";
92+
}
93+
OS << Etor.getDesc() << "\n\n";
9094
}
9195
}
9296

0 commit comments

Comments
 (0)