Skip to content

Commit 60a5920

Browse files
authored
Merge pull request #3760 from tautschnig/no-follow-goto-symex
Remove unnecessary use of ns.follow in goto-symex/
2 parents 89237c6 + 60699bc commit 60a5920

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

src/goto-symex/auto_objects.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void goto_symext::initialize_auto_object(
5757
else if(type.id()==ID_pointer)
5858
{
5959
const pointer_typet &pointer_type=to_pointer_type(type);
60-
const typet &subtype = ns.follow(pointer_type.subtype());
60+
const typet &subtype = pointer_type.subtype();
6161

6262
// we don't like function pointers and
6363
// we don't like void *

src/goto-symex/goto_symex_state.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ void goto_symex_statet::rename(
321321
else if(expr.id()==ID_symbol)
322322
{
323323
// we never rename function symbols
324-
if(ns.follow(expr.type()).id()==ID_code)
324+
if(expr.type().id() == ID_code)
325325
{
326326
rename(
327327
expr.type(),

src/goto-symex/symex_assign.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ void goto_symext::symex_assign_array(
307307
{
308308
const exprt &lhs_array=lhs.array();
309309
const exprt &lhs_index=lhs.index();
310-
const typet &lhs_index_type = ns.follow(lhs_array.type());
310+
const typet &lhs_index_type = lhs_array.type();
311311

312312
PRECONDITION(lhs_index_type.id() == ID_array);
313313

@@ -371,9 +371,8 @@ void goto_symext::symex_assign_struct_member(
371371
{
372372
// remove the type cast, we assume that the member is there
373373
exprt tmp = to_typecast_expr(lhs_struct).op();
374-
const typet &op0_type=ns.follow(tmp.type());
375374

376-
if(op0_type.id()==ID_struct)
375+
if(tmp.type().id() == ID_struct || tmp.type().id() == ID_struct_tag)
377376
lhs_struct=tmp;
378377
else
379378
return; // ignore and give up

src/goto-symex/symex_dead.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void goto_symext::symex_dead(statet &state)
3030
state.rename(ssa, ns, goto_symex_statet::L1);
3131

3232
// in case of pointers, put something into the value set
33-
if(ns.follow(code.symbol().type()).id() == ID_pointer)
33+
if(code.symbol().type().id() == ID_pointer)
3434
{
3535
exprt failed = get_failed_symbol(to_symbol_expr(code.symbol()), ns);
3636

src/goto-symex/symex_decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void goto_symext::symex_decl(statet &state, const symbol_exprt &expr)
4646
ssa.update_type();
4747

4848
// in case of pointers, put something into the value set
49-
if(ns.follow(expr.type()).id()==ID_pointer)
49+
if(expr.type().id() == ID_pointer)
5050
{
5151
exprt failed=
5252
get_failed_symbol(expr, ns);

0 commit comments

Comments
 (0)