71 std::set<cstring> mutex_errors;
72 std::set<cstring> topological_errors;
73 std::set<cstring> default_next_errors;
78 bool longBranchDisabled =
false;
89 std::set<cstring> &errors;
96 void postorder(
const IR::MAU::Table *)
override;
100 : mutex(m), errors(e) {}
104 UnionFind<const IR::MAU::Table *> duplicate_tables;
119 bool check_equiv(
const IR::MAU::Table *table1,
const IR::MAU::Table *table2,
120 bool makeUnion =
true);
124 bool check_equiv(
const IR::MAU::TableSeq *seq1,
const IR::MAU::TableSeq *seq2,
125 bool makeUnion =
true);
128 bool equiv_gateway(
const IR::Expression *expr1,
const IR::Expression *expr2);
132 void check_all_gws(
const IR::MAU::Table *);
133 void postorder(
const IR::MAU::Table *)
override;
146 std::optional<gress_t> gress;
150 std::map<gress_t, std::map<const IR::MAU::Table *, const IR::MAU::Table *>> replacements;
153 std::map<gress_t, std::vector<const IR::MAU::TableSeq *>> table_seqs_seen;
156 gress_t getGress()
const {
return gress ? *gress : VisitingThread(
this); }
159 const IR::Node *postorder(IR::MAU::Table *tbl)
override;
160 const IR::Node *postorder(IR::MAU::TableSeq *seq)
override;
163 explicit DeduplicateTables(
MultipleApply &s, std::optional<gress_t> gress = std::nullopt)
164 : self(s), gress(gress) {}
176 std::set<cstring> &errors;
178 bool preorder(
const IR::MAU::TableSeq *)
override;
181 explicit CheckTopologicalTables(std::set<cstring> &errors) : errors(errors) {}
187 bool mutex_error(
cstring name) {
return mutex_errors.count(name); }
189 unsigned num_mutex_errors() {
return mutex_errors.size(); }
191 bool topological_error(
cstring name) {
return topological_errors.count(name); }
193 unsigned num_topological_errors() {
return topological_errors.size(); }
195 bool default_next_error(
cstring name) {
196 return default_next_errors.find(name) != default_next_errors.end();
199 unsigned num_default_next_errors() {
return default_next_errors.size(); }
204 bool dedup_only =
false,
bool run_default_next =
true);
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24