Skip to content
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

Add new function to inline a list of calls in a goto_program #7550

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

remi-delmas-3000
Copy link
Collaborator

@remi-delmas-3000 remi-delmas-3000 commented Feb 16, 2023

This PR a new function in goto_inline.h and a new method in goto_inline_class.h that
allows to inline a specified set of calls inside a target goto program.

The use case for this is the inlining of function calls in short snippets of goto programs generated during function and loop contract instrumentation, that contain dynamic frame initialisation statements or havoc statements.

The existing inlining functions only allow to inline all calls found in the whole body of a goto function, and do not allow to inline calls inside a small program snippet like needed for contract instrumentation.

The new functions will be exercised/tested as part of the new loop contracts PR #7541.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • 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.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

Seems reasonable enough. It feels like the whole goto_inline infrastructure could do with a tidy up and refactor but that's out of scope for this PR. I get what you are saying about testing but would it be useful to have a unit test for this?

@TGWDB
Copy link
Contributor

TGWDB commented Feb 17, 2023

Seems reasonable enough. It feels like the whole goto_inline infrastructure could do with a tidy up and refactor but that's out of scope for this PR. I get what you are saying about testing but would it be useful to have a unit test for this?

Second the desire for some kind of unit testing.

@feliperodri feliperodri added the aws Bugs or features of importance to AWS CBMC users label Feb 17, 2023
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.

Approving module required Doxygen fixes (see CI job).

@remi-delmas-3000 remi-delmas-3000 force-pushed the inline-program branch 2 times, most recently from 3275a34 to 717ddea Compare February 20, 2023 18:37
@remi-delmas-3000
Copy link
Collaborator Author

@peterschrammel @TGWDB I added a unit test for the new function.

@remi-delmas-3000 remi-delmas-3000 merged commit 761facf into diffblue:develop Feb 21, 2023
@remi-delmas-3000 remi-delmas-3000 deleted the inline-program branch February 21, 2023 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Bugs or features of importance to AWS CBMC users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants