dwblaikie wrote:

> > The motivation is as usual IWYU and similar refactoring - to reduce build 
> > time and probablility of non-related source(s) recompile.
> 
> I'm confused: as far as I know IWYU achieves the opposite of what you're 
> describing actually: it adds more includes than strictly necessary. (IIUC, 
> the motivation for IWYU is rather correctness and robustness to refactoring 
> and changes).

It can do both - it can remove an unused header, and add a used header that 
might be indirectly depended on. (& can switch an include to a forward 
declaration - or the opposite (if a forward declaration is used, but a 
definition is required and is currently provided indirectly through some other 
#include))

> > Yes, but I actually do not see what part of the mentioned standard' section 
> > conflicts with the change. Would you please suggest an example where we see 
> > a situation when applied IWYU approach can contradict with the part of 
> > Coding Standards?
> 
> I haven't sanity checked your patch: IWYU is just known to historically to 
> the opposite of what we're trying to do in LLVM (as in: "include strictly the 
> minimum and rely on forward declarations"), either the tools was updated to 
> support the LLVM style, or you've been doing a lot of manual work (but then 
> the PR title is misleading).

FWIW, IWYU does do forward declarations ( 
https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/WhyIWYU.md#why-forward-declare
 )

https://github.com/llvm/llvm-project/pull/102707
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to