Skip to content

Constify collect_virtual_function_callees #4466

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

Conversation

smowton
Copy link
Contributor

@smowton smowton commented Mar 31, 2019

This was always a const operation in spirit, as it retrieves a set of potential virtual function
overrides without making any changes to the GOTO program, but was recently changed to take a non-
const symbol table because it shares code with remove_virtual_function(s), which indeed add new
symbols to the symbol table.

To once again allow calling collect_virtual_function_callees in a const context, this splits the
implementation of remove_virtual_functions into those parts that require a non-const reference and
those for which a const symbol table will suffice.

@smowton smowton force-pushed the smowton/cleanup/allow-collect-callees-const-symbol-table branch from edc313b to 0825a61 Compare March 31, 2019 10:59
: ns(_symbol_table),
symbol_table(_symbol_table),
class_hierarchy(_class_hierarchy)
class remove_virtual_functionst : public get_virtual_calleest
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is "is-a" really the correct relationship? My guess would have been that remove_virtual_functionst uses-a/has-a get_virtual_calleest?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, was really just minimising churn. Changed to use-a.

This was always a const operation in spirit, as it retrieves a set of potential virtual function
overrides without making any changes to the GOTO program, but was recently changed to take a non-
const symbol table because it shares code with remove_virtual_function(s), which indeed add new
symbols to the symbol table.

To once again allow calling collect_virtual_function_callees in a const context, this splits the
implementation of remove_virtual_functions into those parts that require a non-const reference and
those for which a const symbol table will suffice.
@smowton smowton force-pushed the smowton/cleanup/allow-collect-callees-const-symbol-table branch from 0825a61 to 9bc196b Compare March 31, 2019 11:15
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: 9bc196b).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/106467703

@tautschnig tautschnig merged commit e2d44c9 into diffblue:develop Mar 31, 2019
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.

3 participants