Skip to content

Expr-to-C: output type information with nondet_symbol #7675

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
merged 1 commit into from
May 18, 2023

Conversation

tautschnig
Copy link
Collaborator

This is a debugging aid to make the output of --program-only more helpful when trying to see whether a call to malloc/calloc included type information (via a sizeof annotation).

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a 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).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov
Copy link

codecov bot commented Apr 20, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01 🎉

Comparison is base (889a84b) 78.54% compared to head (1a22d3e) 78.55%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7675      +/-   ##
===========================================
+ Coverage    78.54%   78.55%   +0.01%     
===========================================
  Files         1686     1686              
  Lines       192905   192905              
===========================================
+ Hits        151512   151536      +24     
+ Misses       41393    41369      -24     
Impacted Files Coverage Δ
src/ansi-c/expr2c.cpp 67.75% <100.00%> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@TGWDB TGWDB left a comment

Choose a reason for hiding this comment

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

Approve as a simple improvement, but it does question whether other places should also have type information.

TGWDB added a commit that referenced this pull request May 3, 2023
@TGWDB TGWDB mentioned this pull request May 3, 2023
7 tasks
@@ -1663,7 +1663,7 @@ std::string expr2ct::convert_symbol(const exprt &src)
std::string expr2ct::convert_nondet_symbol(const nondet_symbol_exprt &src)
{
const irep_idt id=src.get_identifier();
return "nondet_symbol("+id2string(id)+")";
return "nondet_symbol<" + convert(src.type()) + ">(" + id2string(id) + ")";
Copy link
Member

Choose a reason for hiding this comment

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

Do we use that syntax elsewhere? An alternative would be cast syntax?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe that the output of --program-only is the only place where this can currently be observed.

TGWDB added a commit that referenced this pull request May 11, 2023
TGWDB added a commit that referenced this pull request May 11, 2023
@tautschnig tautschnig reopened this May 18, 2023
This is a debugging aid to make the output of `--program-only` more
helpful when trying to see whether a call to malloc/calloc included type
information (via a sizeof annotation).
@tautschnig tautschnig force-pushed the features/nondet-type-info branch from dbbc575 to 1a22d3e Compare May 18, 2023 08:32
@tautschnig tautschnig merged commit 3de13cc into diffblue:develop May 18, 2023
@tautschnig tautschnig deleted the features/nondet-type-info branch May 18, 2023 11:19
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