35 std::map<cstring, int> field_index;
39 std::map<cstring, rw_t> table_use;
40 void access_field(
cstring field);
41 bool preorder(
const IR::MAU::Table *t)
override;
42 bool preorder(
const IR::Member *f)
override;
43 bool preorder(
const IR::HeaderStackItemRef *f)
override;
44 bool preorder(
const IR::TempVar *t)
override;
45 friend std::ostream &operator<<(std::ostream &,
const FieldUse &);
48 auto rv = MauInspector::init_apply(root);
49 LOG1(
"Field Use call #" << ++counter);
52 void end_apply()
override { LOG3(*
this); }
56 bitvec tables_modify(
const IR::MAU::TableSeq *t)
const;
57 bitvec tables_access(
const IR::MAU::TableSeq *t)
const;
58 bitvec tables_modify(
const IR::MAU::Table *t)
const;
59 bitvec tables_access(
const IR::MAU::Table *t)
const;
60 bitvec table_reads(
const IR::MAU::Table *t)
const {
return table_use.at(t->name).reads; }
61 bitvec table_writes(
const IR::MAU::Table *t)
const {
return table_use.at(t->name).writes; }
63 assert(table_use.count(name) && !table_use.count(newname));
64 table_use[newname] = table_use[name];
Definition tofino_write_context.h:24
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24