File tree 3 files changed +49
-0
lines changed 3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,16 @@ void value_sett::output(
195
195
else
196
196
{
197
197
result=" <" +from_expr (ns, identifier, o)+" , " ;
198
+ if (o.id ()==ID_dynamic_object)
199
+ {
200
+ dynamic_object_exprt::recencyt recency=
201
+ to_dynamic_object_expr (o).get_recency ();
202
+
203
+ if (recency==dynamic_object_exprt::recencyt::MOST_RECENT_ALLOCATION)
204
+ result+=as_string (ID_most_recent_allocation)+" , " ;
205
+ else if (recency==dynamic_object_exprt::recencyt::ANY_ALLOCATION)
206
+ result+=as_string (ID_any_allocation)+" , " ;
207
+ }
198
208
199
209
if (o_it->second .offset_is_set )
200
210
result+=integer2string (o_it->second .offset )+" " ;
Original file line number Diff line number Diff line change @@ -511,6 +511,9 @@ overflow_mult overflow-*
511
511
overflow_unary_minus overflow-unary-
512
512
object_descriptor
513
513
dynamic_object
514
+ is_most_recent_allocation
515
+ most_recent_allocation
516
+ any_allocation
514
517
object_size
515
518
good_pointer
516
519
integer_address
Original file line number Diff line number Diff line change @@ -1490,6 +1490,8 @@ inline object_descriptor_exprt &to_object_descriptor_expr(exprt &expr)
1490
1490
class dynamic_object_exprt :public exprt
1491
1491
{
1492
1492
public:
1493
+ enum recencyt { MOST_RECENT_ALLOCATION, ANY_ALLOCATION, RECENCY_UNSET };
1494
+
1493
1495
dynamic_object_exprt ():exprt(ID_dynamic_object)
1494
1496
{
1495
1497
operands ().resize (2 );
@@ -1505,6 +1507,40 @@ class dynamic_object_exprt:public exprt
1505
1507
op1 ().id (ID_unknown);
1506
1508
}
1507
1509
1510
+ explicit dynamic_object_exprt (bool recent):
1511
+ exprt(ID_dynamic_object)
1512
+ {
1513
+ operands ().resize (2 );
1514
+ op0 ().id (ID_unknown);
1515
+ op1 ().id (ID_unknown);
1516
+ set_recency (recent);
1517
+ }
1518
+
1519
+ dynamic_object_exprt (const typet &type, bool recent):
1520
+ exprt (ID_dynamic_object, type)
1521
+ {
1522
+ operands ().resize (2 );
1523
+ op0 ().id (ID_unknown);
1524
+ op1 ().id (ID_unknown);
1525
+ set_recency (recent);
1526
+ }
1527
+
1528
+ recencyt get_recency () const
1529
+ {
1530
+ if (get (ID_is_most_recent_allocation)==ID_most_recent_allocation)
1531
+ return MOST_RECENT_ALLOCATION;
1532
+ else if (get (ID_is_most_recent_allocation)==ID_any_allocation)
1533
+ return ANY_ALLOCATION;
1534
+ else
1535
+ return RECENCY_UNSET;
1536
+ }
1537
+
1538
+ void set_recency (bool recent)
1539
+ {
1540
+ set (ID_is_most_recent_allocation,
1541
+ (recent ? ID_most_recent_allocation : ID_any_allocation));
1542
+ }
1543
+
1508
1544
exprt &instance ()
1509
1545
{
1510
1546
return op0 ();
You can’t perform that action at this time.
0 commit comments