[LLVMdev] StructLayout

David Greene dag at cray.com
Wed Sep 23 07:55:10 PDT 2009

On Tuesday 22 September 2009 20:47, 罗勇刚 wrote:
> I have a question. If the size of long is 8 on your x64 platform.

Yes, it has to be to conform with the ABI.

> Because the size of long is so different on different platform, sad it
> is.

Again, this is an ABI issue, as is bitfield layout.

I think what's happening is that we're generating all the correct bitfield 
access code (our optimizer takes care of that).  But our translator produces 
the wrong LLVM type which means arrays-of-structures don't work right in the 
presence of bitfields.  We got away with it for a while until LLVM 2.5 got 
smarter and recognized more opportunities for strength reduction.

Darn you LLVM people!  I'll add it to my presentation at the dev meeting
of suggested improvements to LLVM: our community should get a little 
dumber.  :)


More information about the llvm-dev mailing list