[PATCH] D79671: [MsgPack] MsgPackDocument::readFromBlob now merges

Tim Renouf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 12 11:49:31 PDT 2020


tpr added a comment.

In D79671#2030708 <https://reviews.llvm.org/D79671#2030708>, @scott.linder wrote:

> Dinesh is working on merging metadata in ROCm CompilerSupport using MsgPackDocument, and it fell out that merging YAML metadata was also handled transparently. What is the advantage to doing this via a function pointer passed to `readFromBlob`? It doesn't seem to save any copies as you still need to be able to compare the nodes; is it just a matter of readability? Would it be reasonable to also add a callback for `fromYAML`?


I too tried doing it by reading the second blob into a MsgPackDocument and merging it into the first one from there. But I think that does involve more copies/allocation/etc because a map in the second document would actually get created as a std::map before having its elements merged into the corresponding map in the first document.

I guess the same thing as I have done could be done for the YAML reading code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79671/new/

https://reviews.llvm.org/D79671





More information about the llvm-commits mailing list