[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / tools / llvm-pdbutil / DumpOutputStyle.h
bloba0c9530cea99b44b1c527beec4017679443a8f44
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 "OutputStyle.h"
13 #include "StreamUtil.h"
15 #include "llvm/ADT/DenseMap.h"
16 #include "llvm/ADT/SmallVector.h"
17 #include "llvm/DebugInfo/PDB/Native/LinePrinter.h"
18 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
20 #include <string>
22 namespace llvm {
23 namespace object {
24 class COFFObjectFile;
27 namespace pdb {
28 class GSIHashTable;
29 class InputFile;
30 class TypeReferenceTracker;
32 struct StatCollection {
33 struct Stat {
34 Stat() {}
35 Stat(uint32_t Count, uint32_t Size) : Count(Count), Size(Size) {}
36 uint32_t Count = 0;
37 uint32_t Size = 0;
39 void update(uint32_t RecordSize) {
40 ++Count;
41 Size += RecordSize;
45 using KindAndStat = std::pair<uint32_t, Stat>;
47 void update(uint32_t Kind, uint32_t RecordSize) {
48 Totals.update(RecordSize);
49 auto Iter = Individual.try_emplace(Kind, 1, RecordSize);
50 if (!Iter.second)
51 Iter.first->second.update(RecordSize);
53 Stat Totals;
54 DenseMap<uint32_t, Stat> Individual;
56 std::vector<KindAndStat> getStatsSortedBySize() const;
59 class DumpOutputStyle : public OutputStyle {
61 public:
62 DumpOutputStyle(InputFile &File);
63 ~DumpOutputStyle() override;
65 Error dump() override;
67 private:
68 PDBFile &getPdb();
69 object::COFFObjectFile &getObj();
71 void printStreamNotValidForObj();
72 void printStreamNotPresent(StringRef StreamName);
74 Error dumpFileSummary();
75 Error dumpStreamSummary();
76 Error dumpSymbolStats();
77 Error dumpUdtStats();
78 Error dumpTypeStats();
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 dumpTypeRefStats();
93 Error dumpModules();
94 Error dumpModuleFiles();
95 Error dumpModuleSymsForPdb();
96 Error dumpModuleSymsForObj();
97 Error dumpGSIRecords();
98 Error dumpGlobals();
99 Error dumpPublics();
100 Error dumpSymbolsFromGSI(const GSIHashTable &Table, bool HashExtras);
101 Error dumpSectionHeaders();
102 Error dumpSectionContribs();
103 Error dumpSectionMap();
105 void dumpSectionHeaders(StringRef Label, DbgHeaderType Type);
107 InputFile &File;
108 std::unique_ptr<TypeReferenceTracker> RefTracker;
109 LinePrinter P;
110 SmallVector<StreamInfo, 32> StreamPurposes;
112 } // namespace pdb
113 } // namespace llvm
115 #endif