Skip to content
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

seastar/testing: only include used headers #2413

Closed
wants to merge 1 commit into from

Conversation

tchaikov
Copy link
Contributor

including unused header hurts the readability of source code. and could potentially slow down the compiling.

these unused headers were identified with clang-include-cleaner with following process:

  1. ./configure.py --disable-dpdk --compiler clang++ \ --compile-commands-json --mode debug
  2. find include/seastar/testing -name *.hh \ -exec echo {} ; \ -exec clang-include-cleaner --print=changes -p build/debug {} ;
  3. audit all the reported unused headers, check if they are used or not by inspecting the header files in the report, and remove the includes which are not used. add the marks to the one which are actually used.

the "IWYU" marks are documented at
https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md, since clang's include-cleaner supports IWYU pragma. they are used to prevent the false alarms in future.

including unused header hurts the readability of source code. and
could potentially slow down the compiling.

these unused headers were identified with clang-include-cleaner
with following process:

1. ./configure.py --disable-dpdk --compiler clang++ \
   --compile-commands-json --mode debug
2. find include/seastar/testing -name *.hh \
    -exec echo {} \; \
    -exec clang-include-cleaner --print=changes -p build/debug {} \;
3. audit all the reported unused headers, check if
   they are used or not by inspecting the header
   files in the report, and remove the includes which
   are not used. add the marks to the one which are
   actually used.

the "IWYU" marks are documented at
https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md,
since clang's include-cleaner supports IWYU pragma. they are used
to prevent the false alarms in future.

Signed-off-by: Kefu Chai <[email protected]>
@xemul xemul closed this in 644bb66 Aug 30, 2024
niekbouman pushed a commit to niekbouman/seastar that referenced this pull request Sep 16, 2024
including unused header hurts the readability of source code. and
could potentially slow down the compiling.

these unused headers were identified with clang-include-cleaner
with following process:

1. ./configure.py --disable-dpdk --compiler clang++ \
   --compile-commands-json --mode debug
2. find include/seastar/testing -name *.hh \
    -exec echo {} \; \
    -exec clang-include-cleaner --print=changes -p build/debug {} \;
3. audit all the reported unused headers, check if
   they are used or not by inspecting the header
   files in the report, and remove the includes which
   are not used. add the marks to the one which are
   actually used.

the "IWYU" marks are documented at
https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md,
since clang's include-cleaner supports IWYU pragma. they are used
to prevent the false alarms in future.

Signed-off-by: Kefu Chai <[email protected]>

Closes scylladb#2413
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant