-
Notifications
You must be signed in to change notification settings - Fork 277
Clean-up and document symex_function_call [DOC-150] #4080
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
Clean-up and document symex_function_call [DOC-150] #4080
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.
Could "Move and make static symex_end_of_function" please be skipped? If we go this route, we will eventually have a single file containing all source code.
That would be better because more efficient. |
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: 13ce1de).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/99785216
Fully agreed, just the other day I had to make some changes in |
Yes, so I don't see the problem with that particular commit, since it's reducing the dependencies between different cpp files, it will make it a little bit easier. |
It's moving code that is entirely specific to dealing with function calls to |
13ce1de
to
f7d8891
Compare
OK, I see the point and will drop it. I still think grouping |
This may be true as far as compiling code is concerned, but at a more abstract level |
src/goto-symex/goto_symex.h
Outdated
@@ -271,25 +271,41 @@ class goto_symext | |||
|
|||
virtual void loop_bound_exceeded(statet &, const exprt &guard); | |||
|
|||
// function calls | |||
/// Assuming \p state is currently pointing on a return instruction, assign |
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.
The state doesn't point, maybe the program counter inside it?
src/goto-symex/goto_symex.h
Outdated
@@ -271,25 +271,41 @@ class goto_symext | |||
|
|||
virtual void loop_bound_exceeded(statet &, const exprt &guard); | |||
|
|||
// function calls | |||
/// Assuming \p state is currently pointing on a return instruction, assign | |||
/// the value in that return to the top frame's \p return_value field. | |||
void return_assignment(statet &); |
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.
Is this actually dead code? return-value removal should render it such.
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.
Indeed it looks like it, I've added a commit to replace the call to this by an UNREACHABLE
src/goto-symex/goto_symex.h
Outdated
@@ -300,6 +316,12 @@ class goto_symext | |||
unsigned thread_nr, | |||
unsigned unwind); | |||
|
|||
/// Iterates over \p arguments and assign them to the parameters, which are |
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.
assigns
src/goto-symex/goto_symex.h
Outdated
@@ -300,6 +316,12 @@ class goto_symext | |||
unsigned thread_nr, | |||
unsigned unwind); | |||
|
|||
/// Iterates over \p arguments and assign them to the parameters, which are | |||
/// symbols whose name and type are deduce from the type of \p goto_function. |
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.
deduced
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: f7d8891).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/99811235
6dcf197
to
16c8165
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: 16c8165).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/99899024
@peterschrammel this is ready for review |
src/goto-symex/goto_symex.h
Outdated
virtual void no_body(const irep_idt &) | ||
{ | ||
} | ||
|
||
/// Symbolic execution of a function call. | ||
/// Only functions that are symbols are supported, see | ||
/// \link goto_symext::symex_function_call_symbol \endlink |
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.
\ref doesn't work here?
This function is only used within the same cpp file. Making it static simplifies the global interface and is potentially more efficient.
locality is only used in symex_function_call.cpp, it can be made static. This simplifies the symex interface and is potentially more efficient.
This documents (mostly in goto_symex.h) functions that are defined in symex_function_call.cpp.
The return instructions should have been removed by return-value removal, so they should not reach symex. We replace this case by an unreachable statement and remove the method that is now unused.
16c8165
to
7dc47a4
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: 7dc47a4).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/100121863
Make a couple of functions static and add documentation where missing.