File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ mp_integer bv_arithmetict::pack() const
82
82
return value+power (2 , spec.width );
83
83
}
84
84
85
- exprt bv_arithmetict::to_expr () const
85
+ constant_exprt bv_arithmetict::to_expr () const
86
86
{
87
87
return constant_exprt (integer2bvrep (value, spec.width ), spec.to_type ());
88
88
}
@@ -180,10 +180,8 @@ void bv_arithmetict::change_spec(const bv_spect &dest_spec)
180
180
adjust ();
181
181
}
182
182
183
- void bv_arithmetict::from_expr (const exprt &expr)
183
+ void bv_arithmetict::from_expr (const constant_exprt &expr)
184
184
{
185
- PRECONDITION (expr.is_constant ());
186
185
spec=bv_spect (expr.type ());
187
- value = bvrep2integer (
188
- to_constant_expr (expr).get_value (), spec.width , spec.is_signed );
186
+ value = bvrep2integer (expr.get_value (), spec.width , spec.is_signed );
189
187
}
Original file line number Diff line number Diff line change 15
15
#include " mp_arith.h"
16
16
#include " format_spec.h"
17
17
18
+ class constant_exprt ;
18
19
class exprt ;
19
20
class typet ;
20
21
@@ -60,7 +61,7 @@ class bv_arithmetict
60
61
{
61
62
}
62
63
63
- explicit bv_arithmetict (const exprt &expr)
64
+ explicit bv_arithmetict (const constant_exprt &expr)
64
65
{
65
66
from_expr (expr);
66
67
}
@@ -91,8 +92,8 @@ class bv_arithmetict
91
92
std::string format (const format_spect &format_spec) const ;
92
93
93
94
// expressions
94
- exprt to_expr () const ;
95
- void from_expr (const exprt &expr);
95
+ constant_exprt to_expr () const ;
96
+ void from_expr (const constant_exprt &expr);
96
97
97
98
bv_arithmetict &operator /=(const bv_arithmetict &other);
98
99
bv_arithmetict &operator *=(const bv_arithmetict &other);
You can’t perform that action at this time.
0 commit comments