sarojvarma / include-what-you-use

Automatically exported from code.google.com/p/include-what-you-use
Other
0 stars 0 forks source link

Detect #includes which are only needed by unnecessarily-inline functions #48

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Given a header file like this one:

#include <SomeLargeClass.h>

struct X {
  void f(const SomeLargeClass &c) {
    // lots of code here
  }
};

... it would be great if iwyu could say something like "moving definition of 
'f' to .cpp file would allow removing include of <SomeLargeClass.h>".

It would be especially great if this warning could be produced only when the 
user(s) of the given include are all functions large enough that they are not 
likely to be inlined (and aren't required to be in the header due to being 
templates or constexpr).

Original issue reported on code.google.com by rich...@metafoo.co.uk on 7 Jul 2011 at 5:24

GoogleCodeExporter commented 9 years ago
I agree it would be great, but is a bit out of the scope of what iwyu is trying 
to do (at least for now).  I'll keep this open as an feature request, but lower 
its priority.

I think once basic iwyu functionality is more stable, it would make sense to 
start thinking about how to extend what iwyu is trying to do.

Original comment by csilv...@gmail.com on 7 Jul 2011 at 6:00