Pass a filename instead of a msf::WritableStream to PDBFileBuilder::commit.
authorRui Ueyama <ruiu@google.com>
Fri, 30 Sep 2016 20:34:44 +0000 (20:34 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 30 Sep 2016 20:34:44 +0000 (20:34 +0000)
commitfc22cef98ed96ac3aa471b66315ebc54e3421762
tree1fbfa0bf268c529479a2109968b575f013e20044
parente2d19c3d1e97ac4796b418abc9a26751fd932029
Pass a filename instead of a msf::WritableStream to PDBFileBuilder::commit.

WritableStream needs the exact file size to open a file, but
until we fix the final layout of a PDB file, we don't know the
size of the file.

This patch changes the parameter type of PDBFileBuilder::commit
to solve that chiecken-and-egg problem. Now the function opens
a file after fixing the layout, so it can create a file with the
exact size.

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

llvm-svn: 282940
llvm/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h
llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp