================
@@ -353,6 +354,24 @@ static void generateContext(const Info &I, Object &Obj) {
   Obj["HasContexts"] = true;
 }
 
+static void serializeDescription(llvm::ArrayRef<CommentInfo> Description, 
json::Object &Obj) {
----------------
ilovepi wrote:

Why not return the Object from this routine? at both call sites you're 
initializing an empty object and passing it in. It seems like you'd more 
naturally just create that object w/in this function and return it.

You could also fold the `Obj["Description"] = std::move(Description);` bits 
into this implementation. I don't have too strong opinion on that one. It'd 
make the API not really just a pure serialization, but 🤷 .

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