Skip to content

Commit 3d71891

Browse files
Merge pull request #147 from viktormalik/remove-list-iterators
Remove list iterators
2 parents d35ccf7 + 33606d2 commit 3d71891

12 files changed

+51
-576
lines changed

src/domains/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SRC = tpolyhedra_domain.cpp equality_domain.cpp domain.cpp \
2-
predabs_domain.cpp heap_domain.cpp list_iterator.cpp \
2+
predabs_domain.cpp heap_domain.cpp \
33
sympath_domain.cpp \ symbolic_path.cpp\
44
ssa_analyzer.cpp util.cpp incremental_solver.cpp \
55
strategy_solver_binsearch.cpp \

src/domains/list_iterator.cpp

Lines changed: 0 additions & 126 deletions
This file was deleted.

src/domains/list_iterator.h

Lines changed: 0 additions & 83 deletions
This file was deleted.

src/ssa/address_canonizer.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,6 @@ exprt address_canonizer(
6767

6868
return sum;
6969
}
70-
else if(object.id()==ID_symbol && is_iterator(object))
71-
{
72-
// address of iterator is dereferenced to a corresponding symbol -
73-
// will be bound to real address during analysis
74-
symbol_exprt iterator_addr(
75-
id2string(to_symbol_expr(object).get_identifier())+"'addr",
76-
address.type());
77-
return iterator_addr;
78-
}
7970
else
8071
return address;
8172
}

src/ssa/local_ssa.cpp

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,6 @@ void local_SSAt::build_assertions(locationt loc)
570570
}
571571

572572
const exprt deref_rhs=dereference(assert, loc);
573-
collect_iterators_rhs(deref_rhs, loc);
574573

575574
const exprt rhs=concretise_symbolic_deref_rhs(assert, ns, loc);
576575
exprt c=read_rhs(rhs, loc);
@@ -1026,9 +1025,6 @@ void local_SSAt::assign_rec(
10261025

10271026
if(assigned.find(lhs_object)!=assigned.end())
10281027
{
1029-
collect_iterators_lhs(lhs_object, loc);
1030-
collect_iterators_rhs(rhs, loc);
1031-
10321028
exprt ssa_rhs=fresh_rhs ? name(ssa_objectt(rhs, ns), OUT, loc)
10331029
: read_rhs(rhs, loc);
10341030

@@ -1442,65 +1438,6 @@ exprt local_SSAt::unknown_obj_eq(
14421438
return equal_exprt(member, address_of_exprt(obj));
14431439
}
14441440

1445-
void local_SSAt::collect_iterators_rhs(const exprt &expr, locationt loc)
1446-
{
1447-
if(expr.id()==ID_member)
1448-
{
1449-
const member_exprt &member=to_member_expr(expr);
1450-
if(member.compound().get_bool(ID_iterator) &&
1451-
member.compound().id()==ID_symbol)
1452-
{
1453-
new_iterator_access(to_member_expr(expr), loc, list_iteratort::IN_LOC);
1454-
}
1455-
}
1456-
else
1457-
{
1458-
forall_operands(it, expr)
1459-
collect_iterators_rhs(*it, loc);
1460-
}
1461-
}
1462-
1463-
void local_SSAt::collect_iterators_lhs(
1464-
const ssa_objectt &object,
1465-
local_SSAt::locationt loc)
1466-
{
1467-
if(is_iterator(object.get_root_object()) &&
1468-
object.get_root_object().id()==ID_symbol)
1469-
{
1470-
assert(object.get_expr().id()==ID_member);
1471-
new_iterator_access(
1472-
to_member_expr(object.get_expr()),
1473-
loc,
1474-
loc->location_number);
1475-
}
1476-
}
1477-
1478-
/// Create new iterator access
1479-
void local_SSAt::new_iterator_access(
1480-
const member_exprt &expr,
1481-
local_SSAt::locationt loc,
1482-
unsigned inst_loc_number)
1483-
{
1484-
assert(is_iterator(expr.compound()));
1485-
1486-
const irep_idt pointer_id=expr.compound().get(ID_it_pointer);
1487-
const symbolt &pointer_symbol=ns.lookup(pointer_id);
1488-
exprt pointer_rhs=read_rhs(pointer_symbol.symbol_expr(), loc);
1489-
assert(pointer_rhs.id()==ID_symbol);
1490-
1491-
unsigned init_value_level=expr.compound().get_unsigned_int(
1492-
ID_it_init_value_level);
1493-
const exprt init_pointer=get_pointer(expr.compound(), init_value_level-1);
1494-
1495-
list_iteratort iterator(
1496-
to_symbol_expr(pointer_rhs),
1497-
init_pointer,
1498-
get_iterator_fields(expr.compound()));
1499-
1500-
auto it=iterators.insert(iterator);
1501-
it.first->add_access(expr, inst_loc_number);
1502-
}
1503-
15041441
/// Create new iterator access
15051442
bool local_SSAt::all_symbolic_deref_defined(
15061443
const exprt &expr,

src/ssa/local_ssa.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Author: Daniel Kroening, [email protected]
1616

1717
#include <goto-programs/goto_functions.h>
1818

19-
#include <domains/list_iterator.h>
2019
#include <domains/incremental_solver.h>
2120
#include <util/options.h>
2221
#include <util/replace_expr.h>
@@ -144,8 +143,6 @@ class local_SSAt
144143
var_listt params;
145144
var_sett globals_in, globals_out;
146145

147-
std::set<list_iteratort> iterators;
148-
149146
// unknown heap objects
150147
var_sett unknown_objs;
151148

@@ -209,13 +206,6 @@ class local_SSAt
209206
locationt loc,
210207
bool fresh_rhs=false);
211208

212-
void collect_iterators_rhs(const exprt &expr, locationt loc);
213-
void collect_iterators_lhs(const ssa_objectt &object, locationt loc);
214-
void new_iterator_access(
215-
const member_exprt &expr,
216-
locationt loc,
217-
unsigned inst_loc_number);
218-
219209
exprt unknown_obj_eq(
220210
const symbol_exprt &obj,
221211
const struct_typet::componentt &component) const;

0 commit comments

Comments
 (0)