-
Notifications
You must be signed in to change notification settings - Fork 277
goto symex member cleanup #3221
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
goto symex member cleanup #3221
Conversation
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.
Passed Diffblue compatibility checks (cbmc commit: 0c909fd).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88847152
@@ -43,16 +43,17 @@ class scratch_programt:public goto_programt | |||
ns(symbol_table, symex_symbol_table), | |||
equation(), | |||
path_storage(), | |||
options(), | |||
options( | |||
{{"propagation", true}, |
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.
Why the new propagation setting?
So symex currently has a weird mixture of directly querying the |
Also I'm not a fan of the new constructor for |
0c909fd
to
3a9711d
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.
Passed Diffblue compatibility checks (cbmc commit: 56b4872).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89037402
@smowton thanks for the comments, agreed with all of them. I've reverted the I notice that clang-format errors now cause the CI to fail. Is the preferred way to apply clang-format to have one single commit for the whole patch series as I've done above, or is it better to apply clang-format on each commit? |
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.
Change the static default_options
into a local, otherwise LGTM, thanks for the improvements! re: clang-format it's best to do it per commit if possible, since that results in a more accurate git blame
@@ -203,3 +203,10 @@ void scratch_programt::append_loop( | |||
} | |||
} | |||
} | |||
|
|||
optionst scratch_programt::default_options; |
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.
Just declare this as a local in get_default_options
56b4872
to
2fc5dab
Compare
Thanks, I did as you asked and applied the clang-format changes to the right commits. (I've also squashed the clang-format changes into its commit in #3220). |
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.
Passed Diffblue compatibility checks (cbmc commit: 2fc5dab).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89137416
This is so that the optionst object that gets passed to scratch_programt::symex has the right options for initializing the symex object.
This member is never written to.
This member is never written to and serves merely as a cache for a front-end option, so this commit makes it const and protected.
This goto_symext member is never written to and serves merely as a cache for a front-end option, so this commit makes it const and protected.
This member is never written to and serves merely as a cache for a front-end option, so this commit makes it const.
2fc5dab
to
65e017d
Compare
goto_symext no longer has a reference to a optionst object. Instead, the options that goto_symext needs to read from an optionst are read during construction and cached in const members.
65e017d
to
622940c
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: 65e017d).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89630691
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
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 incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
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: 622940c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89632968
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
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 incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
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 looks good. Also, I have manually checked that this causes no trouble with test-gen. Compatibility warnings are due to some previous failure and can be disregarded.
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.
That looks a lot cleaner to me - and thanks for constructing an easy-to-review PR :-)
@chrisr-diffblue I'm trying to accumulate good karma to cash in for a 4k line PR that is on the horizon...:upside_down_face: |
This patch-set aims to
const
-ify every member ofgoto_symext
and related classes that only serve as a cache for anoptionst
option, and to make those membersprotected
if appropriate. The fact that they were public and/or non-const was rather confusing.The first commit in the patch-set allows to set options of an
optionst
while it is being constructed, so that other classes can read from theoptionst
object while they are being constructed. This means that we no longer need to do many of thesymex.member = options.get_option("member");
inside the bodies of a constructor, instead doingmember(options.get_option("member"))
inside the constructor forgoto_symext
and therefore makingmember
const and protected.