Skip to content

Commit 2ef3925

Browse files
committed
Updated LVSA data structures for Recency Analysis
Updated the output of the LVSA in order to deal with "most-recent-allocation" and "any-allocation" dynamic objects.
1 parent 5026087 commit 2ef3925

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

src/pointer-analysis/value_set.cpp

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,22 @@ void value_sett::output(
194194
result=from_expr(ns, identifier, o);
195195
else
196196
{
197-
result="<"+from_expr(ns, identifier, o)+", ";
198-
197+
if(o.id()==ID_dynamic_object)
198+
{
199+
dynamic_object_exprt::recencyt recency;
200+
std::string recency_str="";
201+
202+
recency=to_dynamic_object_expr(o).get_recency();
203+
if(recency==dynamic_object_exprt::recencyt::MOST_RECENT_ALLOCATION)
204+
recency_str="most-recent-allocation";
205+
else if(recency==dynamic_object_exprt::recencyt::ANY_ALLOCATION)
206+
recency_str="any-allocation";
207+
result="<"+from_expr(ns, identifier, o)+", "+recency_str+", ";
208+
}
209+
else
210+
{
211+
result="<"+from_expr(ns, identifier, o)+", ";
212+
}
199213
if(o_it->second.offset_is_set)
200214
result+=integer2string(o_it->second.offset)+"";
201215
else
@@ -894,10 +908,19 @@ void value_sett::get_value_set_rec(
894908
{
895909
const dynamic_object_exprt &dynamic_object=
896910
to_dynamic_object_expr(expr);
911+
std::string recency_str="";
912+
913+
if(dynamic_object.get_recency()==
914+
dynamic_object_exprt::recencyt::MOST_RECENT_ALLOCATION)
915+
recency_str="most-recent-allocation";
916+
else if(dynamic_object.get_recency()==
917+
dynamic_object_exprt::recencyt::ANY_ALLOCATION)
918+
recency_str="any-allocation";
897919

898920
const std::string prefix=
899921
"value_set::dynamic_object"+
900-
dynamic_object.instance().get_string(ID_value);
922+
dynamic_object.instance().get_string(ID_value)+
923+
recency_str;
901924

902925
// first try with suffix
903926
const std::string full_name=prefix+suffix;
@@ -1532,10 +1555,19 @@ void value_sett::assign_rec(
15321555
{
15331556
const dynamic_object_exprt &dynamic_object=
15341557
to_dynamic_object_expr(lhs);
1558+
std::string recency_str="";
1559+
1560+
if(dynamic_object.get_recency()==
1561+
dynamic_object_exprt::recencyt::MOST_RECENT_ALLOCATION)
1562+
recency_str="most-recent-allocation";
1563+
else if(dynamic_object.get_recency()==
1564+
dynamic_object_exprt::recencyt::ANY_ALLOCATION)
1565+
recency_str="any-allocation";
15351566

15361567
const std::string name=
15371568
"value_set::dynamic_object"+
1538-
dynamic_object.instance().get_string(ID_value);
1569+
dynamic_object.instance().get_string(ID_value)+
1570+
recency_str;
15391571

15401572
entryt &e=get_entry(entryt(name, suffix), lhs.type(), ns);
15411573

0 commit comments

Comments
 (0)