[LLVMdev] lli : external functions and target datalayout
jianzhou at seas.upenn.edu
Sun Oct 24 15:36:08 CDT 2010
On Sun, Oct 24, 2010 at 1:48 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:
> Jianzhou Zhao <jianzhou at seas.upenn.edu> writes:
>> The other question is about
>> target datalayout =
>> If I use this string to creat a TargetData object directly, I got an
>> assertion error:
>> ~/llvm-2.6/lib/Target/TargetData.cpp:246: void
>> llvm::TargetData::setAlignment(llvm::AlignTypeEnum, unsigned char,
>> unsigned char, uint32_t): Assertion `abi_align <= pref_align &&
>> "Preferred alignment worse than ABI!"' failed.
>> This is because of the i64:32:64. It seems to be i64:64:64. 'lli' is
>> able to fix this problem automatically, but why does llvm-gcc output
>> i64:32:64 rather than i64:64:64?
> FYI: the X86 data layout is hard-coded in
> lib/Target/X86/X86TargetMachine.cpp, so that assert is mostly bogus, and
Thanks. I should get the TargetData object from the ExecutionEngine class.
> the existence of "target datalayout" IR setting and
> Module::setDataLayout are deceiving.
Do you know if the latest release fixed this assertion? I actually
dont quite understand how this assertion affects the program. Can I
use setDataLayout for other targets?
More information about the LLVMdev