39 std::vector<IR::Vector<IR::Declaration> *> toMove;
42 BUG_CHECK(!toMove.empty(),
"Empty move stack");
46 BUG_CHECK(!toMove.empty(),
"Empty move stack");
49 void addMove(
const IR::Declaration *decl) { getMoves()->push_back(decl); }
52 explicit MoveDeclarations(
bool parsersOnly =
false) : parsersOnly(parsersOnly) {
53 setName(
"MoveDeclarations");
56 void end_apply(
const IR::Node *)
override { BUG_CHECK(toMove.empty(),
"Non empty move stack"); }
57 const IR::Node *preorder(IR::P4Action *action)
override {
62 if (findContext<IR::P4Control>() ==
nullptr)
68 const IR::Node *preorder(IR::P4Control *control)
override {
76 const IR::Node *preorder(IR::P4Parser *parser)
override {
80 const IR::Node *preorder(IR::Function *function)
override {
88 const IR::Node *postorder(IR::P4Action *action)
override;
89 const IR::Node *postorder(IR::P4Control *control)
override;
90 const IR::Node *postorder(IR::P4Parser *parser)
override;
91 const IR::Node *postorder(IR::Function *function)
override;
92 const IR::Node *postorder(IR::Declaration_Variable *decl)
override;
93 const IR::Node *postorder(IR::Declaration_Constant *decl)
override;
Visitor mixin for looking up names in enclosing scopes from the Visitor::Context.
Definition resolveReferences.h:35
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24