blob: 386f6156a8912688ffa9ce53f86759f1ed1fd81b [file] [log] [blame]
Zachary Turnerea40f402018-03-29 16:28:20 +00001//===- 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
18namespace llvm {
19
20namespace pdb {
21
22class PDBFile;
23
24class ExplainOutputStyle : public OutputStyle {
25
26public:
27 ExplainOutputStyle(PDBFile &File, uint64_t FileOffset);
28
29 Error dump() override;
30
31private:
32 bool explainBlockStatus();
33
34 bool isFpm1() const;
35 bool isFpm2() const;
36
37 bool isSuperBlock() const;
38 bool isFpmBlock() const;
39 bool isBlockMapBlock() const;
40 bool isStreamDirectoryBlock() const;
41 Optional<uint32_t> getBlockStreamIndex() const;
42
43 void explainSuperBlockOffset();
44 void explainFpmBlockOffset();
45 void explainBlockMapOffset();
46 void explainStreamDirectoryOffset();
47 void explainStreamOffset(uint32_t Stream);
48 void explainUnknownBlock();
49
50 PDBFile &File;
51 const uint64_t FileOffset;
52 const uint64_t BlockIndex;
53 const uint64_t OffsetInBlock;
54 LinePrinter P;
55};
56} // namespace pdb
57} // namespace llvm
58
59#endif