blob: a140af74b694a9e19b55abbdb0451c552e364ccb [file] [log] [blame]
Zachary Turner63055452017-06-15 22:24:24 +00001//===- 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,
Zachary Turner59e3ae82017-08-08 18:34:44 +000026 codeview::LazyRandomTypeCollection &Ids,
Zachary Turner63055452017-06-15 22:24:24 +000027 codeview::LazyRandomTypeCollection &Types)
Zachary Turner59e3ae82017-08-08 18:34:44 +000028 : P(P), Ids(Ids), Types(Types) {}
Zachary Turner63055452017-06-15 22:24:24 +000029
30 Error visitSymbolBegin(codeview::CVSymbol &Record) override;
Zachary Turneraf8c75a2017-06-30 21:35:00 +000031 Error visitSymbolBegin(codeview::CVSymbol &Record, uint32_t Offset) override;
Zachary Turner63055452017-06-15 22:24:24 +000032 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:
Zachary Turner59e3ae82017-08-08 18:34:44 +000041 std::string typeOrIdIndex(codeview::TypeIndex TI, bool IsType) const;
42
Zachary Turner63055452017-06-15 22:24:24 +000043 std::string typeIndex(codeview::TypeIndex TI) const;
Zachary Turner59e3ae82017-08-08 18:34:44 +000044 std::string idIndex(codeview::TypeIndex TI) const;
Zachary Turner63055452017-06-15 22:24:24 +000045
46 LinePrinter &P;
Zachary Turner59e3ae82017-08-08 18:34:44 +000047 codeview::LazyRandomTypeCollection &Ids;
Zachary Turner63055452017-06-15 22:24:24 +000048 codeview::LazyRandomTypeCollection &Types;
49};
50} // namespace pdb
51} // namespace llvm
52
53#endif