41 const IR::Expression *fix(
const IR::Expression *expr,
const IR::Type_Bits *type);
42 const IR::Node *updateType(
const IR::Expression *expression);
43 const IR::Node *postorder(IR::Expression *expression)
override;
44 const IR::Node *postorder(IR::Operation_Binary *expression)
override;
45 const IR::Node *postorder(IR::Neg *expression)
override;
46 const IR::Node *postorder(IR::Cmpl *expression)
override;
47 const IR::Node *postorder(IR::Cast *expression)
override;
63 std::map<const IR::Expression *, Util::IJson *> map;
68 bool withConstantWidths{
false};
76 corelib(P4::P4CoreLibrary::instance()),
77 scalarsName(scalarsName),
94 Util::IJson *get(
const IR::Expression *expression)
const;
106 bool convertBool =
false);
107 Util::IJson *convertLeftValue(
const IR::Expression *e);
108 Util::IJson *convertWithConstantWidths(
const IR::Expression *e);
109 bool isArrayIndexRuntime(
const IR::Expression *e);
111 void postorder(
const IR::BoolLiteral *expression)
override;
112 void postorder(
const IR::MethodCallExpression *expression)
override;
113 void postorder(
const IR::Cast *expression)
override;
114 void postorder(
const IR::Slice *expression)
override;
115 void postorder(
const IR::AddSat *expression)
override { saturated_binary(expression); }
116 void postorder(
const IR::SubSat *expression)
override { saturated_binary(expression); }
117 void postorder(
const IR::Constant *expression)
override;
118 void postorder(
const IR::ArrayIndex *expression)
override;
119 void postorder(
const IR::Member *expression)
override;
120 void postorder(
const IR::Mux *expression)
override;
121 void postorder(
const IR::IntMod *expression)
override;
122 void postorder(
const IR::Operation_Binary *expression)
override;
123 void postorder(
const IR::ListExpression *expression)
override;
124 void postorder(
const IR::StructExpression *expression)
override;
125 void postorder(
const IR::Operation_Unary *expression)
override;
126 void postorder(
const IR::PathExpression *expression)
override;
127 void postorder(
const IR::StringLiteral *expression)
override;
128 void postorder(
const IR::TypeNameExpression *expression)
override;
129 void postorder(
const IR::Expression *expression)
override;
130 void mapExpression(
const IR::Expression *expression,
Util::IJson *json);
133 void binary(
const IR::Operation_Binary *expression);
134 void saturated_binary(
const IR::Operation_Binary *expression);
const IR::Parameter * enclosingParamReference(const IR::Expression *expression)
Non-null if the expression refers to a parameter from the enclosing control.
Definition backends/bmv2/common/expression.cpp:237
Util::IJson * convert(const IR::Expression *e, bool doFixup=true, bool wrap=true, bool convertBool=false)
Definition backends/bmv2/common/expression.cpp:768