diff options
author | Rui Ueyama <ruiu@google.com> | 2016-10-29 00:56:44 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2016-10-29 00:56:44 +0000 |
commit | 77be2403f6f2eec0d6c40f035597e5b524df1cff (patch) | |
tree | 8ca5ed6e8691adcbcf2f5c541892aba3928a12a9 | |
parent | 1bab9cfbe5b0ac0bcc6b33967dc2a20c891716f3 (diff) | |
download | llvm-77be2403f6f2eec0d6c40f035597e5b524df1cff.tar.gz |
Define calculateDbgStreamSize for consistency.
llvm-svn: 285487
-rw-r--r-- | llvm/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h | 1 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/llvm/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h index 906f878224a5..8e5b01676cff 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h +++ b/llvm/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h @@ -70,6 +70,7 @@ private: uint32_t calculateModiSubstreamSize() const; uint32_t calculateFileInfoSubstreamSize() const; uint32_t calculateNamesBufferSize() const; + uint32_t calculateDbgStreamsSize() const; Error generateModiSubstream(); Error generateFileInfoSubstream(); diff --git a/llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp index 829bb3d4b3cf..8604f982cb75 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp @@ -61,7 +61,7 @@ Error DbiStreamBuilder::addDbgStream(pdb::DbgHeaderType Type, uint32_t DbiStreamBuilder::calculateSerializedLength() const { // For now we only support serializing the header. return sizeof(DbiStreamHeader) + calculateFileInfoSubstreamSize() + - calculateModiSubstreamSize() + DbgStreams.size() * sizeof(uint16_t); + calculateModiSubstreamSize() + calculateDbgStreamsSize(); } Error DbiStreamBuilder::addModuleInfo(StringRef ObjFile, StringRef Module) { @@ -121,6 +121,10 @@ uint32_t DbiStreamBuilder::calculateNamesBufferSize() const { return Size; } +uint32_t DbiStreamBuilder::calculateDbgStreamsSize() const { + return DbgStreams.size() * sizeof(uint16_t); +} + Error DbiStreamBuilder::generateModiSubstream() { uint32_t Size = calculateModiSubstreamSize(); auto Data = Allocator.Allocate<uint8_t>(Size); |