summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
index 49bcb2f7dfe..5007a56f276 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
@@ -58,8 +58,7 @@ DbiStreamBuilder &PDBFileBuilder::getDbiBuilder() {
return *Dbi;
}
-Expected<std::unique_ptr<PDBFile>>
-PDBFileBuilder::build(std::unique_ptr<msf::StreamInterface> PdbFileBuffer) {
+Expected<msf::Layout> PDBFileBuilder::finalizeMsfLayout() const {
if (Info) {
uint32_t Length = Info->calculateSerializedLength();
if (auto EC = Msf->setStreamSize(StreamPDB, Length))
@@ -71,7 +70,12 @@ PDBFileBuilder::build(std::unique_ptr<msf::StreamInterface> PdbFileBuffer) {
return std::move(EC);
}
- auto ExpectedLayout = Msf->build();
+ return Msf->build();
+}
+
+Expected<std::unique_ptr<PDBFile>>
+PDBFileBuilder::build(std::unique_ptr<msf::StreamInterface> PdbFileBuffer) {
+ auto ExpectedLayout = finalizeMsfLayout();
if (!ExpectedLayout)
return ExpectedLayout.takeError();
OpenPOWER on IntegriCloud