-
Notifications
You must be signed in to change notification settings - Fork 274
Cleanup types [DOC-12] #2815
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
Cleanup types [DOC-12] #2815
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 think this is great cleanup work, though it may be better to do some of this in several small PRs for work not to be held up in case some of it turns out to be controversial.
src/util/type.cpp
Outdated
@@ -12,7 +12,6 @@ Author: Daniel Kroening, [email protected] | |||
|
|||
#include "type.h" | |||
#include "std_types.h" | |||
#include "namespace.h" |
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 (and this would make me rather happy) std_types.h
could go as well? That finally resolves a dependency that should not have existed in the first place...
@@ -16,6 +16,7 @@ Author: Chris Smowton, [email protected] | |||
#include <set> | |||
#include <unordered_set> | |||
#include <util/symbol_table.h> | |||
#include <util/namespace.h> |
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.
Nit pick: please sort lexicographically.
src/util/std_types.cpp
Outdated
@@ -15,6 +15,7 @@ Author: Daniel Kroening, [email protected] | |||
#include "string2int.h" | |||
#include "arith_tools.h" | |||
#include "std_expr.h" | |||
#include "namespace.h" |
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.
As above: please sort lexicographically, likely making a slightly bigger change than necessary (sort all of them).
src/util/std_expr.h
Outdated
@@ -20,7 +20,7 @@ Author: Daniel Kroening, [email protected] | |||
#include "invariant.h" | |||
#include "std_types.h" | |||
#include "expr_cast.h" | |||
|
|||
#include "mathematical_types.h" |
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.
Nit pick: maintain/establish lexicographic sorting
src/util/c_types.h
Outdated
@@ -11,6 +11,7 @@ Author: Daniel Kroening, [email protected] | |||
#define CPROVER_UTIL_C_TYPES_H | |||
|
|||
#include "std_types.h" | |||
#include "mathematical_types.h" |
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 guess that's really just for complex_typet
? Maybe keep that in std_types.h
?
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.
It's a mathematical type so if we're moving some of them into a separate file, it only makes sense if we really move all of them. Is there any particular reason why this stands out for you?
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 thought it was the one that's actually used by C/C++ front-ends, but maybe it's not even the only one.
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.
You are right, there is std::complex
type, moving back to std_types
.
f1a227f
to
6fee370
Compare
@tautschnig We only had one day booked for doc changes and I'm already out of time :) I'll make sure those issues are put on the next doc day to-do list. |
6fee370
to
5b701e2
Compare
I've split out two of the changes into separate PRs: |
3a53602
to
3a29698
Compare
I know, I'm greedy :-) Thanks a lot for all the work! |
3a29698
to
08d7b44
Compare
Test-gen pointer bump: https://github.com/diffblue/test-gen/pull/2192 |
I find the can_cast_type<symbol_typet>(type1) idiom to be hard to read, and it doesn't add value beyond the one-off. We should not do that. |
Yes, the comment in guidelines was exactly my motivation to add missing cast checks. |
There is a failing test on the test-gen pointer bump, I will investigate it later. Until then I added |
@tautschnig Yes; I understand the motivation for can_cast. However, I'd still like to stick to the if(x.id() ==ID_Z) idiom. In particular, we can then eventually do switch(x.id()). |
08d7b44
to
3ced6c7
Compare
@kroening Introducing |
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 PR failed Diffblue compatibility checks (cbmc commit: 3ced6c7).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84437357
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
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: 3ced6c7).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84452470
3ced6c7
to
1a28613
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: 1a28613).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84984878
This is a follow-up PR to #2771 (it is based on top of it so please ignore the
Add documentation
commits until it's merged and rebased).