-
Notifications
You must be signed in to change notification settings - Fork 274
vector_typet::size() is now a constant_exprt #4007
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
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'm pretty sure this requires further changes in the code base, but of course the stricter type enforcement is good.
: type_with_subtypet(ID_vector, _subtype) | ||
{ | ||
size() = _size; | ||
} |
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.
What's the rationale to move these to the .cpp file?
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.
constant_exprt
isn't complete -- there's a cyclic dependency between std_types.h and std_expr.h.
@tautschnig The problem is that there's a period of time in both front-ends where the expression isn't yet turned into a constant. I might have to introduce s.th. like |
11f2cd1
to
d7150a1
Compare
Added ID_frontend_vector, similar to ID_frontend_pointer, for the type that's yet to be finished. |
d7150a1
to
ab89f8f
Compare
This enables distinguishing the case of a size that is an arbitary expression from the case where the size is required to be constant.
The codebase assumes basically globally that vector_typet::size() is a constant_exprt. This is now enforced by the signature.
ab89f8f
to
41e4913
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: 41e4913).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/99471857
The codebase assumes basically globally that vector_typet::size() is a
constant_exprt. This is now enforced by the signature.