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/DebugInfo/CodeView/TypeRecord.h"
14 #include "llvm/Support/Error.h"
19 class TypeVisitorCallbacks {
20 friend class CVTypeVisitor;
23 virtual ~TypeVisitorCallbacks() = default;
25 /// Action to take on unknown types. By default, they are ignored.
26 virtual Error visitUnknownType(CVType &Record) { return Error::success(); }
27 /// Paired begin/end actions for all types. Receives all record data,
28 /// including the fixed-length record prefix. visitTypeBegin() should return
29 /// the type of the Record, or an error if it cannot be determined.
30 virtual Error visitTypeBegin(CVType &Record) { return Error::success(); }
31 virtual Error visitTypeEnd(CVType &Record) { return Error::success(); }
33 virtual Error visitUnknownMember(CVMemberRecord &Record) {
34 return Error::success();
37 virtual Error visitMemberBegin(CVMemberRecord &Record) {
38 return Error::success();
41 virtual Error visitMemberEnd(CVMemberRecord &Record) {
42 return Error::success();
45 #define TYPE_RECORD(EnumName, EnumVal, Name) \
46 virtual Error visitKnownRecord(CVType &CVR, Name##Record &Record) { \
47 return Error::success(); \
49 #define MEMBER_RECORD(EnumName, EnumVal, Name) \
50 virtual Error visitKnownMember(CVMemberRecord &CVM, Name##Record &Record) { \
51 return Error::success(); \
54 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
55 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
56 #include "TypeRecords.def"
59 } // end namespace codeview
60 } // end namespace llvm
62 #endif // LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H