LLVM  10.0.0svn
TypeVisitorCallbacks.h
Go to the documentation of this file.
1 //===- TypeVisitorCallbacks.h -----------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H
10 #define LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H
11 
13 #include "llvm/Support/Error.h"
14 
15 namespace llvm {
16 namespace codeview {
17 
19 public:
20  virtual ~TypeVisitorCallbacks() = default;
21 
22  /// Action to take on unknown types. By default, they are ignored.
24  /// Paired begin/end actions for all types. Receives all record data,
25  /// including the fixed-length record prefix. visitTypeBegin() should return
26  /// the type of the Record, or an error if it cannot be determined. Exactly
27  /// one of the two visitTypeBegin methods will be called, depending on whether
28  /// records are being visited sequentially or randomly. An implementation
29  /// should be prepared to handle both (or assert if it can't handle random
30  /// access visitation).
33  return Error::success();
34  }
35  virtual Error visitTypeEnd(CVType &Record) { return Error::success(); }
36 
38  return Error::success();
39  }
40 
42  return Error::success();
43  }
44 
46  return Error::success();
47  }
48 
49 #define TYPE_RECORD(EnumName, EnumVal, Name) \
50  virtual Error visitKnownRecord(CVType &CVR, Name##Record &Record) { \
51  return Error::success(); \
52  }
53 #define MEMBER_RECORD(EnumName, EnumVal, Name) \
54  virtual Error visitKnownMember(CVMemberRecord &CVM, Name##Record &Record) { \
55  return Error::success(); \
56  }
57 
58 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
59 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
60 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
61 #undef TYPE_RECORD
62 #undef TYPE_RECORD_ALIAS
63 #undef MEMBER_RECORD
64 #undef MEMBER_RECORD_ALIAS
65 };
66 
67 } // end namespace codeview
68 } // end namespace llvm
69 
70 #endif // LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
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:95
virtual Error visitTypeEnd(CVType &Record)
static ErrorSuccess success()
Create a success value.
Definition: Error.h:326
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:157
virtual Error visitMemberEnd(CVMemberRecord &Record)