Bug 173769 - Remove excessive headers from WebCore/{editing,fileapi,history,html,loader,page}
Summary: Remove excessive headers from WebCore/{editing,fileapi,history,html,loader,page}
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Konstantin Tokarev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-23 07:26 PDT by Konstantin Tokarev
Modified: 2017-07-14 11:25 PDT (History)
7 users (show)

See Also:


Attachments
Patch (32.03 KB, patch)
2017-06-23 07:29 PDT, Konstantin Tokarev
no flags Details | Formatted Diff | Diff
Patch (30.43 KB, patch)
2017-06-23 07:58 PDT, Konstantin Tokarev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Tokarev 2017-06-23 07:26:54 PDT
Remove excessive headers from WebCore/{editing,fileapi,history,html,loader,page}
Comment 1 Konstantin Tokarev 2017-06-23 07:29:06 PDT
Created attachment 313717 [details]
Patch
Comment 2 Konstantin Tokarev 2017-06-23 07:58:36 PDT
Created attachment 313718 [details]
Patch
Comment 3 Simon Fraser (smfr) 2017-06-23 08:59:59 PDT
Comment on attachment 313718 [details]
Patch

Very nice. Did you have some automated way to find these?
Comment 4 Konstantin Tokarev 2017-06-23 09:07:11 PDT
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 5 Konstantin Tokarev 2017-06-23 09:11:27 PDT
Comment on attachment 313718 [details]
Patch

Clearing flags on attachment: 313718

Committed r218748: <http://trac.webkit.org/changeset/218748>
Comment 6 Konstantin Tokarev 2017-06-23 09:11:32 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Michael Catanzaro 2017-06-23 15:30:34 PDT
Maybe one version of that script would be suitable for inclusion under Tools/Scripts?
Comment 8 Konstantin Tokarev 2017-07-14 11:25:40 PDT
(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