P4C
The P4 Compiler
Loading...
Searching...
No Matches
simplifyBitwise.h
1#ifndef MIDEND_SIMPLIFYBITWISE_H_
2#define MIDEND_SIMPLIFYBITWISE_H_
3
4#include "ir/ir.h"
5#include "ir/visitor.h"
6#include "lib/ordered_set.h"
7
8namespace P4 {
9
60class SimplifyBitwise : public Transform {
61 IR::Vector<IR::StatOrDecl> *slice_statements = nullptr;
62 const IR::BaseAssignmentStatement *changing_as = nullptr;
63
64 void assignSlices(const IR::Expression *expr, big_int mask);
65
66 public:
67 const IR::Node *preorder(IR::BaseAssignmentStatement *as) override;
68 const IR::Node *preorder(IR::OpAssignmentStatement *as) override { return as; }
69 const IR::Node *preorder(IR::BAndAssign *as) override {
70 return preorder(static_cast<IR::BaseAssignmentStatement *>(as));
71 }
72 const IR::Node *preorder(IR::BOrAssign *as) override {
73 return preorder(static_cast<IR::BaseAssignmentStatement *>(as));
74 }
75 const IR::Node *preorder(IR::BXorAssign *as) override {
76 return preorder(static_cast<IR::BaseAssignmentStatement *>(as));
77 }
78};
79
80} // namespace P4
81
82#endif /* MIDEND_SIMPLIFYBITWISE_H_ */
Definition node.h:94
Definition vector.h:59
Definition simplifyBitwise.h:60
Definition visitor.h:437
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24