[llvm-commits] [llvm] r47342 - in /llvm/trunk: include/llvm/ include/llvm/Support/ lib/AsmParser/ lib/Bitcode/Writer/ lib/Transforms/IPO/ lib/Transforms/Scalar/ lib/VMCore/ tools/llvm2cpp/
Chris Lattner
clattner at apple.com
Wed Feb 20 11:30:10 PST 2008
>> None of these are absolute hard requirements or rules, they are more
>> of guiding principles. In this case, pulling in FoldingSet.h into
>> Instruction.h means that just about everything that manipulates the
>> IR
>> will get it. This means that .cpp files should have their #include
>> removed (by #2) and it thus makes it less obvious what is happening.
>
> Wow, that's complicated. I've always favored a simple rule:
>
> Anything that refers to a type is responsible for including the header
> that declares it.
We follow the same simple rule. It's just not the whole story :).
It's somewhat interesting to note that the llvm approach is the exact
opposite of the apple 'umbrella header' approach, where you just
#include one thing and you get a zillion headers for everything you
could ever want to do. IMO, that approach encourages people to not
know what is going on, which I think is a bad thing...
-Chris
More information about the llvm-commits
mailing list