Skip to content

Clean-up use of guards #4188

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

Merged

Conversation

romainbrenguier
Copy link
Contributor

In some places, guards are passed around but never really used, in other places they can be replaced by expressions.

  • Each commit message has a non-empty body, explaining why the change was made.
  • [na] Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • [na] The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • [na] White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@@ -19,6 +19,8 @@ Author: Daniel Kroening, [email protected]
#include "value_sets.h"
#include "value_set_dereference.h"

class guardt;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not exactly sure about the order of the commits here, but at the very end this shouldn't be needed anymore at all I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is still used in some unused deprecated function and I'm not sure of what to do with all these functions (most of the code in this class is unused).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the cruft. git revert is not all that hard.

dereference is not overridden, we add final to value_set_dereferencet to
be sure of that.
Calls to virtual functions are slow, and in general it is better to
avoid virtual recursive functions (like derefence was).
This argument was never actually used.
This is never actually used. This allows to remove a lot of useless
operations.
The include statement is not usefull anymore, as the usage of guard
disappeared from this file.
@romainbrenguier romainbrenguier force-pushed the clean-up/unused-guards branch 2 times, most recently from af6bd9c to c459861 Compare February 14, 2019 15:15
Copy link
Contributor

@danpoe danpoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

const std::string &suffix,
const guardt &guard)
const exprt::operandst &guard)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename the guard parameters maybe to guard_conjuncts? Otherwise it might be surprising to find a parameter named guard of type exprt::operandst.

Copy link
Contributor

@allredj allredj left a 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: 18f4ba5).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/100961989
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.

Copy link
Contributor

@allredj allredj left a 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: af6bd9c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/100962569
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.

Copy link
Contributor

@allredj allredj left a 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: c459861).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/100964248

This was not making really use of guardt, since no guardt specific
operations where performed, but instead just represents a conjunction.
We replace that by a list of expressions and do the conjunction when
needed.
This avoids dependencies on guardt.
A lot of code in goto_program_dereference was deprecated, commented or
documented as unused. This commit remove these parts of the code.
Copy link
Contributor

@allredj allredj left a 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: cee38c5).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/101067140

@romainbrenguier romainbrenguier merged commit 6406ee1 into diffblue:develop Feb 15, 2019
@romainbrenguier romainbrenguier deleted the clean-up/unused-guards branch February 15, 2019 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants