On Saturday 2013-08-03 13:36 +1000, Nicholas Nethercote wrote:
> > # Header dependency hell
> 
> I've recently done a bunch of work on improving the header situation
> in SpiderMonkey.  I can break it down to two main areas.
> 
> == MINIMIZING #include STATEMENTS ==
> 
> There's a clang tool called "include-what-you-use", a.k.a. "IWYU"
> (http://code.google.com/p/include-what-you-use/).  It tells you
> exactly which headers should be included in all your files.  I've used
> it to minimize #includes somewhat already
> (https://bugzilla.mozilla.org/show_bug.cgi?id=634839) and I plan to do
> some more Real Soon Now
> (https://bugzilla.mozilla.org/show_bug.cgi?id=888768).  There are
> still a couple of hundred unnecessary #include statements in
> SpiderMonkey.  (BTW, SpiderMonkey has ~280 .cpp files and ~370 .h
> files.)

This tool sounds great.  I suspect there's even more to be gained
that it can't detect, though, from things that are used, but could
easily be made not used.

I did a few passes of poking through .deps/*.pp files, and looking
for things I thought didn't belong.  It's been a while, though.
(See bug 64023.)

khuey was also recently working on something to reduce some pretty
bad #include fanout related to the new DOM bindings generation.
(I'm not sure if it's landed.)

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to