[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/

Dale Johannesen dalej at apple.com
Wed Feb 20 11:38:01 PST 2008


On Feb 20, 2008, at 11:30 AM, Chris Lattner wrote:

>>> 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 :).

Not really, your principle #2 example above contradicts mine.
I would have the include in both places in that circumstance.

> 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
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list