Skip to content

remove unused member_exprt::symbol() #2860

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
merged 1 commit into from
Sep 4, 2018
Merged

Conversation

kroening
Copy link
Member

Reverts d47d503; the method isn't used.

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

I'd suggest that the information included in the PR also makes it into the commit message.

@kroening kroening force-pushed the revert-d47d503b66 branch 4 times, most recently from 034e414 to 56c6aed Compare August 30, 2018 15:54
Copy link
Member

@peterschrammel peterschrammel left a comment

Choose a reason for hiding this comment

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

@thk123, this requires a TG bump.

@thk123
Copy link
Contributor

thk123 commented Aug 31, 2018

Done: diffblue/test-gen#2217 - awaiting CI

thk123
thk123 previously requested changes Aug 31, 2018
Copy link
Contributor

@thk123 thk123 left a comment

Choose a reason for hiding this comment

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

Yeah turns out TG is using this - will fix up.

@thk123
Copy link
Contributor

thk123 commented Aug 31, 2018

What's the motivation here? Not only is it not unused (this PR removes two uses) but it is non-trivial - it loops back up the expression tree to find the root symbol. It seems your replacements won't work for: a.b.c, previously would get a, now will crash.

Edit: In these cases it doesn't do seem to do anything useful - will see if the same is true in TG. If not, will make a static function in where it is used.

@tautschnig
Copy link
Collaborator

What's the motivation here?

It's just wrong. The root operand of a member_exprt need not be a symbol_exprt. (It could be a struct_exprt, a dereference_exprt, and possibly something else.)

Any current user of this method should use object_descriptor_exprt, use its .build(...), and then .root_object(). When I got to review this PR there hadn't been any edits to users, so I trusted the "it's unused." Otherwise I would have added the above guidance.

@thk123
Copy link
Contributor

thk123 commented Aug 31, 2018

Thanks @tautschnig for the explanation. TG updated to use object_descriptor_exprt - and passed tests locally - will post when CI passes.

@kroening
Copy link
Member Author

Does anyone know why cmake builds are unhappy?

@tautschnig
Copy link
Collaborator

Does anyone know why cmake builds are unhappy?

There are invariant failures in the unit tests. I suppose they should be rewritten in the way I described (using object_descriptor_exprt) rather than as currently done. I'm actually more concerned that it's only in cmake that unit tests fail...

@tautschnig
Copy link
Collaborator

See #2877 for the JBMC unit tests.

@thk123 thk123 dismissed their stale review September 3, 2018 08:53

TG bump passing

@tautschnig tautschnig assigned kroening and unassigned thk123 Sep 3, 2018
@tautschnig tautschnig force-pushed the revert-d47d503b66 branch 4 times, most recently from 96586c8 to 49f5b8d Compare September 4, 2018 07:14
Reverts d47d503; the root operand of a member_exprt need not be a symbol_exprt.
(It could be a struct_exprt, a dereference_exprt, and possibly something else.)
@tautschnig tautschnig merged commit 156faa1 into develop Sep 4, 2018
@tautschnig tautschnig deleted the revert-d47d503b66 branch September 4, 2018 09:02
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: 0099f74).
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).

@thk123
Copy link
Contributor

thk123 commented Sep 4, 2018

This was updated after the bump passed and now causes TG to fail. Please hold off merging if you make substantial (e.g. interface) changes until the TG bump has been updated.

@tautschnig
Copy link
Collaborator

Hmm, sorry, I had understood #2860 (comment) as TG having been cleaned up.

@thk123
Copy link
Contributor

thk123 commented Sep 4, 2018

@tautschnig Fair - it was, but CI was still failing on this PR. Then the changes to the unit test were applied (adding a symbol_tablet parameter to some test utilities) and this broke TG.

Annoyingly in GH there is no way to really see the diff between incremental revisions of a rebased PR (which would have shown the diff to be substantial enough to retest on TG).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants