21 std::shared_ptr<NameGenerator> nameGen;
23 const IR::ArrayIndex *arrayIndex =
nullptr;
24 const IR::PathExpression *newVariable =
nullptr;
25 GeneratedVariablesMap *generatedVariables;
26 std::set<cstring> storedMember;
27 std::list<IR::Member *> dependedMembers;
31 std::shared_ptr<NameGenerator> nameGen,
TypeMap *typeMap,
32 GeneratedVariablesMap *generatedVariables)
36 generatedVariables(generatedVariables) {}
37 void postorder(
const IR::ArrayIndex *curArrayIndex)
override;
40 void addNewVariable();
71 std::shared_ptr<MinimalNameGenerator> nameGen;
73 GeneratedVariablesMap *generatedVariables;
77 std::shared_ptr<MinimalNameGenerator> nameGen =
nullptr,
79 GeneratedVariablesMap *generatedVariables =
nullptr)
83 generatedVariables(generatedVariables) {
84 if (generatedVariables ==
nullptr) generatedVariables =
new GeneratedVariablesMap();
87 auto rv = Transform::init_apply(node);
90 nameGen = std::make_shared<MinimalNameGenerator>();
91 node->apply(*nameGen);
97 IR::Node *preorder(IR::IfStatement *ifStatement)
override;
98 IR::Node *preorder(IR::AssignmentStatement *assignmentStatement)
override;
99 IR::Node *preorder(IR::BlockStatement *blockStatement)
override;
100 IR::Node *preorder(IR::MethodCallStatement *methodCallStatement)
override;
101 IR::Node *preorder(IR::P4Control *control)
override;
102 IR::Node *preorder(IR::P4Parser *parser)
override;
103 IR::Node *preorder(IR::SwitchStatement *switchStatement)
override;
107 const IR::Expression *expr);
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24