1 //===- SymbolVisitorCallbacks.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_SYMBOLVISITORCALLBACKS_H 11 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLVISITORCALLBACKS_H 12 13 #include "llvm/DebugInfo/CodeView/SymbolRecord.h" 14 #include "llvm/Support/Error.h" 15 16 namespace llvm { 17 namespace codeview { 18 19 class SymbolVisitorCallbacks { 20 friend class CVSymbolVisitor; 21 22 public: 23 virtual ~SymbolVisitorCallbacks() = default; 24 25 /// Action to take on unknown symbols. By default, they are ignored. visitUnknownSymbol(CVSymbol & Record)26 virtual Error visitUnknownSymbol(CVSymbol &Record) { 27 return Error::success(); 28 } 29 30 /// Paired begin/end actions for all symbols. Receives all record data, 31 /// including the fixed-length record prefix. visitSymbolBegin() should 32 /// return the type of the Symbol, or an error if it cannot be determined. visitSymbolBegin(CVSymbol & Record,uint32_t Offset)33 virtual Error visitSymbolBegin(CVSymbol &Record, uint32_t Offset) { 34 return Error::success(); 35 } visitSymbolBegin(CVSymbol & Record)36 virtual Error visitSymbolBegin(CVSymbol &Record) { return Error::success(); } visitSymbolEnd(CVSymbol & Record)37 virtual Error visitSymbolEnd(CVSymbol &Record) { return Error::success(); } 38 39 #define SYMBOL_RECORD(EnumName, EnumVal, Name) \ 40 virtual Error visitKnownRecord(CVSymbol &CVR, Name &Record) { \ 41 return Error::success(); \ 42 } 43 #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) 44 #include "llvm/DebugInfo/CodeView/CodeViewSymbols.def" 45 }; 46 47 } // end namespace codeview 48 } // end namespace llvm 49 50 #endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLVISITORCALLBACKS_H 51