1 //===- SymbolRecordMapping.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_DEBUGINFO_CODEVIEW_SYMBOLRECORDMAPPING_H 11 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORDMAPPING_H 12 13 #include "llvm/DebugInfo/CodeView/CodeViewRecordIO.h" 14 #include "llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h" 15 16 namespace llvm { 17 class BinaryStreamReader; 18 class BinaryStreamWriter; 19 20 namespace codeview { 21 class SymbolRecordMapping : public SymbolVisitorCallbacks { 22 public: SymbolRecordMapping(BinaryStreamReader & Reader,CodeViewContainer Container)23 explicit SymbolRecordMapping(BinaryStreamReader &Reader, 24 CodeViewContainer Container) 25 : IO(Reader), Container(Container) {} SymbolRecordMapping(BinaryStreamWriter & Writer,CodeViewContainer Container)26 explicit SymbolRecordMapping(BinaryStreamWriter &Writer, 27 CodeViewContainer Container) 28 : IO(Writer), Container(Container) {} 29 30 Error visitSymbolBegin(CVSymbol &Record) override; 31 Error visitSymbolEnd(CVSymbol &Record) override; 32 33 #define SYMBOL_RECORD(EnumName, EnumVal, Name) \ 34 Error visitKnownRecord(CVSymbol &CVR, Name &Record) override; 35 #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) 36 #include "llvm/DebugInfo/CodeView/CodeViewSymbols.def" 37 38 private: 39 Optional<SymbolKind> Kind; 40 41 CodeViewRecordIO IO; 42 CodeViewContainer Container; 43 }; 44 } 45 } 46 47 #endif 48