]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/llvm-pdbdump/LLVMOutputStyle.h
Vendor import of llvm trunk r303571:
[FreeBSD/FreeBSD.git] / tools / llvm-pdbdump / LLVMOutputStyle.h
1 //===- LLVMOutputStyle.h -------------------------------------- *- C++ --*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_TOOLS_LLVMPDBDUMP_LLVMOUTPUTSTYLE_H
11 #define LLVM_TOOLS_LLVMPDBDUMP_LLVMOUTPUTSTYLE_H
12
13 #include "OutputStyle.h"
14
15 #include "llvm/ADT/Optional.h"
16 #include "llvm/ADT/SmallVector.h"
17 #include "llvm/DebugInfo/CodeView/TypeDatabase.h"
18 #include "llvm/Support/ScopedPrinter.h"
19
20 #include <string>
21
22 namespace llvm {
23 class BitVector;
24
25 namespace codeview {
26 class LazyRandomTypeCollection;
27 }
28
29 namespace pdb {
30 class LLVMOutputStyle : public OutputStyle {
31 public:
32   LLVMOutputStyle(PDBFile &File);
33
34   Error dump() override;
35
36 private:
37   Expected<codeview::LazyRandomTypeCollection &>
38   initializeTypeDatabase(uint32_t SN);
39
40   Error dumpFileHeaders();
41   Error dumpStreamSummary();
42   Error dumpFreePageMap();
43   Error dumpBlockRanges();
44   Error dumpGlobalsStream();
45   Error dumpStreamBytes();
46   Error dumpStreamBlocks();
47   Error dumpStringTable();
48   Error dumpInfoStream();
49   Error dumpTpiStream(uint32_t StreamIdx);
50   Error dumpDbiStream();
51   Error dumpSectionContribs();
52   Error dumpSectionMap();
53   Error dumpPublicsStream();
54   Error dumpSectionHeaders();
55   Error dumpFpoStream();
56
57   void dumpBitVector(StringRef Name, const BitVector &V);
58
59   void flush();
60
61   PDBFile &File;
62   ScopedPrinter P;
63   std::unique_ptr<codeview::LazyRandomTypeCollection> TpiTypes;
64   std::unique_ptr<codeview::LazyRandomTypeCollection> IpiTypes;
65   SmallVector<std::string, 32> StreamPurposes;
66 };
67 }
68 }
69
70 #endif