-
Notifications
You must be signed in to change notification settings - Fork 273
Refactor rename using iterators instead of recursion #4254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor rename using iterators instead of recursion #4254
Conversation
No functional changes This is an intermediary commit to make the diff of the next commit nicer.
No functional changes. This is done automatically using clang-format. This is so that we can have a nice diff in the next commit, for which clang-format would not complain.
This use iterators to make the rename function not use recursion.
I am thinking we want a function that takes a functor that can modify expressions, and does so using an explicit stack. |
The problem with this implementation is that it calls |
Making rename_address/type return optional to avoid exprt write will be good to have. Can you make a pull request with this change? Whether the version with depth iterator would be nicer than the recursive version is a matter of taste I guess. If there is no clear advantage in using iterators, I would leave rename as it is. |
Done: #4286 |
Closing due to age (no further comment on PR content), please reopen with rebase on develop if you intent to continue this work. |
According to my experiments this is less efficient than the recursive function (I think because of the use of mutate). @tautschnig still wanted this to be in a pull request to be able to discuss it.