Do not pass a superblock to PDBFileBuilder.
authorRui Ueyama <ruiu@google.com>
Fri, 30 Sep 2016 20:52:12 +0000 (20:52 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 30 Sep 2016 20:52:12 +0000 (20:52 +0000)
commit5d6714e59313a5fc83a0475b17dbb40dffd2a3f6
tree7974f24bb0f4f0fac180c5be78405d39cd4b14ec
parent9c2cd9aadc827875cdb58b281e2475908afb5576
Do not pass a superblock to PDBFileBuilder.

When we create a PDB file using PDBFileBuilder, the information
in the superblock, such as the size of the resulting file, is not
available.

Previously, PDBFileBuilder::initialize took a superblock assuming
that all the members of the struct are correct. That is useful when
you want to restore the exact information from a YAML file, but
that's probably the only use case in which that is useful.
When we are creating a PDB file on the fly, we have to backfill the
members.

This patch redefines PDBFileBuilder::initialize to take only a
block size. Now all the other members are left as default values,
so that they'll be updated when commit() is called.

Differential Revision: https://reviews.llvm.org/D25108

llvm-svn: 282944
llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h
llvm/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h
llvm/lib/DebugInfo/MSF/MSFBuilder.cpp
llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
llvm/test/DebugInfo/PDB/pdbdump-readwrite.test
llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp