1 //===- DumpOutputStyle.h -------------------------------------- *- C++ --*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_TOOLS_LLVMPDBDUMP_DUMPOUTPUTSTYLE_H
11 #define LLVM_TOOLS_LLVMPDBDUMP_DUMPOUTPUTSTYLE_H
13 #include "LinePrinter.h"
14 #include "OutputStyle.h"
15 #include "StreamUtil.h"
17 #include "llvm/ADT/DenseMap.h"
18 #include "llvm/ADT/Optional.h"
19 #include "llvm/ADT/SmallVector.h"
20 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
28 class LazyRandomTypeCollection;
39 struct StatCollection {
42 Stat(uint32_t Count, uint32_t Size) : Count(Count), Size(Size) {}
46 void update(uint32_t RecordSize) {
52 void update(uint32_t Kind, uint32_t RecordSize) {
53 Totals.update(RecordSize);
54 auto Iter = Individual.try_emplace(Kind, 1, RecordSize);
56 Iter.first->second.update(RecordSize);
59 DenseMap<uint32_t, Stat> Individual;
62 class DumpOutputStyle : public OutputStyle {
65 DumpOutputStyle(InputFile &File);
67 Error dump() override;
71 object::COFFObjectFile &getObj();
73 Error dumpFileSummary();
74 Error dumpStreamSummary();
75 Error dumpSymbolStats();
77 Error dumpStringTable();
79 Error dumpInlineeLines();
82 Error dumpTpiStream(uint32_t StreamIdx);
83 Error dumpTypesFromObjectFile();
85 Error dumpModuleFiles();
86 Error dumpModuleSymsForPdb();
87 Error dumpModuleSymsForObj();
90 Error dumpSymbolsFromGSI(const GSIHashTable &Table, bool HashExtras);
91 Error dumpSectionHeaders();
92 Error dumpSectionContribs();
93 Error dumpSectionMap();
95 void dumpSectionHeaders(StringRef Label, DbgHeaderType Type);
99 SmallVector<StreamInfo, 32> StreamPurposes;