52 std::unique_ptr<MinimalNameGenerator> nameGen;
55 using ReplacementMap = FunctionsInlineWorkList::ReplacementMap;
57 std::vector<ReplacementMap *> replacementStack;
59 std::unordered_map<const IR::MethodCallExpression *, const IR::Expression *>
69 const IR::Statement *inlineBefore(
const IR::Node *calleeNode,
70 const IR::MethodCallExpression *call,
71 const IR::Statement *before);
74 const ReplacementMap *getReplacementMap()
const;
75 void dumpReplacementMap()
const;
81 void end_apply(
const IR::Node *node)
override;
82 const IR::Node *preorder(IR::Function *function)
override;
83 const IR::Node *preorder(IR::P4Control *control)
override;
84 const IR::Node *preorder(IR::P4Parser *parser)
override;
85 const IR::Node *preorder(IR::P4Action *action)
override;
86 const IR::Node *preorder(IR::MethodCallStatement *statement)
override;
87 const IR::Node *preorder(IR::MethodCallExpression *expr)
override;
88 const IR::Node *preorder(IR::AssignmentStatement *statement)
override;
98 setName(
"CloneVariableDeclarations");
101 const IR::Node *postorder(IR::Declaration_Variable *declaration)
override {
103 auto result =
new IR::Declaration_Variable(declaration->srcInfo, declaration->getName(),
104 declaration->annotations, declaration->type,
105 declaration->initializer);
106 LOG3(
"Cloned " << dbp(result));
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