[clang-tools-extra] [clang-doc] add support for enums comments in html generation (PR #101282)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 9 15:50:27 PDT 2024


================
@@ -653,15 +697,35 @@ static std::vector<std::unique_ptr<TagNode>>
 genHTML(const EnumInfo &I, const ClangDocContext &CDCtx) {
   std::vector<std::unique_ptr<TagNode>> Out;
   std::string EnumType = I.Scoped ? "enum class " : "enum ";
+  // Determine if enum members have comments attached
+  bool HasComments = false;
+  for (const auto &M : I.Members) {
+    if (!M.Description.empty()) {
+      HasComments = true;
+      break;
+    }
+  }
+  std::unique_ptr<TagNode> Table =
+      std::make_unique<TagNode>(HTMLTag::TAG_TABLE);
+  std::unique_ptr<TagNode> Thead =
----------------
ilovepi wrote:

```suggestion
  std::unique_ptr<TagNode> THead =
```
Does that make it more readable? I keep reading `Thead` as `Thread`...

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


More information about the cfe-commits mailing list