-
Notifications
You must be signed in to change notification settings - Fork 273
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
Add namespacet::follow_struct_union_tag to simplify follow_tag uses #8248
Conversation
src/util/namespace.cpp
Outdated
@@ -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 |
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.
How about introducing an intermediate struct_or_union_tag_typet
, which becomes the base case of struct_tag_typet
and union_tag_typet
.
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.
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.
db81667
to
6cea206
Compare
Codecov ReportAttention: Patch coverage is
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. |
/// 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 | ||
{ |
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.
I'd put that into c_types.h
; it really is.
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.
ah no, needed for struct_tag_typet
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.
Yes, we have the same situation with struct_union_typet
.
Replacing namespacet::follow by namespacet::follow_tag produced several instances that require expanding composite data types, without a need to distinguish structs vs unions.