Home | History | Annotate | Download | only in CodeView
      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.
     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
     33   /// the type of the Symbol, or an error if it cannot be determined.
     34   virtual Error visitSymbolBegin(CVSymbol &Record) { return Error::success(); }
     35   virtual Error visitSymbolEnd(CVSymbol &Record) { return Error::success(); }
     36 
     37 #define SYMBOL_RECORD(EnumName, EnumVal, Name)                                 \
     38   virtual Error visitKnownRecord(CVSymbol &CVR, Name &Record) {                \
     39     return Error::success();                                                   \
     40   }
     41 #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
     42 #include "CVSymbolTypes.def"
     43 };
     44 
     45 } // end namespace codeview
     46 } // end namespace llvm
     47 
     48 #endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLVISITORCALLBACKS_H
     49