-
Notifications
You must be signed in to change notification settings - Fork 274
Remove unnecessary includes #7235
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
bac0f77
to
a0cf7f0
Compare
Codecov ReportBase: 78.34% // Head: 78.03% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #7235 +/- ##
===========================================
- Coverage 78.34% 78.03% -0.31%
===========================================
Files 1644 1625 -19
Lines 190313 187422 -2891
===========================================
- Hits 149097 146252 -2845
+ Misses 41216 41170 -46
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. |
a0cf7f0
to
375e82a
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.
Thanks for this clean up!
@chris-ryder Could you please take a look at this 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.
Looks like a painful, but very useful cleanup!
c22cea8
to
da93c7f
Compare
#include <util/nodiscard.h> | ||
|
||
#include <solvers/smt2_incremental/ast/smt_responses.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.
response_or_errort
handles the type it is specialised with by-value like optional does. response_or_errort
is specialised with smt_responset
for the return value of validate_smt_response
. Therefore I would say that it is incorrect to remove this include as it is used.
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 have now added // IWYU pragma: keep
instead.
@@ -13,7 +13,6 @@ | |||
|
|||
#include <functional> | |||
#include <iostream> | |||
#include <sstream> |
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.
std::stringstream
is used in the smt_to_smt2_string
function (all overloads) and is defined in the <sstream>
header. Therefore this include should not be removed, as it is used. I assume this file still compiles without the include due to transitive includes of some type. My understanding is that some of these transitive includes can be in implementations of the STL but not required by the standard.
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 have now added // IWYU pragma: keep
instead.
|
||
#include <solvers/smt2_incremental/ast/smt_terms.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.
smt_termt
is defined in smt_terms.h
and is used in the definition of type_size_mapt
in this file. Therefore this include should be kept.
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 have now added // IWYU pragma: keep
instead.
|
||
#include <solvers/smt2_incremental/ast/smt_commands.h> | ||
#include <solvers/smt2_incremental/ast/smt_logics.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.
The logics defined in this header are used as part of the "Test smt_set_logic_commandt to string conversion" test in this file. Removing the include still compiles as it depends on a transitive include via smt_commends.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 have now added // IWYU pragma: keep
instead.
da93c7f
to
e0080b3
Compare
f3c9220
to
ae5a2b6
Compare
8f7394b
to
ddebc88
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.
All areas I am maintainer for look good.
There was a spurious include of the implementation file rather than the header.
The empty namespace will lack symbol information that may be needed, and is just unnecessary anyway.
6b88028 removed the existing test (for good reasons) but didn't replace it with any other.
Whitespace cleanup only so as not to break syntax highlighting.
This enables use of symbol_table_baset instead of symbol_tablet in many places.
We almost never create a fresh symbol table, and any time we do so we should really make sure this is the intended behaviour.
This is to make sure that we can run include-what-you-use without being told to remove includes when doing so would fail the build.
ddebc88
to
5712417
Compare
Manual removal of includes based on include-what-you-use's output, filtered for includes that should be removed. The goal is to avoid unnecessary build dependencies, reducing the amount of code that needs to be rebuilt during incremental builds. This is a second iteration of this cleanup; the first round took place in 450845d.
This is to make sure that future pull requests do not introduce unnecessary includes (or remove ones that are no longer necessary).
5712417
to
a8514e0
Compare
Manual removal of includes based on include-what-you-use's output, filtered for includes that should be removed. The goal is to avoid unnecessary build dependencies, reducing the amount of code that needs to be rebuilt during incremental builds.
This is a second iteration of this cleanup; the first round took place in 450845d.