1 //===- DumpOutputStyle.h -------------------------------------- *- C++ --*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_LLVMPDBDUMP_DUMPOUTPUTSTYLE_H
10 #define LLVM_TOOLS_LLVMPDBDUMP_DUMPOUTPUTSTYLE_H
12 #include "LinePrinter.h"
13 #include "OutputStyle.h"
14 #include "StreamUtil.h"
16 #include "llvm/ADT/DenseMap.h"
17 #include "llvm/ADT/Optional.h"
18 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
27 class LazyRandomTypeCollection
;
38 struct StatCollection
{
41 Stat(uint32_t Count
, uint32_t Size
) : Count(Count
), Size(Size
) {}
45 void update(uint32_t RecordSize
) {
51 void update(uint32_t Kind
, uint32_t RecordSize
) {
52 Totals
.update(RecordSize
);
53 auto Iter
= Individual
.try_emplace(Kind
, 1, RecordSize
);
55 Iter
.first
->second
.update(RecordSize
);
58 DenseMap
<uint32_t, Stat
> Individual
;
61 class DumpOutputStyle
: public OutputStyle
{
64 DumpOutputStyle(InputFile
&File
);
66 Error
dump() override
;
70 object::COFFObjectFile
&getObj();
72 void printStreamNotValidForObj();
73 void printStreamNotPresent(StringRef StreamName
);
75 Error
dumpFileSummary();
76 Error
dumpStreamSummary();
77 Error
dumpSymbolStats();
79 Error
dumpNamedStreams();
80 Error
dumpStringTable();
81 Error
dumpStringTableFromPdb();
82 Error
dumpStringTableFromObj();
84 Error
dumpInlineeLines();
88 Error
dumpOldFpo(PDBFile
&File
);
89 Error
dumpNewFpo(PDBFile
&File
);
90 Error
dumpTpiStream(uint32_t StreamIdx
);
91 Error
dumpTypesFromObjectFile();
93 Error
dumpModuleFiles();
94 Error
dumpModuleSymsForPdb();
95 Error
dumpModuleSymsForObj();
96 Error
dumpGSIRecords();
99 Error
dumpSymbolsFromGSI(const GSIHashTable
&Table
, bool HashExtras
);
100 Error
dumpSectionHeaders();
101 Error
dumpSectionContribs();
102 Error
dumpSectionMap();
104 void dumpSectionHeaders(StringRef Label
, DbgHeaderType Type
);
108 SmallVector
<StreamInfo
, 32> StreamPurposes
;