[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:03:05 PDT 2009


On May 11, 2009, at 11:59 AM, 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.

-Chris



More information about the llvm-commits mailing list