Closed Bug 557565 Opened 15 years ago Closed 7 years ago

Create a static analysis script for detecting unneeded #include statements

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 903843

People

(Reporter: ehsan.akhgari, Assigned: mwu)

References

Details

We have a habit of including everything everywhere. This hurts compile times because: 1. The compiler has to read more files. 2. More files will be rebuilt when a header is changed that needed. 3. This makes things like ccache not provide us as much benefit as they would otherwise. We were talking about a static analysis script which can detect which #include statements are not needed in a translation unit, and can be removed. Here's the bug to ask the wonderful static analysis folks to make it happen!
Andrew, I seem to remember you mentioning writing a script for this ... do I remember correctly?
Blocks: 583074
OS: Mac OS X → All
Hardware: x86 → All
A Google employee is working on a clang-based tool to do just this: http://code.google.com/p/include-what-you-use/ This is already being tried out on the JS Engine in Bug 634839.
(In reply to comment #2) > A Google employee is working on a clang-based tool to do just this: > http://code.google.com/p/include-what-you-use/ > This is already being tried out on the JS Engine in Bug 634839. So is mwu :) His version will patch the code too
Assignee: nobody → mwu
Looks like theirs does a bit more but then again, they've been working on their tool longer.
Product: Core → Firefox Build System
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.