-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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 unused headers in servers #100634
Remove unused headers in servers #100634
Conversation
Seems like
|
Looks good! Could you squash the commits? See PR workflow for instructions. |
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
Sorry, left for a while. Squashed. |
BTW, I'd be interested in knowing your workflow for identifying these unused headers. I've tried to use iwyu for this exact use case in the past, but I could only get it to add includes that are used through existing explicit includes (which would bloat things considerably, as we tend to expect that including e.g. Edit: Closed by mistake. |
Actually clangd is enough for identifying unused header. Everytime I open a file in vscode there are unused header warnings which is annoying and finally I decide to clean up them. iwyu gives some more aggressive suggestions, like replace some headers with forward declarations. core/os/memory.h should add these lines:
#include "core/typedefs.h" // for _FORCE_INLINE_, _ALWAYS_INLINE_
template <typename T> class SafeNumeric;
core/os/memory.h should remove these lines:
- #include <type_traits> // lines 39-39
- #include "core/templates/safe_refcount.h" // lines 35-35 I'm currently evaluating how much build time they can save, and may pick some big improvements (if there are any) without sacrificing readability. |
Thanks! |
Followup #100564
Cleanup includings in
servers/
, remove unused headers, replace headers used for transitive include, move headers down in the include chain if possible.