OSDN Git Service

Define calculateDbgStreamSize for consistency.
authorRui Ueyama <ruiu@google.com>
Sat, 29 Oct 2016 00:56:44 +0000 (00:56 +0000)
committerRui Ueyama <ruiu@google.com>
Sat, 29 Oct 2016 00:56:44 +0000 (00:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285487 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp

index 906f878..8e5b016 100644 (file)
@@ -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();
index 829bb3d..8604f98 100644 (file)
@@ -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);