[LLVMdev] Data layout hard coded for X86 target

Chris Lattner clattner at apple.com
Mon Jul 5 12:55:32 PDT 2010


On Jul 5, 2010, at 10:24 AM, Óscar Fuentes wrote:
>> 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.
> 
> Then I guess that the information provided by the user through
> Module::setDataLayout is used in some places instead of the hard-coded
> info provided by X86SubTarget::getDataLayout. This can cause some
> trouble as Anton points out on the discussion of bug #7544.

Yes, the target data string is intended to allow the optimizers to do target-specific optimizations before code generation.  You can leave it empty if you don't want this to happen.

> OTOH, I know that if language implementation exchanges data with C/C++,
> it must follow certain platform-dependant data layout, but if the
> language does not share structs with C/C++ then it is free to align the
> data members as it pleases, as long as it does not violate the
> constraints imposed by the hardware. It is surprising to see that LLVM
> imposes the C/C++ platform's data layout on its users.

It doesn't, just leave it empty.

-Chris





More information about the llvm-dev mailing list