[clang-tools-extra] [clang-doc] Display enum type along with enum name in HTML view (PR #181347)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 20 12:07:30 PST 2026


================
@@ -156,17 +156,20 @@ static void writeNameLink(const StringRef &CurrentPath, const Reference &R,
 
 static void genMarkdown(const ClangDocContext &CDCtx, const EnumInfo &I,
                         llvm::raw_ostream &OS) {
+  OS << "| enum ";
   if (I.Scoped)
-    writeLine("| enum class " + I.Name + " |", OS);
-  else
-    writeLine("| enum " + I.Name + " |", OS);
-  writeLine("--", OS);
+    OS << "class ";
+  OS << (I.Name.empty() ? StringRef("(unnamed)") : StringRef(I.Name)) << " ";
+  if (I.BaseType && !I.BaseType->Type.QualName.empty()) {
+    OS << ": " << I.BaseType->Type.QualName << " ";
+  }
+  OS << "|\n\n" << "--\n\n";
 
   std::string Buffer;
   llvm::raw_string_ostream Members(Buffer);
   if (!I.Members.empty())
     for (const auto &N : I.Members)
-      Members << "| " << N.Name << " |\n";
+      Members << "| " << N.Name << " | " << N.Value << " |\n";
----------------
ilovepi wrote:

I think I'd prefer handling the values to be its own PR. I know it feels trivial to add, but I'd like to just focus on solving the type issue in this patch, and we can discuss the values (and maybe comments) separatly.

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


More information about the cfe-commits mailing list