[lit] Remove LitTestCase
[llvm-complete.git] / tools / llvm-pdbutil / DumpOutputStyle.h
blobc95490e95df43823b14bcdf26421875d2554aa73
1 //===- DumpOutputStyle.h -------------------------------------- *- C++ --*-===//
2 //
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
6 //
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"
21 #include <string>
23 namespace llvm {
24 class BitVector;
26 namespace codeview {
27 class LazyRandomTypeCollection;
30 namespace object {
31 class COFFObjectFile;
34 namespace pdb {
35 class GSIHashTable;
36 class InputFile;
38 struct StatCollection {
39 struct Stat {
40 Stat() {}
41 Stat(uint32_t Count, uint32_t Size) : Count(Count), Size(Size) {}
42 uint32_t Count = 0;
43 uint32_t Size = 0;
45 void update(uint32_t RecordSize) {
46 ++Count;
47 Size += RecordSize;
51 void update(uint32_t Kind, uint32_t RecordSize) {
52 Totals.update(RecordSize);
53 auto Iter = Individual.try_emplace(Kind, 1, RecordSize);
54 if (!Iter.second)
55 Iter.first->second.update(RecordSize);
57 Stat Totals;
58 DenseMap<uint32_t, Stat> Individual;
61 class DumpOutputStyle : public OutputStyle {
63 public:
64 DumpOutputStyle(InputFile &File);
66 Error dump() override;
68 private:
69 PDBFile &getPdb();
70 object::COFFObjectFile &getObj();
72 void printStreamNotValidForObj();
73 void printStreamNotPresent(StringRef StreamName);
75 Error dumpFileSummary();
76 Error dumpStreamSummary();
77 Error dumpSymbolStats();
78 Error dumpUdtStats();
79 Error dumpNamedStreams();
80 Error dumpStringTable();
81 Error dumpStringTableFromPdb();
82 Error dumpStringTableFromObj();
83 Error dumpLines();
84 Error dumpInlineeLines();
85 Error dumpXmi();
86 Error dumpXme();
87 Error dumpFpo();
88 Error dumpOldFpo(PDBFile &File);
89 Error dumpNewFpo(PDBFile &File);
90 Error dumpTpiStream(uint32_t StreamIdx);
91 Error dumpTypesFromObjectFile();
92 Error dumpModules();
93 Error dumpModuleFiles();
94 Error dumpModuleSymsForPdb();
95 Error dumpModuleSymsForObj();
96 Error dumpGSIRecords();
97 Error dumpGlobals();
98 Error dumpPublics();
99 Error dumpSymbolsFromGSI(const GSIHashTable &Table, bool HashExtras);
100 Error dumpSectionHeaders();
101 Error dumpSectionContribs();
102 Error dumpSectionMap();
104 void dumpSectionHeaders(StringRef Label, DbgHeaderType Type);
106 InputFile &File;
107 LinePrinter P;
108 SmallVector<StreamInfo, 32> StreamPurposes;
110 } // namespace pdb
111 } // namespace llvm
113 #endif