File tree 2 files changed +8
-7
lines changed 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)
103
103
return unchanged (expr);
104
104
}
105
105
106
- simplify_exprt::resultt<> simplify_exprt::simplify_sign (const exprt &expr)
106
+ simplify_exprt::resultt<> simplify_exprt::simplify_sign (const sign_exprt &expr)
107
107
{
108
108
if (expr.operands ().size ()!=1 )
109
109
return unchanged (expr);
110
110
111
- if (expr.op0 ().is_constant ())
111
+ if (expr.op ().is_constant ())
112
112
{
113
- const typet &type = expr.op0 ().type ();
113
+ const typet &type = expr.op ().type ();
114
114
115
115
if (type.id ()==ID_floatbv)
116
116
{
117
- ieee_floatt value (to_constant_expr (expr.op0 ()));
117
+ ieee_floatt value (to_constant_expr (expr.op ()));
118
118
return make_boolean_expr (value.get_sign ());
119
119
}
120
120
else if (type.id ()==ID_signedbv ||
121
121
type.id ()==ID_unsignedbv)
122
122
{
123
- const auto value = numeric_cast<mp_integer>(expr.op0 ());
123
+ const auto value = numeric_cast<mp_integer>(expr.op ());
124
124
if (value.has_value ())
125
125
{
126
126
return make_boolean_expr (*value >= 0 );
@@ -2276,7 +2276,7 @@ bool simplify_exprt::simplify_node(exprt &expr)
2276
2276
}
2277
2277
else if (expr.id ()==ID_sign)
2278
2278
{
2279
- r = simplify_sign (expr);
2279
+ r = simplify_sign (to_sign_expr ( expr) );
2280
2280
}
2281
2281
else if (expr.id () == ID_popcount)
2282
2282
{
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ class namespacet;
50
50
class plus_exprt ;
51
51
class popcount_exprt ;
52
52
class refined_string_exprt ;
53
+ class sign_exprt ;
53
54
class tvt ;
54
55
class typecast_exprt ;
55
56
class unary_exprt ;
@@ -175,7 +176,7 @@ class simplify_exprt
175
176
NODISCARD resultt<> simplify_isnan (const unary_exprt &);
176
177
NODISCARD resultt<> simplify_isnormal (const unary_exprt &);
177
178
NODISCARD resultt<> simplify_abs (const abs_exprt &);
178
- NODISCARD resultt<> simplify_sign (const exprt &);
179
+ NODISCARD resultt<> simplify_sign (const sign_exprt &);
179
180
NODISCARD resultt<> simplify_popcount (const popcount_exprt &);
180
181
NODISCARD resultt<> simplify_complex (const exprt &);
181
182
You can’t perform that action at this time.
0 commit comments