summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Raw/TpiStreamBuilder.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-09-15 18:22:31 +0000
committerZachary Turner <zturner@google.com>2016-09-15 18:22:31 +0000
commitde9ba155115dc56c97e34bf1452bcfaf7b75a6ea (patch)
tree0dbb237f6c403a934c5b832fb839c42bc30a6986 /llvm/lib/DebugInfo/PDB/Raw/TpiStreamBuilder.cpp
parentd93c4c013736fe8e7d3264ac056c55c3e7450e47 (diff)
downloadbcm5719-llvm-de9ba155115dc56c97e34bf1452bcfaf7b75a6ea.tar.gz
bcm5719-llvm-de9ba155115dc56c97e34bf1452bcfaf7b75a6ea.zip
[pdb] Write the IPI stream.
The IPI stream is structurally identical to the TPI stream, but it contains different record types. So we just re-use the TPI writing code. llvm-svn: 281638
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/TpiStreamBuilder.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/TpiStreamBuilder.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/TpiStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/TpiStreamBuilder.cpp
index aa059387f6b..733efe882a2 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/TpiStreamBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/TpiStreamBuilder.cpp
@@ -15,8 +15,9 @@ using namespace llvm::msf;
using namespace llvm::pdb;
using namespace llvm::support;
-TpiStreamBuilder::TpiStreamBuilder(MSFBuilder &Msf)
- : Msf(Msf), Allocator(Msf.getAllocator()), Header(nullptr) {}
+TpiStreamBuilder::TpiStreamBuilder(MSFBuilder &Msf, uint32_t StreamIdx)
+ : Msf(Msf), Allocator(Msf.getAllocator()), Header(nullptr), Idx(StreamIdx) {
+}
TpiStreamBuilder::~TpiStreamBuilder() {}
@@ -75,7 +76,7 @@ uint32_t TpiStreamBuilder::calculateHashBufferSize() const {
Error TpiStreamBuilder::finalizeMsfLayout() {
uint32_t Length = calculateSerializedLength();
- if (auto EC = Msf.setStreamSize(StreamTPI, Length))
+ if (auto EC = Msf.setStreamSize(Idx, Length))
return EC;
uint32_t HashBufferSize = calculateHashBufferSize();
@@ -106,8 +107,8 @@ TpiStreamBuilder::build(PDBFile &File, const msf::WritableStream &Buffer) {
if (auto EC = finalize())
return std::move(EC);
- auto StreamData = MappedBlockStream::createIndexedStream(File.getMsfLayout(),
- Buffer, StreamTPI);
+ auto StreamData =
+ MappedBlockStream::createIndexedStream(File.getMsfLayout(), Buffer, Idx);
auto Tpi = llvm::make_unique<TpiStream>(File, std::move(StreamData));
Tpi->Header = Header;
Tpi->TypeRecords = VarStreamArray<codeview::CVType>(TypeRecordStream);
@@ -126,7 +127,7 @@ Error TpiStreamBuilder::commit(const msf::MSFLayout &Layout,
return EC;
auto InfoS =
- WritableMappedBlockStream::createIndexedStream(Layout, Buffer, StreamTPI);
+ WritableMappedBlockStream::createIndexedStream(Layout, Buffer, Idx);
StreamWriter Writer(*InfoS);
if (auto EC = Writer.writeObject(*Header))
OpenPOWER on IntegriCloud