31 const IR::MAU::TableSeq *preorder(IR::MAU::TableSeq *seq)
override {
32 if (seq->size() < 1)
return seq;
33 auto *last = seq->back();
34 if (!last->conditional_gateway_only() || last->gateway_rows.size() != 1 ||
35 last->next.size() != 1) {
39 if (seq->size() == 1) {
41 return last->next.begin()->second;
43 auto *prev = seq->tables.at(seq->size() - 2);
44 if (!prev->next.empty()) {
48 seq->tables.pop_back();
49 auto *clone = prev->clone();
50 clone->next[
"$default"_cs] = last->next.begin()->second;
52 seq->tables.back() = clone;
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24