LLVM 19.0.0git
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
15namespace llvm {
16namespace codeview {
17
19public:
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 }
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
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
static ErrorSuccess success()
Create a success value.
Definition: Error.h:334
A 32-bit type reference.
Definition: TypeIndex.h:96
virtual Error visitUnknownMember(CVMemberRecord &Record)
virtual Error visitUnknownType(CVType &Record)
Action to take on unknown types. By default, they are ignored.
virtual Error visitTypeBegin(CVType &Record, TypeIndex Index)
virtual Error visitTypeEnd(CVType &Record)
virtual Error visitMemberEnd(CVMemberRecord &Record)
virtual Error visitMemberBegin(CVMemberRecord &Record)
virtual Error visitTypeBegin(CVType &Record)
Paired begin/end actions for all types.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18