File tree Expand file tree Collapse file tree 3 files changed +8
-53
lines changed Expand file tree Collapse file tree 3 files changed +8
-53
lines changed Original file line number Diff line number Diff line change @@ -296,32 +296,4 @@ void show_goto_trace(
296
296
if (cmdline.isset(" stack-trace" )) \
297
297
options.set_option(" stack-trace" , true );
298
298
299
- // / Variety of constant expression only used in the context of a GOTO trace, to
300
- // / give both the numeric value and the symbolic value of a pointer,
301
- // / e.g. numeric value "0xabcd0004" but symbolic value "&some_object + 4". The
302
- // / numeric value is stored in the `constant_exprt`'s usual value slot (see
303
- // / \ref constant_exprt::get_value) and the symbolic value is accessed using the
304
- // / `symbolic_pointer` method introduced by this class.
305
- class goto_trace_constant_pointer_exprt : public constant_exprt
306
- {
307
- public:
308
- const exprt &symbolic_pointer () const
309
- {
310
- return static_cast <const exprt &>(operands ()[0 ]);
311
- }
312
- };
313
-
314
- template <>
315
- inline bool can_cast_expr<goto_trace_constant_pointer_exprt>(const exprt &base)
316
- {
317
- return can_cast_expr<constant_exprt>(base) && base.operands ().size () == 1 ;
318
- }
319
-
320
- inline const goto_trace_constant_pointer_exprt &
321
- to_goto_trace_constant_pointer_expr (const exprt &expr)
322
- {
323
- PRECONDITION (can_cast_expr<goto_trace_constant_pointer_exprt>(expr));
324
- return static_cast <const goto_trace_constant_pointer_exprt &>(expr);
325
- }
326
-
327
299
#endif // CPROVER_GOTO_PROGRAMS_GOTO_TRACE_H
Original file line number Diff line number Diff line change @@ -22,29 +22,7 @@ bvt boolbvt::convert_constant(const constant_exprt &expr)
22
22
23
23
const typet &expr_type=expr.type ();
24
24
25
- if (expr_type.id ()==ID_array)
26
- {
27
- std::size_t op_width=width/expr.operands ().size ();
28
- std::size_t offset=0 ;
29
-
30
- forall_operands (it, expr)
31
- {
32
- const bvt &tmp=convert_bv (*it);
33
-
34
- DATA_INVARIANT_WITH_DIAGNOSTICS (
35
- tmp.size () == op_width,
36
- " convert_constant: unexpected operand width" ,
37
- irep_pretty_diagnosticst{expr});
38
-
39
- for (std::size_t j=0 ; j<op_width; j++)
40
- bv[offset+j]=tmp[j];
41
-
42
- offset+=op_width;
43
- }
44
-
45
- return bv;
46
- }
47
- else if (expr_type.id ()==ID_string)
25
+ if (expr_type.id () == ID_string)
48
26
{
49
27
// we use the numbering for strings
50
28
std::size_t number = string_numbering.number (expr.get_value ());
Original file line number Diff line number Diff line change @@ -2799,11 +2799,11 @@ inline type_exprt &to_type_expr(exprt &expr)
2799
2799
}
2800
2800
2801
2801
// / \brief A constant literal expression
2802
- class constant_exprt : public expr_protectedt
2802
+ class constant_exprt : public nullary_exprt
2803
2803
{
2804
2804
public:
2805
2805
constant_exprt (const irep_idt &_value, typet _type)
2806
- : expr_protectedt (ID_constant, std::move(_type))
2806
+ : nullary_exprt (ID_constant, std::move(_type))
2807
2807
{
2808
2808
set_value (_value);
2809
2809
}
@@ -2827,6 +2827,11 @@ inline bool can_cast_expr<constant_exprt>(const exprt &base)
2827
2827
return base.id () == ID_constant;
2828
2828
}
2829
2829
2830
+ inline void validate_expr (const constant_exprt &value)
2831
+ {
2832
+ validate_operands (value, 0 , " Constants must not have operands" );
2833
+ }
2834
+
2830
2835
// / \brief Cast an exprt to a \ref constant_exprt
2831
2836
// /
2832
2837
// / \a expr must be known to be \ref constant_exprt.
You can’t perform that action at this time.
0 commit comments