[PATCH] D36235: [pdb/lld] Write a valid FPM

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 13:19:32 PDT 2017


zturner added inline comments.


================
Comment at: llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp:167-169
+  FpmStream =
+      WritableMappedBlockStream::createFpmStream(Layout, MsfBuffer, Allocator);
+  FpmWriter = BinaryStreamWriter(*FpmStream);
----------------
zturner wrote:
> rnk wrote:
> > Why do you need to recreate the stream and writer?
> The stream doesn't have methods to update its length, so we need a new stream, and the writer doesn't have a method to set the stream to a new stream.
BTW, the cost of "making a new stream" is not high.  Nothing is really happening other than allocating a stream object and setting some of its fields.  So we're wasting one (small) heap allocated object, but there's no copying or anything going on.


https://reviews.llvm.org/D36235





More information about the llvm-commits mailing list