-
Notifications
You must be signed in to change notification settings - Fork 277
Make simplify_expr take copy instead of reference #4301
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
Make simplify_expr take copy instead of reference #4301
Conversation
@@ -1120,13 +1120,11 @@ bool acceleration_utilst::assign_array( | |||
{ | |||
replace_expr( | |||
loop_counter, from_integer(0, loop_counter.type()), lower_bound); | |||
simplify_expr(lower_bound, ns); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch - but I'd suggest to instead make those have an effect, e.g., by using simplify
instead of simplify_expr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
The implementation will make a copy of the argument anyway. This makes it explicit in the type and allow the use of move by the caller which avoids a copy.
The return value was ignored and thus there was no use in making these calls, which was probably a mistake.
We use std::move in a few places where this is made possible by the change in interface.
075d05e
to
94b2145
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: 075d05e).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/102674819
Status will be re-evaluated on next push.
Common spurious failures:
-
the cbmc commit has disappeared in the mean time (e.g. in a force-push)
-
the author is not in the list of contributors (e.g. first-time contributors).
-
the compatibility was already broken by an earlier merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: 94b2145).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/102679219
Status will be re-evaluated on next push.
Common spurious failures:
-
the cbmc commit has disappeared in the mean time (e.g. in a force-push)
-
the author is not in the list of contributors (e.g. first-time contributors).
-
the compatibility was already broken by an earlier merge.
The implementation would make a copy of the argument anyway.
This makes it explicit in the type and allow the use of move by the
caller which avoids a copy.