[llvm-branch-commits] [clang-tools-extra] [clang-doc] add support for concepts (PR #144430)
Paul Kirth via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jun 20 10:00:55 PDT 2025
================
@@ -248,6 +257,27 @@ static void serializeCommonChildren(const ScopeChildren &Children,
}
}
+template <typename T, typename SerializationFunc>
+static void serializeArray(const std::vector<T> &Records, Object &Obj,
+ const std::string &Key,
+ SerializationFunc serializeInfo) {
+ json::Value RecordsArray = Array();
+ auto &RecordsArrayRef = *RecordsArray.getAsArray();
+ RecordsArrayRef.reserve(Records.size());
+ for (const auto &Item : Records) {
+ json::Value ItemVal = Object();
+ auto &ItemObj = *ItemVal.getAsObject();
+ serializeInfo(Item, ItemObj);
+ RecordsArrayRef.push_back(ItemVal);
+ }
----------------
ilovepi wrote:
Here's another code pattern I see repeated a lot.
https://github.com/llvm/llvm-project/pull/144430
More information about the llvm-branch-commits
mailing list