83 bool isSimple(
const IR::Expression *expression,
const Visitor::Context *ctxt) {
84 if (
auto mask = expression->to<IR::BAnd>()) {
85 if (mask->right->is<IR::Constant>())
86 expression = mask->left;
87 else if (mask->left->is<IR::Constant>())
88 expression = mask->right;
90 return IsLikeLeftValue::isSimple(expression, ctxt);
146 std::map<const IR::P4Table *, TableInsertions *> toInsert;
150 : typeMap(typeMap), key_policy(key_policy) {
152 CHECK_NULL(key_policy);
153 setName(
"DoSimplifyKey");
157 auto rv = Transform::init_apply(node);
158 node->apply(nameGen);
163 const IR::Node *doStatement(
const IR::Statement *statement,
const IR::Expression *expression);
167 const IR::Node *postorder(IR::MethodCallStatement *statement)
override {
168 return doStatement(statement, statement->methodCall);
170 const IR::Node *postorder(IR::IfStatement *statement)
override {
171 return doStatement(statement, statement->condition);
173 const IR::Node *postorder(IR::SwitchStatement *statement)
override {
174 return doStatement(statement, statement->expression);
176 const IR::Node *postorder(IR::AssignmentStatement *statement)
override {
177 return doStatement(statement, statement->right);
179 const IR::Node *postorder(IR::KeyElement *element)
override;
180 const IR::Node *postorder(IR::P4Table *table)
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