This parses the TPI stream (stream 2) from the PDB file. This stream contains some header information followed by a series of codeview records. There is some additional complexity here in that alongside this stream of codeview records is a serialized hash table in order to efficiently query the types. We parse the necessary bookkeeping information to allow us to reconstruct the hash table, but we do not actually construct it yet as there is some additional complexity that needs to be understood before that is possible.
Details
Diff Detail
Event Timeline
include/llvm/DebugInfo/PDB/Raw/TpiStream.h | ||
---|---|---|
23 | This was the calling convention in the reference implementation, but you're right, as long as I control both ends it's not important. |
lgtm
include/llvm/DebugInfo/PDB/Raw/TpiStream.h | ||
---|---|---|
2 | Maybe this? "PDB Type Information (TPI) stream (stream 2) access" I was wondering what the mystery "P" was. | |
23 | Also, it won't compile on Linux. :) | |
25 | Doc comments here, with the acronym expansion as well would be good. | |
lib/DebugInfo/PDB/Raw/TpiStream.cpp | ||
26 | This is llvm::codeview::TypeIndex::FirstNonSimpleIndex. | |
96 | Check for failure here and on the getArrayRef, otherwise there's not much point to std::error_code |
lib/DebugInfo/PDB/Raw/TpiStream.cpp | ||
---|---|---|
96 | 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. |
lib/DebugInfo/PDB/Raw/TpiStream.cpp | ||
---|---|---|
96 | The getArrayRef could fail on an invalid type stream or if we get off track accidentally. Len - sizeof(Prefix.Leaf) could take us past the end of the stream. |
lib/DebugInfo/PDB/Raw/TpiStream.cpp | ||
---|---|---|
96 | Ahh fair point. We could have a corrupt PDB. |
Maybe this? "PDB Type Information (TPI) stream (stream 2) access"
I was wondering what the mystery "P" was.