[pdb] Use MsfBuilder to handle the writing PDBs.

Previously we would read a PDB, then write some of it back out,
but write the directory, super block, and other pertinent metadata
back out unchanged.  This generates incorrect PDBs since the amount
of data written was not always the same as the amount of data read.

This patch changes things to use the newly introduced `MsfBuilder`
class to write out a correct and accurate set of Msf metadata for
the data *actually* written, which opens up the door for adding and
removing type records, symbol records, and other types of data to
an existing PDB.

llvm-svn: 275627
This commit is contained in:
Zachary Turner
2016-07-15 22:16:56 +00:00
parent 93be6e8c0a
commit faa554b2fd
26 changed files with 342 additions and 236 deletions

View File

@@ -101,7 +101,6 @@ Error LLVMOutputStyle::dumpFileHeaders() {
P.printNumber("Unknown1", File.getUnknown1());
P.printNumber("BlockMapAddr", File.getBlockMapIndex());
P.printNumber("NumDirectoryBlocks", File.getNumDirectoryBlocks());
P.printNumber("BlockMapOffset", File.getBlockMapOffset());
// The directory is not contiguous. Instead, the block map contains a
// contiguous list of block numbers whose contents, when concatenated in