File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -103,24 +103,24 @@ simplify_exprt::resultt<> simplify_exprt::simplify_abs(const abs_exprt &expr)
103103 return unchanged (expr);
104104}
105105
106- simplify_exprt::resultt<> simplify_exprt::simplify_sign (const exprt &expr)
106+ simplify_exprt::resultt<> simplify_exprt::simplify_sign (const sign_exprt &expr)
107107{
108108 if (expr.operands ().size ()!=1 )
109109 return unchanged (expr);
110110
111- if (expr.op0 ().is_constant ())
111+ if (expr.op ().is_constant ())
112112 {
113- const typet &type = expr.op0 ().type ();
113+ const typet &type = expr.op ().type ();
114114
115115 if (type.id ()==ID_floatbv)
116116 {
117- ieee_floatt value (to_constant_expr (expr.op0 ()));
117+ ieee_floatt value (to_constant_expr (expr.op ()));
118118 return make_boolean_expr (value.get_sign ());
119119 }
120120 else if (type.id ()==ID_signedbv ||
121121 type.id ()==ID_unsignedbv)
122122 {
123- const auto value = numeric_cast<mp_integer>(expr.op0 ());
123+ const auto value = numeric_cast<mp_integer>(expr.op ());
124124 if (value.has_value ())
125125 {
126126 return make_boolean_expr (*value >= 0 );
@@ -2276,7 +2276,7 @@ bool simplify_exprt::simplify_node(exprt &expr)
22762276 }
22772277 else if (expr.id ()==ID_sign)
22782278 {
2279- r = simplify_sign (expr);
2279+ r = simplify_sign (to_sign_expr ( expr) );
22802280 }
22812281 else if (expr.id () == ID_popcount)
22822282 {
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ class namespacet;
5050class plus_exprt ;
5151class popcount_exprt ;
5252class refined_string_exprt ;
53+ class sign_exprt ;
5354class tvt ;
5455class typecast_exprt ;
5556class unary_exprt ;
@@ -175,7 +176,7 @@ class simplify_exprt
175176 NODISCARD resultt<> simplify_isnan (const unary_exprt &);
176177 NODISCARD resultt<> simplify_isnormal (const unary_exprt &);
177178 NODISCARD resultt<> simplify_abs (const abs_exprt &);
178- NODISCARD resultt<> simplify_sign (const exprt &);
179+ NODISCARD resultt<> simplify_sign (const sign_exprt &);
179180 NODISCARD resultt<> simplify_popcount (const popcount_exprt &);
180181 NODISCARD resultt<> simplify_complex (const exprt &);
181182
You can’t perform that action at this time.
0 commit comments