LLVM  4.0.0
SymbolVisitorCallbacks.h
Go to the documentation of this file.
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 
14 #include "llvm/Support/Error.h"
15 
16 namespace llvm {
17 namespace codeview {
18 
20  friend class CVSymbolVisitor;
21 
22 public:
23  virtual ~SymbolVisitorCallbacks() = default;
24 
25  /// Action to take on unknown symbols. By default, they are ignored.
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.
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
virtual Error visitUnknownSymbol(CVSymbol &Record)
Action to take on unknown symbols. By default, they are ignored.
virtual Error visitSymbolEnd(CVSymbol &Record)
static ErrorSuccess success()
Create a success value.
Lightweight error class with error context and mandatory checking.
virtual Error visitSymbolBegin(CVSymbol &Record)
Paired begin/end actions for all symbols.