blob: d9e9861d5b308e23d2b391b3141d44a3eb60cc09 [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 Turnerf401e112017-08-17 20:04:31 +000028 : P(P), RecordBytes(RecordBytes), 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 Turnerf401e112017-08-17 20:04:31 +000047 bool RecordBytes;
Zachary Turner59e3ae82017-08-08 18:34:44 +000048 codeview::LazyRandomTypeCollection &Ids;
Zachary Turner63055452017-06-15 22:24:24 +000049 codeview::LazyRandomTypeCollection &Types;
50};
51} // namespace pdb
52} // namespace llvm
53
54#endif