@@ -17,7 +17,7 @@ Author: Daniel Kroening, kroening@kroening.com
1717
1818#include " boolbv_type.h"
1919
20- bvt boolbvt::convert_unary_minus (const unary_exprt &expr)
20+ bvt boolbvt::convert_unary_minus (const unary_minus_exprt &expr)
2121{
2222 const typet &type=ns.follow (expr.type ());
2323
@@ -33,8 +33,6 @@ bvt boolbvt::convert_unary_minus(const unary_exprt &expr)
3333 bvtypet bvtype=get_bvtype (type);
3434 bvtypet op_bvtype = get_bvtype (op.type ());
3535
36- bool no_overflow=(expr.id ()==" no-overflow-unary-minus" );
37-
3836 if (bvtype==bvtypet::IS_UNKNOWN &&
3937 (type.id ()==ID_vector || type.id ()==ID_complex))
4038 {
@@ -79,27 +77,17 @@ bvt boolbvt::convert_unary_minus(const unary_exprt &expr)
7977 }
8078 else if (bvtype==bvtypet::IS_FIXED && op_bvtype==bvtypet::IS_FIXED)
8179 {
82- if (no_overflow)
83- return bv_utils.negate_no_overflow (op_bv);
84- else
85- return bv_utils.negate (op_bv);
80+ return bv_utils.negate (op_bv);
8681 }
8782 else if (bvtype==bvtypet::IS_FLOAT && op_bvtype==bvtypet::IS_FLOAT)
8883 {
89- INVARIANT (!no_overflow, " " );
9084 float_utilst float_utils (prop, to_floatbv_type (expr.type ()));
9185 return float_utils.negate (op_bv);
9286 }
9387 else if ((op_bvtype==bvtypet::IS_SIGNED || op_bvtype==bvtypet::IS_UNSIGNED) &&
9488 (bvtype==bvtypet::IS_SIGNED || bvtype==bvtypet::IS_UNSIGNED))
9589 {
96- if (no_overflow)
97- prop.l_set_to (bv_utils.overflow_negate (op_bv), false );
98-
99- if (no_overflow)
100- return bv_utils.negate_no_overflow (op_bv);
101- else
102- return bv_utils.negate (op_bv);
90+ return bv_utils.negate (op_bv);
10391 }
10492
10593 return conversion_failed (expr);
0 commit comments