Remove excessive headers from WebCore/{editing,fileapi,history,html,loader,page}
Created attachment 313717 [details] Patch
Created attachment 313718 [details] Patch
Comment on attachment 313718 [details] Patch Very nice. Did you have some automated way to find these?
Yes, see https://github.com/annulen/remove-unused-headers There remove-unused-headers-ctags.pl is the main script, it uses ctags database generated with run_ctags.sh (note that Universal Ctags is required, Exuberant Ctags doesn't understand all C++11 we use) I did no comparison with https://include-what-you-use.org/, I was just interested if "dumb" approach can be good enough. Though I'm pretty sure that my script runs faster :)
Comment on attachment 313718 [details] Patch Clearing flags on attachment: 313718 Committed r218748: <http://trac.webkit.org/changeset/218748>
All reviewed patches have been landed. Closing bug.
Maybe one version of that script would be suitable for inclusion under Tools/Scripts?
(In reply to Michael Catanzaro from comment #7) > Maybe one version of that script would be suitable for inclusion under > Tools/Scripts? I've tried to use my script to remove includes from .cpp files (r218890) and some out-of-tree code, and found that it still does too many errors, i.e. removes headers that should be kept. Until it's fixed, script probably won't be useful for others because of extra work needed to fix up results. I still haven't got time to fix it