diff options
author | Zachary Turner <zturner@google.com> | 2017-01-20 22:41:40 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-01-20 22:41:40 +0000 |
commit | 60667ca0b2b95ee25dace3f8627feda5a904cd8f (patch) | |
tree | 7ae0305c1b0d65822ea70a49204ed35020c79092 /llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp | |
parent | f04d6e8d52719d64dddd95e86577d61ad1f4f074 (diff) | |
download | bcm5719-llvm-60667ca0b2b95ee25dace3f8627feda5a904cd8f.tar.gz bcm5719-llvm-60667ca0b2b95ee25dace3f8627feda5a904cd8f.zip |
[pdb] Merge NamedStreamMapBuilder and NamedStreamMap.
While the builder pattern has proven useful for certain other
larger types, in this case it was hampering the ability to use
the data structure, as for runtime access we need a map that
we can efficiently read from and write to. So the two are merged
into a single data structure that can efficiently be read to,
written from, deserialized from bytes, and serialized to bytes.
llvm-svn: 292664
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp index 50539658819..4485c83dc05 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp @@ -32,16 +32,12 @@ void InfoStreamBuilder::setAge(uint32_t A) { Age = A; } void InfoStreamBuilder::setGuid(PDB_UniqueId G) { Guid = G; } -NamedStreamMapBuilder &InfoStreamBuilder::getNamedStreamsBuilder() { +NamedStreamMap &InfoStreamBuilder::getNamedStreamsBuilder() { return NamedStreams; } -uint32_t InfoStreamBuilder::calculateSerializedLength() const { - return sizeof(InfoStreamHeader) + NamedStreams.calculateSerializedLength(); -} - Error InfoStreamBuilder::finalizeMsfLayout() { - uint32_t Length = calculateSerializedLength(); + uint32_t Length = sizeof(InfoStreamHeader) + NamedStreams.finalize(); if (auto EC = Msf.setStreamSize(StreamPDB, Length)) return EC; return Error::success(); |