[PATCH] D24316: Write the TPI stream from Yaml

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 9 10:21:14 PDT 2016


zturner added inline comments.

================
Comment at: include/llvm/DebugInfo/MSF/SequencedItemStream.h:28
@@ +27,3 @@
+
+/// SequencedItemStream represents a sequence of objects stored in a
+/// standard container but for which it is useful to view as a stream of
----------------
rnk wrote:
> I guess I'm surprised that we're still having to build scaffolding like this. I kind of thought that we had all the stream-y sequence-y primitives in MSF that we needed at this point.
> 
> I don't have any real suggestions on how to improve this, just a general comment.
I think we do have everything we need for reading PDBs, but I guess when you're constructing these things in memory, the requirements change somewhat because you have to adapt the in-memory format -- where it's convenient to store stuff in standard data structures -- to the on-disk format rather than the other way around.  All the stuff like `FixedStreamArray` etc are useful for going from the on-disk format to the in-memory format without a bunch of copying, but how do you go from vector of std::strings (for example) to a single buffer of null terminated strings?  We don't have anything like that, which is kind of what this is supposed to solve.

Another solution would have been to allocate some buffer up front, then manually serialize each thing into it, but since we're trying to be conservative with memory usage since PDBs can be so large that's not a great idea, and plus it doesn't take advantage of any of the existing machinery for writing to streams.


https://reviews.llvm.org/D24316





More information about the llvm-commits mailing list