P4C
The P4 Compiler
Loading...
Searching...
No Matches
remove_act_tables.h
1
19#ifndef _BACKENDS_TOFINO_BF_P4C_MAU_REMOVE_ACT_TABLES_H_
20#define _BACKENDS_TOFINO_BF_P4C_MAU_REMOVE_ACT_TABLES_H_
21
22#include "ir/ir.h"
23
24using namespace P4;
25
34class AnalyzeActionTables : public MAU::Inspector {
35 public:
37 bool isCandidate(const IR::MAU::Table *t) const { return _candidates. }
38
39 private:
40 bool preorder(IR::P4Control *control) override;
41 bool preorder(const IR::MAU::Table *t) override;
42 bool preorder(IR::P4Action *action) override;
43
44 std::set<cstring> _candidates;
45};
46
49 const AnalyzeActionTables *analysis;
50
51 public:
52 explicit DoRemoveActionTables(const AnalyzeActionTables *a) : analysis(a) {}
53
54 private:
55 const IR::Node *postorder(const IR::MAU::Table *t) override;
56};
57
59 public:
61 auto analysis = new AnalyzeActionTables();
62 addPasses({
63 &analysis,
64 new DoRemoveActionTables(analysis),
65 });
66 }
67};
68
69#endif /* _BACKENDS_TOFINO_BF_P4C_MAU_REMOVE_ACT_TABLES_H_ */
Definition remove_act_tables.h:34
Do the actual moves after the analysis has completed.
Definition remove_act_tables.h:48
Definition node.h:94
Definition ir/pass_manager.h:40
Definition visitor.h:424
Definition remove_act_tables.h:58
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24