[llvm-commits] [llvm] r71426 - in /llvm/trunk: include/llvm/Target/TargetData.h lib/Target/TargetData.cpp

Chris Lattner clattner at apple.com
Mon May 11 12:41:32 PDT 2009


Thanks Jay!

On May 11, 2009, at 12:41 PM, Jay Foad wrote:

>>>>> +++ llvm/trunk/include/llvm/Target/TargetData.h Mon May 11  
>>>>> 06:13:47 2009
>>>>> @@ -23,13 +23,12 @@
>>>>> #include "llvm/Pass.h"
>>>>> #include "llvm/Support/DataTypes.h"
>>>>> #include "llvm/ADT/SmallVector.h"
>>>>> +#include "llvm/DerivedTypes.h"
>>>>
>>>> Can you just use a forward declaration of IntegerType instead of a
>>>> #include?
>>>
>>> Yes, but then whenever a .cpp file does "const Type *Ty =
>>> TD->getIntPtrType()", it needs to include DerivedTypes.h instead.  
>>> (In
>>> practice this only affects one .cpp file.)
>>>
>>> Nick Lewycky asked the same question, so I posted patches to do it
>>> both ways (subject was "TargetData::getIntPtrType() to return
>>> IntegerType"), and I thought you had explicitly OKed this version.
>>
>> Ok, sorry, I missed the distinction.  I prefer to force .cpp files to
>> #include the headers they use.
>
> OK, I've committed the other version:
>
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090511/077398.html
>
> Thanks,
> Jay.




More information about the llvm-commits mailing list