-
Notifications
You must be signed in to change notification settings - Fork 280
remove typet::subtype() #7561
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
remove typet::subtype() #7561
Conversation
4a637ee
to
54a89ab
Compare
54a89ab
to
0f8ccde
Compare
Codecov ReportBase: 78.43% // Head: 78.49% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #7561 +/- ##
===========================================
+ Coverage 78.43% 78.49% +0.06%
===========================================
Files 1670 1670
Lines 191671 191678 +7
===========================================
+ Hits 150331 150464 +133
+ Misses 41340 41214 -126
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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 think the missing call to bitvector_typet::check
should ideally be fixed before this is merged.
You mention that a lack of mixins prevents usage of type_with_subtypet
, which presumably results in the need to write duplicate definitions of the subtype()
member functions. I think the Curiously Recurring Template Pattern (CRTP) could be used add in subtype()
member functions to the classes in the hierarchy which still require them instead. However that would be a different refactor which I do not think should hold up this PR.
const typet &type, | ||
const validation_modet vm = validation_modet::INVARIANT) | ||
{ | ||
type_with_subtypet::check(type, vm); |
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 function should include a call to bitvector_typet::check
as well, because the new function hides the existing one.
This adds specialised variants of typet::subtype() to the three inheriting classes that use the method. These cannot use type_with_subtypet since C++ doesn't have mixins. The plan is to remove these methods in favor of the existing type-specific accessor methods. After that, typet::subtype() can be removed.
0f8ccde
to
907e28f
Compare
This adds specialised variants of
typet::subtype()
to the three inheriting classes that use the method. These cannot usetype_with_subtypet
since C++ doesn't have mixins. The plan is to remove these methods in favor of the existing type-specific accessor methods.After that,
typet::subtype()
can be removed.