Skip to content

Cleanup in string preprocessing #3189

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

Conversation

romainbrenguier
Copy link
Contributor

This is based on #2374
The goal is to ensure location is set for each created symbol.

  • 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.
  • 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

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: 2b45d80).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88131981

Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

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

Looks good, one thing to check re: get-fresh-java-symbol, and also please check you intended to include a models lib bump in this PR

const source_locationt &source_location,
symbol_table_baset &symbol_table)
{
const std::string name_prefix = id2string(source_location.get_function());
Copy link
Contributor

Choose a reason for hiding this comment

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

Check you got a real source loc in this case (or handle the no-source-loc case somehow)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe @peterschrammel has comment on this (or a similar case) elsewhere: this seems actually wrong, instead the internal identifier of the function should be passed in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes the conversation was on #2374, I will copy it here so that it doesn't get lost now that 2374 is closed, and address it when I have time to get back to this PR.

tautschnig 13 days ago Collaborator
I strongly believe that the information in the source_location is a string aimed at the user, and should relate to whatever is found in the source. The actual identifier of the function (the key in goto_functionst::function_map) used internally may be entirely different. I don't know which one is required here.

peterschrammel 13 days ago Member
Here, something is required that is unique to a goto function. Reason: adding a function to a goto model must not affect the identifiers of another function. This was the source of many goto-diff bugs in the past.

tautschnig 13 days ago Collaborator
Then a function_id must be passed in. In some call sites in this PR this would be symbol.name, others require further digging.

@romainbrenguier romainbrenguier force-pushed the clean-up/preprocessing-part2 branch 5 times, most recently from 3fbce70 to 23e5054 Compare November 16, 2018 10:37
@romainbrenguier romainbrenguier force-pushed the clean-up/preprocessing-part2 branch from 23e5054 to 293ec8e Compare November 16, 2018 11:45
@romainbrenguier romainbrenguier force-pushed the clean-up/preprocessing-part2 branch 8 times, most recently from cad1a55 to d917737 Compare February 6, 2019 09:35
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: 8de539f).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/99921522

@romainbrenguier romainbrenguier force-pushed the clean-up/preprocessing-part2 branch 5 times, most recently from 7c08bc0 to 6997a76 Compare February 8, 2019 07:55
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: 6997a76).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/100205172

Add const keyword at the declaration of variables that will not get
modified.
In some case, we inline them instead to avoid declaration, when
declaration doesn't add value.
In other cases, we don't make the variable const but use move where it
is used.

fixup! Add missing const's
@romainbrenguier romainbrenguier force-pushed the clean-up/preprocessing-part2 branch 2 times, most recently from f6d19c1 to 5d88421 Compare February 8, 2019 12:36
This is in preparation to giving the function_id to the function
generating fresh java symbols.
This is in preparation for giving function_id as an argument to the
function creating fresh java symbols.
This is in preparation for adding the function_id to the function
generating fresh java symbols.
This is in preparation for giving the function name to the function
generating fresh java symbols.
This is in preparation for giving the function name to the function
generating fresh java symbols.
This is in preparation to giving the function_id to the function
generating fresh java symbols.
This function is not used, there is no point in keeping it.
This is in preparation to giving the function_id to the function
generating fresh java symbols.
@romainbrenguier romainbrenguier force-pushed the clean-up/preprocessing-part2 branch from 5d88421 to e3a18bd Compare February 8, 2019 12:57
This is in preparation for using a new fresh_java_symbol function which
takes a function_id as parameter.
This is in preparation to giving the function_id to the function
generating fresh java symbols.
This prevents forgetting that the basename of the symbol should be the
function identifier.
No functional changes.
@romainbrenguier romainbrenguier force-pushed the clean-up/preprocessing-part2 branch from e3a18bd to e81e174 Compare February 8, 2019 13:41
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: e81e174).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/100241422

@romainbrenguier
Copy link
Contributor Author

@tautschnig I got rid of all the get_function calls

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.

Thanks a lot for the large-scale cleanup and updates!

@tautschnig tautschnig merged commit 4bb7393 into diffblue:develop Feb 8, 2019
@romainbrenguier romainbrenguier deleted the clean-up/preprocessing-part2 branch February 11, 2019 07:56
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.

5 participants