]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/llvm-pdbutil/ExplainOutputStyle.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ release_70 branch
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / llvm-pdbutil / ExplainOutputStyle.h
1 //===- ExplainOutputStyle.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_EXPLAINOUTPUTSTYLE_H
11 #define LLVM_TOOLS_LLVMPDBDUMP_EXPLAINOUTPUTSTYLE_H
12
13 #include "LinePrinter.h"
14 #include "OutputStyle.h"
15
16 #include <string>
17
18 namespace llvm {
19
20 namespace pdb {
21
22 class DbiStream;
23 class InfoStream;
24 class InputFile;
25
26 class ExplainOutputStyle : public OutputStyle {
27
28 public:
29   ExplainOutputStyle(InputFile &File, uint64_t FileOffset);
30
31   Error dump() override;
32
33 private:
34   Error explainPdbFile();
35   Error explainBinaryFile();
36
37   bool explainPdbBlockStatus();
38
39   bool isPdbFpm1() const;
40   bool isPdbFpm2() const;
41
42   bool isPdbSuperBlock() const;
43   bool isPdbFpmBlock() const;
44   bool isPdbBlockMapBlock() const;
45   bool isPdbStreamDirectoryBlock() const;
46   Optional<uint32_t> getPdbBlockStreamIndex() const;
47
48   void explainPdbSuperBlockOffset();
49   void explainPdbFpmBlockOffset();
50   void explainPdbBlockMapOffset();
51   void explainPdbStreamDirectoryOffset();
52   void explainPdbStreamOffset(uint32_t Stream);
53   void explainPdbUnknownBlock();
54
55   void explainStreamOffset(DbiStream &Stream, uint32_t OffsetInStream);
56   void explainStreamOffset(InfoStream &Stream, uint32_t OffsetInStream);
57
58   uint32_t pdbBlockIndex() const;
59   uint32_t pdbBlockOffset() const;
60
61   InputFile &File;
62   const uint64_t FileOffset;
63   LinePrinter P;
64 };
65 } // namespace pdb
66 } // namespace llvm
67
68 #endif