9#ifndef LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKPIPELINE_H
10#define LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKPIPELINE_H
26 for (
auto *Visitor : Pipeline) {
27 if (
auto EC = Visitor->visitUnknownType(
Record))
34 for (
auto *Visitor : Pipeline) {
35 if (
auto EC = Visitor->visitUnknownMember(
Record))
42 for (
auto *Visitor : Pipeline) {
43 if (
auto EC = Visitor->visitTypeBegin(
Record))
50 for (
auto *Visitor : Pipeline) {
58 for (
auto *Visitor : Pipeline) {
59 if (
auto EC = Visitor->visitTypeEnd(
Record))
66 for (
auto *Visitor : Pipeline) {
67 if (
auto EC = Visitor->visitMemberBegin(
Record))
74 for (
auto *Visitor : Pipeline) {
75 if (
auto EC = Visitor->visitMemberEnd(
Record))
82 Pipeline.push_back(&Callbacks);
85#define TYPE_RECORD(EnumName, EnumVal, Name) \
86 Error visitKnownRecord(CVType &CVR, Name##Record &Record) override { \
87 return visitKnownRecordImpl(CVR, Record); \
89#define MEMBER_RECORD(EnumName, EnumVal, Name) \
90 Error visitKnownMember(CVMemberRecord &CVMR, Name##Record &Record) \
92 return visitKnownMemberImpl(CVMR, Record); \
94#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
95#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
96#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
99 template <
typename T> Error visitKnownRecordImpl(
CVType &CVR,
T &Record) {
100 for (
auto *Visitor : Pipeline) {
101 if (
auto EC = Visitor->visitKnownRecord(CVR, Record))
107 template <
typename T>
108 Error visitKnownMemberImpl(CVMemberRecord &CVMR,
T &Record) {
109 for (
auto *Visitor : Pipeline) {
110 if (
auto EC = Visitor->visitKnownMember(CVMR, Record))
115 std::vector<TypeVisitorCallbacks *> Pipeline;
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
Error visitMemberBegin(CVMemberRecord &Record) override
Error visitTypeEnd(CVType &Record) override
TypeVisitorCallbackPipeline()=default
Error visitTypeBegin(CVType &Record, TypeIndex Index) override
Error visitUnknownMember(CVMemberRecord &Record) override
Error visitMemberEnd(CVMemberRecord &Record) override
Error visitTypeBegin(CVType &Record) override
Paired begin/end actions for all types.
Error visitUnknownType(CVRecord< TypeLeafKind > &Record) override
void addCallbackToPipeline(TypeVisitorCallbacks &Callbacks)
CVRecord< TypeLeafKind > CVType
This is an optimization pass for GlobalISel generic memory operations.