[clang-tools-extra] [Clang-doc] Display enum comments and member values in html/md (PR #183085)

Samrudh Nelli via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 26 07:46:02 PST 2026


================
@@ -565,6 +565,22 @@ static void serializeInfo(const EnumValueInfo &I, Object &Obj) {
     Obj["ValueExpr"] = I.ValueExpr;
   else
     Obj["Value"] = I.Value;
+  if (!I.Description.empty()) {
+    json::Value CommentsArray = Array();
+    auto &CommentsArrayRef = *CommentsArray.getAsArray();
+    Object TempObj, ChildJson;
+    for (const auto &Child : I.Description) {
+      for (const auto &CI : Child.Children) {
+        ChildJson = serializeComment(*CI, TempObj);
----------------
SamrudhNelli wrote:

As far as I could understand `static Object serializeComment(const CommentInfo &, Object &)` requires an `Object &` passed to it. Even though the function returns the output object, for some types of comments, the comment is also written to the object pass.

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


More information about the cfe-commits mailing list