Zachary Turner | 6305545 | 2017-06-15 22:24:24 +0000 | [diff] [blame] | 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 | |
| 15 | namespace llvm { |
| 16 | namespace codeview { |
| 17 | class LazyRandomTypeCollection; |
| 18 | } |
| 19 | |
| 20 | namespace pdb { |
| 21 | class LinePrinter; |
| 22 | |
| 23 | class MinimalSymbolDumper : public codeview::SymbolVisitorCallbacks { |
| 24 | public: |
| 25 | MinimalSymbolDumper(LinePrinter &P, bool RecordBytes, |
Zachary Turner | 59e3ae8 | 2017-08-08 18:34:44 +0000 | [diff] [blame^] | 26 | codeview::LazyRandomTypeCollection &Ids, |
Zachary Turner | 6305545 | 2017-06-15 22:24:24 +0000 | [diff] [blame] | 27 | codeview::LazyRandomTypeCollection &Types) |
Zachary Turner | 59e3ae8 | 2017-08-08 18:34:44 +0000 | [diff] [blame^] | 28 | : P(P), Ids(Ids), Types(Types) {} |
Zachary Turner | 6305545 | 2017-06-15 22:24:24 +0000 | [diff] [blame] | 29 | |
| 30 | Error visitSymbolBegin(codeview::CVSymbol &Record) override; |
Zachary Turner | af8c75a | 2017-06-30 21:35:00 +0000 | [diff] [blame] | 31 | Error visitSymbolBegin(codeview::CVSymbol &Record, uint32_t Offset) override; |
Zachary Turner | 6305545 | 2017-06-15 22:24:24 +0000 | [diff] [blame] | 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 | |
| 40 | private: |
Zachary Turner | 59e3ae8 | 2017-08-08 18:34:44 +0000 | [diff] [blame^] | 41 | std::string typeOrIdIndex(codeview::TypeIndex TI, bool IsType) const; |
| 42 | |
Zachary Turner | 6305545 | 2017-06-15 22:24:24 +0000 | [diff] [blame] | 43 | std::string typeIndex(codeview::TypeIndex TI) const; |
Zachary Turner | 59e3ae8 | 2017-08-08 18:34:44 +0000 | [diff] [blame^] | 44 | std::string idIndex(codeview::TypeIndex TI) const; |
Zachary Turner | 6305545 | 2017-06-15 22:24:24 +0000 | [diff] [blame] | 45 | |
| 46 | LinePrinter &P; |
Zachary Turner | 59e3ae8 | 2017-08-08 18:34:44 +0000 | [diff] [blame^] | 47 | codeview::LazyRandomTypeCollection &Ids; |
Zachary Turner | 6305545 | 2017-06-15 22:24:24 +0000 | [diff] [blame] | 48 | codeview::LazyRandomTypeCollection &Types; |
| 49 | }; |
| 50 | } // namespace pdb |
| 51 | } // namespace llvm |
| 52 | |
| 53 | #endif |