LLVM  8.0.1
TypeVisitorCallbacks.h
Go to the documentation of this file.
1 //===- TypeVisitorCallbacks.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_TYPEVISITORCALLBACKS_H
11 #define LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H
12 
14 #include "llvm/Support/Error.h"
15 
16 namespace llvm {
17 namespace codeview {
18 
20 public:
21  virtual ~TypeVisitorCallbacks() = default;
22 
23  /// Action to take on unknown types. By default, they are ignored.
25  /// Paired begin/end actions for all types. Receives all record data,
26  /// including the fixed-length record prefix. visitTypeBegin() should return
27  /// the type of the Record, or an error if it cannot be determined. Exactly
28  /// one of the two visitTypeBegin methods will be called, depending on whether
29  /// records are being visited sequentially or randomly. An implementation
30  /// should be prepared to handle both (or assert if it can't handle random
31  /// access visitation).
34  return Error::success();
35  }
36  virtual Error visitTypeEnd(CVType &Record) { return Error::success(); }
37 
39  return Error::success();
40  }
41 
43  return Error::success();
44  }
45 
47  return Error::success();
48  }
49 
50 #define TYPE_RECORD(EnumName, EnumVal, Name) \
51  virtual Error visitKnownRecord(CVType &CVR, Name##Record &Record) { \
52  return Error::success(); \
53  }
54 #define MEMBER_RECORD(EnumName, EnumVal, Name) \
55  virtual Error visitKnownMember(CVMemberRecord &CVM, Name##Record &Record) { \
56  return Error::success(); \
57  }
58 
59 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
60 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
61 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
62 #undef TYPE_RECORD
63 #undef TYPE_RECORD_ALIAS
64 #undef MEMBER_RECORD
65 #undef MEMBER_RECORD_ALIAS
66 };
67 
68 } // end namespace codeview
69 } // end namespace llvm
70 
71 #endif // LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
virtual Error visitUnknownMember(CVMemberRecord &Record)
virtual Error visitTypeBegin(CVType &Record, TypeIndex Index)
virtual Error visitUnknownType(CVType &Record)
Action to take on unknown types. By default, they are ignored.
A 32-bit type reference.
Definition: TypeIndex.h:96
virtual Error visitTypeEnd(CVType &Record)
static ErrorSuccess success()
Create a success value.
Definition: Error.h:327
virtual Error visitMemberBegin(CVMemberRecord &Record)
virtual Error visitTypeBegin(CVType &Record)
Paired begin/end actions for all types.
Lightweight error class with error context and mandatory checking.
Definition: Error.h:158
virtual Error visitMemberEnd(CVMemberRecord &Record)