Skip to content

Commit

Permalink
Make remove_skip call goto_program.update()
Browse files Browse the repository at this point in the history
All invocations of remove_skip do this immediately after calling remove_skip,
which just complicates the protocol of using remove_skip.
  • Loading branch information
tautschnig committed Jun 4, 2018
1 parent 91d47c2 commit cfb733a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/goto-programs/remove_skip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,18 @@ void remove_skip(goto_programt &goto_program)
goto_program,
goto_program.instructions.begin(),
goto_program.instructions.end());

goto_program.update();
}

/// remove unnecessary skip statements
void remove_skip(goto_functionst &goto_functions)
{
Forall_goto_functions(f_it, goto_functions)
remove_skip(f_it->second.body);
remove_skip(
f_it->second.body,
f_it->second.body.instructions.begin(),
f_it->second.body.instructions.end());

// we may remove targets
goto_functions.update();
Expand All @@ -188,4 +193,3 @@ void remove_skip(goto_modelt &goto_model)
{
remove_skip(goto_model.goto_functions);
}

0 comments on commit cfb733a

Please sign in to comment.