================
@@ -456,6 +456,24 @@ static void serializeArray(const Container &Records, 
Object &Obj,
       ItemObj["End"] = true;
     RecordsArrayRef.push_back(ItemVal);
   }
+  if (Key == "Params") {
+    size_t TotalLength = 0;
+    for (const auto &Val : RecordsArrayRef) {
+      if (const auto *ItemObj = Val.getAsObject()) {
+        if (auto Type = ItemObj->getString("Type")) 
+          TotalLength += Type->size();
+        if (auto Name = ItemObj->getString("Name"))
+          TotalLength += Name->size();
+        TotalLength += 2; // For ', '
+      }
+    }
+    if (TotalLength > 15) {
+      Obj["IsLong"] = true;
+    }
+    else {
+      Obj["IsLong"] = false;
+    }
----------------
ilovepi wrote:

```suggestion
   Obj["isLong"] = TotalLength > 15;
```
Also, see the style guide for bracing: 
https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements

Everyone struggles w/ that one, since we dont' have the clang-format set for it 
by default.

I'm also not sure that using an object key is a great solution to wrapping. Did 
you consider other alternatives?

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

Reply via email to