-
Notifications
You must be signed in to change notification settings - Fork 277
Make JSON symbol table input and output consistent #3726
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
5135862
to
f88d91f
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: f88d91f).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/96648090
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.
Looks good to me, but should likely receive a review from someone who depends on the JSON symbol table.
unit/json_symbol_table.cpp
Outdated
optionst options; | ||
cbmc_parse_optionst::set_default_options(options); | ||
|
||
null_message_handlert null_message_handler; |
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.
You might want to use the one from unit/testing-utils/message.h.
src/util/json_irep.cpp
Outdated
} | ||
|
||
{ | ||
const auto it = json_object.find("comment"); |
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.
Not any more
src/util/symbol.cpp
Outdated
|
||
bool symbolt::operator==(const symbolt &other) const | ||
{ | ||
return type == other.type && value == other.value && |
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.
Suggest for readability do // clang-format off
and list one condition per line
src/util/symbol_table.cpp
Outdated
std::vector<std::pair<irep_idt, irep_idt>> v1; | ||
std::vector<std::pair<irep_idt, irep_idt>> v2; | ||
|
||
for(const auto &pair : internal_symbol_base_map) |
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.
v1(internal_symbol_base_map.begin(), internal_symbol_base_map.end())
, similarly v2
.
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.
We'll need to update gnat2goto, but we can do that when we next bump its cbmc submodule.
5996247
to
8d4ca27
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.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: 5996247).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/96741193
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
8d4ca27
to
a3f38e7
Compare
This adapts the JSON symbol table output function show_symbol_table_json_ui() and the JSON symbol table input function symbol_table_from_json() to use a consistent format.
This adds equality member operators to symbolt and symbol_tablet. They will be useful in unit tests to check that when outputting a symbol table in JSON and reading it back in again the same symbol table is obtained.
…istency The unit test first outputs a symbol table to JSON via show_symbol_table() and then reads it back in again via symbol_table_from_json(). Then, it checks that the initial symbol table and the symbol table read back in again are equal.
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: 8d4ca27).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/96741962
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.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: a3f38e7).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/96747712
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
Uh oh!
There was an error while loading. Please reload this page.