Define calculateDbgStreamSize for consistency.

llvm-svn: 285487
This commit is contained in:
Rui Ueyama 2016-10-29 00:56:44 +00:00
parent 1bab9cfbe5
commit 77be2403f6
2 changed files with 6 additions and 1 deletions

View 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();

View 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);