================
@@ -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);
----------------
evelez7 wrote:

I think this is correct but the way this was written threw me off for a bit. I 
think this would be better if you at least assigned `ChildJson` inside the 
conditional.

Something like
```
if (ChildJson = serializeComment(...); !ChildJson.empty())
  ChildJson = serializeComment(...);
```

Since it's only being used there.

https://github.com/llvm/llvm-project/pull/183085
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to