P4C
The P4 Compiler
Loading...
Searching...
No Matches
parde_visitor.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_PARDE_PARDE_VISITOR_H_
20#define BACKENDS_TOFINO_BF_P4C_PARDE_PARDE_VISITOR_H_
21
22#include "ir/ir.h"
23
27class PardeInspector : public Inspector {
28 bool preorder(const IR::MAU::Table *) override { return false; }
29 bool preorder(const IR::MAU::TableSeq *) override { return false; }
31 bool preorder(const IR::BFN::TnaControl *) override { return false; }
32};
33
37class PardeModifier : public Modifier {
38 bool preorder(IR::MAU::Table *) override { return false; }
39 bool preorder(IR::MAU::TableSeq *) override { return false; }
41 bool preorder(IR::BFN::TnaControl *) override { return false; }
42};
43
47class PardeTransform : public Transform {
48 IR::MAU::Table *preorder(IR::MAU::Table *t) override {
49 prune();
50 return t;
51 }
52 IR::MAU::TableSeq *preorder(IR::MAU::TableSeq *s) override {
53 prune();
54 return s;
55 }
57 IR::Node *preorder(IR::BFN::TnaControl *c) override {
58 prune();
59 return c;
60 }
61};
62
66class ParserInspector : public Inspector {
67 bool preorder(const IR::BFN::Deparser *) override { return false; }
68 bool preorder(const IR::MAU::Table *) override { return false; }
69 bool preorder(const IR::MAU::TableSeq *) override { return false; }
71 bool preorder(const IR::BFN::TnaDeparser *) override { return false; }
72 bool preorder(const IR::BFN::TnaControl *) override { return false; }
73};
74
78class ParserModifier : public Modifier {
79 bool preorder(IR::BFN::Deparser *) override { return false; }
80 bool preorder(IR::MAU::Table *) override { return false; }
81 bool preorder(IR::MAU::TableSeq *) override { return false; }
83 bool preorder(IR::BFN::TnaDeparser *) override { return false; }
84 bool preorder(IR::BFN::TnaControl *) override { return false; }
85};
86
90class ParserTransform : public Transform {
91 IR::BFN::Deparser *preorder(IR::BFN::Deparser *d) override {
92 prune();
93 return d;
94 }
95 IR::MAU::Table *preorder(IR::MAU::Table *t) override {
96 prune();
97 return t;
98 }
99 IR::MAU::TableSeq *preorder(IR::MAU::TableSeq *s) override {
100 prune();
101 return s;
102 }
104 IR::Node *preorder(IR::BFN::TnaDeparser *d) override {
105 prune();
106 return d;
107 }
108 IR::Node *preorder(IR::BFN::TnaControl *c) override {
109 prune();
110 return c;
111 }
112};
113
117class DeparserInspector : public Inspector {
118 bool preorder(const IR::BFN::AbstractParser *) override { return false; }
119 bool preorder(const IR::MAU::Table *) override { return false; }
120 bool preorder(const IR::MAU::TableSeq *) override { return false; }
122 bool preorder(const IR::BFN::TnaParser *) override { return false; }
123 bool preorder(const IR::BFN::TnaControl *) override { return false; }
124};
125
129class DeparserModifier : public Modifier {
130 bool preorder(IR::BFN::AbstractParser *) override { return false; }
131 bool preorder(IR::MAU::Table *) override { return false; }
132 bool preorder(IR::MAU::TableSeq *) override { return false; }
134 bool preorder(IR::BFN::TnaParser *) override { return false; }
135 bool preorder(IR::BFN::TnaControl *) override { return false; }
136};
137
141class DeparserTransform : public Transform {
142 IR::BFN::AbstractParser *preorder(IR::BFN::AbstractParser *p) override {
143 prune();
144 return p;
145 }
146 IR::MAU::Table *preorder(IR::MAU::Table *t) override {
147 prune();
148 return t;
149 }
150 IR::MAU::TableSeq *preorder(IR::MAU::TableSeq *s) override {
151 prune();
152 return s;
153 }
155 IR::Node *preorder(IR::BFN::TnaParser *p) override {
156 prune();
157 return p;
158 }
159 IR::Node *preorder(IR::BFN::TnaControl *c) override {
160 prune();
161 return c;
162 }
163};
164
165#endif /* BACKENDS_TOFINO_BF_P4C_PARDE_PARDE_VISITOR_H_ */
Definition parde_visitor.h:117
Definition parde_visitor.h:129
Definition parde_visitor.h:141
Definition parde_visitor.h:27
Definition parde_visitor.h:37
Definition parde_visitor.h:47
Definition parde_visitor.h:66
Definition parde_visitor.h:78
Definition parde_visitor.h:90