llvm/lib/DebugInfo
Zachary Turner 6e00ec14d5 [pdb] Use MappedBlockStream to parse the PDB directory.
In order to efficiently write PDBs, we need to be able to make a
StreamWriter class similar to a StreamReader, which can transparently deal
with writing to discontiguous streams, and we need to use this for all
writing, similar to how we use StreamReader for all reading.

Most discontiguous streams are the typical numbered streams that appear in
a PDB file and are described by the directory, but the exception to this,
that until now has been parsed by hand, is the directory itself.
MappedBlockStream works by querying the directory to find out which blocks
a stream occupies and various other things, so naturally the same logic
could not possibly work to describe the blocks that the directory itself
resided on.

To solve this, I've introduced an abstraction IPDBStreamData, which allows
the client to query for the list of blocks occupied by the stream, as well
as the stream length. I provide two implementations of this: one which
queries the directory (for indexed streams), and one which queries the
super block (for the directory stream).

This has the side benefit of vastly simplifying the code to parse the
directory. Whereas before a mini state machine was rolled by hand, now we
simply use FixedStreamArray to read out the stream sizes, then build a
vector of FixedStreamArrays for the stream map, all in just a few lines of
code.

Reviewed By: ruiu
Differential Revision: http://reviews.llvm.org/D21046

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271982 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 05:28:55 +00:00
..
CodeView [CodeView] Fix a busted assert in TypeTableBuilder::writeClass 2016-06-04 15:40:31 +00:00
DWARF Apply clang-tidy's misc-move-constructor-init throughout LLVM. 2016-05-27 14:27:24 +00:00
PDB [pdb] Use MappedBlockStream to parse the PDB directory. 2016-06-07 05:28:55 +00:00
Symbolize Try one more time to pacify -Wpessimizing-move, MSVC, libstdc++4.7, and the world without a named variable 2016-06-06 23:46:14 +00:00
CMakeLists.txt LLVM CodeView library 2015-12-24 18:12:38 +00:00
LLVMBuild.txt LLVM CodeView library 2015-12-24 18:12:38 +00:00