1 //===- TypeVisitorCallbacks.h -----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H
11 #define LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/DebugInfo/CodeView/CodeView.h"
15 #include "llvm/DebugInfo/CodeView/CVRecord.h"
16 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
17 #include "llvm/Support/Error.h"
21 class TypeVisitorCallbacks {
22 friend class CVTypeVisitor;
25 virtual ~TypeVisitorCallbacks() {}
27 /// Action to take on unknown types. By default, they are ignored.
28 virtual Error visitUnknownType(const CVRecord<TypeLeafKind> &Record) {
29 return Error::success();
31 virtual Error visitUnknownMember(const CVRecord<TypeLeafKind> &Record) {
32 return Error::success();
35 /// Paired begin/end actions for all types. Receives all record data,
36 /// including the fixed-length record prefix.
37 virtual Error visitTypeBegin(const CVRecord<TypeLeafKind> &Record) {
38 return Error::success();
40 virtual Error visitTypeEnd(const CVRecord<TypeLeafKind> &Record) {
41 return Error::success();
44 virtual Error visitFieldListBegin(const CVRecord<TypeLeafKind> &Record) {
45 return Error::success();
48 virtual Error visitFieldListEnd(const CVRecord<TypeLeafKind> &Record) {
49 return Error::success();
52 #define TYPE_RECORD(EnumName, EnumVal, Name) \
53 virtual Error visit##Name(Name##Record &Record) { return Error::success(); }
54 #define MEMBER_RECORD(EnumName, EnumVal, Name) \
55 TYPE_RECORD(EnumName, EnumVal, Name)
56 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
57 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
58 #include "TypeRecords.def"