Skip to content

Commit 4bd418a

Browse files
authored
Merge pull request #3762 from tautschnig/no-follow-goto-instrument
Remove unnecessary use of ns.follow in goto-instrument/
2 parents 4e797f2 + 1f85cbe commit 4bd418a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/goto-instrument/accelerate/overflow_instrumenter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void overflow_instrumentert::overflow_expr(
100100
overflow_expr(*it, cases);
101101
}
102102

103-
const typet &type=ns.follow(expr.type());
103+
const typet &type = expr.type();
104104

105105
if(expr.id()==ID_typecast)
106106
{
@@ -109,7 +109,7 @@ void overflow_instrumentert::overflow_expr(
109109
return;
110110
}
111111

112-
const typet &old_type=ns.follow(expr.op0().type());
112+
const typet &old_type = expr.op0().type();
113113
const std::size_t new_width = to_bitvector_type(expr.type()).get_width();
114114
const std::size_t old_width = to_bitvector_type(old_type).get_width();
115115

src/goto-instrument/dump_c.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,9 @@ void dump_ct::convert_compound(
421421
comp.get_is_padding())
422422
continue;
423423

424-
const typet *non_array_type=&ns.follow(comp_type);
424+
const typet *non_array_type = &comp_type;
425425
while(non_array_type->id()==ID_array)
426-
non_array_type=&(ns.follow(non_array_type->subtype()));
426+
non_array_type = &(non_array_type->subtype());
427427

428428
if(recursive)
429429
{

src/goto-instrument/goto_program2code.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,7 @@ void goto_program2codet::convert_assign_rec(
405405
{
406406
if(assign.rhs().id()==ID_array)
407407
{
408-
const array_typet &type=
409-
to_array_type(ns.follow(assign.rhs().type()));
408+
const array_typet &type = to_array_type(assign.rhs().type());
410409

411410
unsigned i=0;
412411
forall_operands(it, assign.rhs())
@@ -1575,7 +1574,7 @@ void goto_program2codet::cleanup_function_call(
15751574
code_typet::parameterst::const_iterator it=parameters.begin();
15761575
Forall_expr(it2, arguments)
15771576
{
1578-
if(ns.follow(it2->type()).id()==ID_union)
1577+
if(it2->type().id() == ID_union || it2->type().id() == ID_union_tag)
15791578
it2->type()=it->type();
15801579
++it;
15811580
}
@@ -1825,8 +1824,9 @@ void goto_program2codet::cleanup_expr(exprt &expr, bool no_typecast)
18251824
}
18261825

18271826
// work around transparent union argument
1828-
if(expr.id()==ID_union &&
1829-
ns.follow(expr.type()).id()!=ID_union)
1827+
if(
1828+
expr.id() == ID_union && expr.type().id() != ID_union &&
1829+
expr.type().id() != ID_union_tag)
18301830
{
18311831
expr=to_union_expr(expr).op();
18321832
}
@@ -1977,7 +1977,7 @@ void goto_program2codet::cleanup_expr(exprt &expr, bool no_typecast)
19771977
}
19781978
else if(expr.id()==ID_typecast)
19791979
{
1980-
if(ns.follow(expr.type()).id()==ID_c_bit_field)
1980+
if(expr.type().id() == ID_c_bit_field)
19811981
expr=to_typecast_expr(expr).op();
19821982
else
19831983
{

0 commit comments

Comments
 (0)