-
Notifications
You must be signed in to change notification settings - Fork 274
Use goto_functiont::parameter_identifiers and remove goto_functiont::type #4167
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
Use goto_functiont::parameter_identifiers and remove goto_functiont::type #4167
Conversation
Also marking this do-not-review: I should try to break this up into a series of smaller commits that prepare the final change. |
@tautschnig For a long list of reasons, it's best to get rid of the identifiers in |
On a side note: I've seen an issue with function pointer types recently: i.e. a function pointer variable has the original return type whereas the symbol table has return type void for the pointed function after the remove_return pass. Type consistency validations fail due to that. |
On the side note: One cleanup item on my list is to change the way remove_returns works: the idea is to keep the return type as is. This removes the need to keep a copy of the original return type. |
This is to enable a transition towards #4167.
a1631f1
to
2ec3300
Compare
This is to enable a transition towards diffblue#4167.
This is to enable a transition towards #4167.
This is to enable a transition towards #4167.
Store identifiers of parameters in goto_functiont::parameter_identifiers [blocks: #4167]
9004219
to
d69301e
Compare
I would leave the note about |
d69301e
to
09290cc
Compare
Done, and updated - assuming that was the comment you were after. |
09290cc
to
67aa39c
Compare
Apologies for iterating on this PR. The PR goes beyond the parameter identifiers, and also touches the "is hidden" feature. The question of whether or not the execution of a functions should be hidden is a property of the body (it's triggered via a label in the body), and not a property of the function signature. It should therefore be in goto_functiont, and not the type. |
Codecov Report
@@ Coverage Diff @@
## develop #4167 +/- ##
============================================
- Coverage 69.32% 48.48% -20.84%
============================================
Files 1241 1005 -236
Lines 100406 84594 -15812
============================================
- Hits 69604 41014 -28590
- Misses 30802 43580 +12778
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@tautschnig Do you want this reviewed as is? |
That all makes sense, but really means I should first revert #4312. I'll create a PR to that effect. |
The "is hidden" PR is now posted as #5575. |
67aa39c
to
f3f4da1
Compare
@kroening @martin-cs This is now rebased on top of the changes implementing "is hidden" as requested. |
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.
Seems good.
src/goto-programs/goto_function.h
Outdated
/// The identifiers of the parameters of this function | ||
/// | ||
/// Note: This is now the preferred way of getting the identifiers of the | ||
/// parameters. The identifiers in the type will go away. | ||
/// parameters. The identifiers in the type are now gone. |
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.
😄 nice!
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.
I am afraid they are still there. "The type" here refers to the type in the symbol table.
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.
Err, true. Change to the comment reverted/dropped.
Future changes will remove this member as it is redundant with the information stored in the symbol table. We keep writing to it so as not to break any users, but no longer read it.
Having two function type definitions (one in the symbol table and one in goto_functiont) is just prone to become inconsistent. Instead, always look at the symbol table when we do need type information. If all we care about are the identifiers we can still use goto_functiont::parameter_identifiers.
f3f4da1
to
33d85ff
Compare
Having two function type definitions (one in the symbol table and one in
goto_functiont) is just prone to become inconsistent. Instead, always look at
the symbol table when we do need type information. If all we care about are the
identifiers we can still use goto_functiont::parameter_identifiers.
I'm also marking this RFC, @kroening in particular: it's quite painful to maintain consistency betweenparameter_identifiers
andcode_typet::parameters()
- do we really needparameter_identifiers
, or shouldn't we instead always use the information stored in the type?