[LLVMdev] Data layout hard coded for X86 target
Chris Lattner
clattner at apple.com
Mon Jul 5 09:30:07 PDT 2010
On Jul 5, 2010, at 3:31 AM, Óscar Fuentes wrote:
> Chris Lattner <clattner at apple.com> writes:
>
>> On Jul 4, 2010, at 6:43 PM, Óscar Fuentes wrote:
>>
>>> In X86Subtarget.h there is a method `getDataLayout' which selects the
>>> data layout depending on the platform, ignoring whatever the user setted
>>> with Module::setDataLayout.
>>>
>>> What's the rationale for this?
>>
>> Data layout is a property of the target, not the program being
>> compiled. If you don't like structure packing etc, use packed
>> structure types.
>
> Then, Module::setDataLayout should be removed or make it fail on those
> circunstances, shouldn't it?
I'm not opposed to having it fail when something semantic (like the alignment of double) is wrong. The hints like the 'native integer types' should not cause it to fail.
-Chris
More information about the llvm-dev
mailing list