MinimalSymbolDumper.h revision 327952
1//===- MinimalSymbolDumper.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_LLVMPDBUTIL_MINIMAL_SYMBOL_DUMPER_H
11#define LLVM_TOOLS_LLVMPDBUTIL_MINIMAL_SYMBOL_DUMPER_H
12
13#include "llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h"
14
15namespace llvm {
16namespace codeview {
17class LazyRandomTypeCollection;
18}
19
20namespace pdb {
21class LinePrinter;
22
23class MinimalSymbolDumper : public codeview::SymbolVisitorCallbacks {
24public:
25  MinimalSymbolDumper(LinePrinter &P, bool RecordBytes,
26                      codeview::LazyRandomTypeCollection &Ids,
27                      codeview::LazyRandomTypeCollection &Types)
28      : P(P), RecordBytes(RecordBytes), Ids(Ids), Types(Types) {}
29
30  Error visitSymbolBegin(codeview::CVSymbol &Record) override;
31  Error visitSymbolBegin(codeview::CVSymbol &Record, uint32_t Offset) override;
32  Error visitSymbolEnd(codeview::CVSymbol &Record) override;
33
34#define SYMBOL_RECORD(EnumName, EnumVal, Name)                                 \
35  virtual Error visitKnownRecord(codeview::CVSymbol &CVR,                      \
36                                 codeview::Name &Record) override;
37#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
38#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
39
40private:
41  std::string typeOrIdIndex(codeview::TypeIndex TI, bool IsType) const;
42
43  std::string typeIndex(codeview::TypeIndex TI) const;
44  std::string idIndex(codeview::TypeIndex TI) const;
45
46  LinePrinter &P;
47  bool RecordBytes;
48  codeview::LazyRandomTypeCollection &Ids;
49  codeview::LazyRandomTypeCollection &Types;
50};
51} // namespace pdb
52} // namespace llvm
53
54#endif