[PATCH] D19840: Parse and dump PDB TPI Stream

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 16:46:23 PDT 2016


zturner added inline comments.

================
Comment at: lib/DebugInfo/PDB/Raw/TpiStream.cpp:96
@@ +95,3 @@
+    codeview::TypeRecordPrefix Prefix;
+    RecordsReader.readObject(&Prefix);
+    Record.Kind =
----------------
rnk wrote:
> Check for failure here and on the getArrayRef, otherwise there's not much point to std::error_code
The `std::error_code` is because in the generic case of a `StreamReader` for which you don't know what type of underlying stream backs it (for example a `MappedBlockStream`, you might get an error.  In this case we know it's backed by a `ByteStream` (because that's the type of `RecordsBuffer`) which is guaranteed be contiguous and so `getArrayRef` should never return an error.


http://reviews.llvm.org/D19840





More information about the llvm-commits mailing list