Skip to content

Add namespacet::follow_struct_union_tag to simplify follow_tag uses #8248

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

tautschnig
Copy link
Collaborator

Replacing namespacet::follow by namespacet::follow_tag produced several instances that require expanding composite data types, without a need to distinguish structs vs unions.

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

@@ -92,6 +92,15 @@ namespace_baset::follow_tag(const c_enum_tag_typet &src) const
return to_c_enum_type(symbol.type);
}

const struct_union_typet &follow_struct_union_tag(const tag_typet &src) const
Copy link
Member

Choose a reason for hiding this comment

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

How about introducing an intermediate struct_or_union_tag_typet, which becomes the base case of struct_tag_typet and union_tag_typet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed, I should have done this right away. Is now included.

Replacing namespacet::follow by namespacet::follow_tag produced several
instances that require expanding composite data types, without a need to
distinguish structs vs unions.
@tautschnig tautschnig force-pushed the features/follow-struct_union_tag branch from db81667 to 6cea206 Compare March 22, 2024 11:21
Copy link

codecov bot commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 79.64%. Comparing base (ddb4060) to head (6cea206).
Report is 1 commits behind head on develop.

Files Patch % Lines
src/util/namespace.cpp 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8248      +/-   ##
===========================================
- Coverage    79.64%   79.64%   -0.01%     
===========================================
  Files         1684     1684              
  Lines       195661   195670       +9     
===========================================
+ Hits        155837   155841       +4     
- Misses       39824    39829       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

/// APIs, no instances of this one can be created directly, use \ref
/// struct_tag_typet or \ref union_tag_typet when creating objects.
class struct_or_union_tag_typet : public tag_typet
{
Copy link
Member

Choose a reason for hiding this comment

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

I'd put that into c_types.h; it really is.

Copy link
Member

Choose a reason for hiding this comment

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

ah no, needed for struct_tag_typet

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we have the same situation with struct_union_typet.

@tautschnig tautschnig merged commit e7b0557 into diffblue:develop Mar 22, 2024
38 of 40 checks passed
@tautschnig tautschnig deleted the features/follow-struct_union_tag branch March 22, 2024 14:10
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.

3 participants