From: Zachary Turner Date: Wed, 6 Dec 2017 00:26:43 +0000 (+0000) Subject: Fix error in llvm-pdbutil. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6f5a8c1da8c218659304d940dba59dea7ede471;p=llvm Fix error in llvm-pdbutil. A recent change made this print the wrong value, breaking some tests. This is now fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319862 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-pdbutil/DumpOutputStyle.cpp b/tools/llvm-pdbutil/DumpOutputStyle.cpp index 84355e7bd2e..710e0348481 100644 --- a/tools/llvm-pdbutil/DumpOutputStyle.cpp +++ b/tools/llvm-pdbutil/DumpOutputStyle.cpp @@ -923,12 +923,12 @@ static void buildDepSet(LazyRandomTypeCollection &Types, static void dumpFullTypeStream(LinePrinter &Printer, LazyRandomTypeCollection &Types, - uint32_t NumHashBuckets, + uint32_t NumTypeRecords, uint32_t NumHashBuckets, FixedStreamArray HashValues, bool Bytes, bool Extras) { - Printer.formatLine("Showing {0:N} records", Types.size()); - uint32_t Width = NumDigits(TypeIndex::FirstNonSimpleIndex + Types.size()); + Printer.formatLine("Showing {0:N} records", NumTypeRecords); + uint32_t Width = NumDigits(TypeIndex::FirstNonSimpleIndex + NumTypeRecords); MinimalTypeDumpVisitor V(Printer, Width + 2, Bytes, Extras, Types, NumHashBuckets, HashValues); @@ -1002,7 +1002,7 @@ Error DumpOutputStyle::dumpTypesFromObjectFile() { Types.reset(Reader, 100); if (opts::dump::DumpTypes) { - dumpFullTypeStream(P, Types, 0, {}, opts::dump::DumpTypeData, false); + dumpFullTypeStream(P, Types, 0, 0, {}, opts::dump::DumpTypeData, false); } else if (opts::dump::DumpTypeExtras) { auto LocalHashes = LocallyHashedType::hashTypeCollection(Types); auto GlobalHashes = GloballyHashedType::hashTypeCollection(Types); @@ -1073,8 +1073,9 @@ Error DumpOutputStyle::dumpTpiStream(uint32_t StreamIdx) { if (DumpTypes || !Indices.empty()) { if (Indices.empty()) - dumpFullTypeStream(P, Types, Stream.getNumHashBuckets(), - Stream.getHashValues(), DumpBytes, DumpExtras); + dumpFullTypeStream(P, Types, Stream.getNumTypeRecords(), + Stream.getNumHashBuckets(), Stream.getHashValues(), + DumpBytes, DumpExtras); else { std::vector TiList(Indices.begin(), Indices.end()); dumpPartialTypeStream(P, Types, Stream, TiList, DumpBytes, DumpExtras,