[LLVMdev] Question about SPARC target status

Chris Lattner clattner at apple.com
Tue Nov 11 17:31:13 PST 2008


On Nov 11, 2008, at 5:11 PM, Peter Shugalev wrote:

> Owen Anderson wrote:
>> What about something much simpler: memcpy'ing an array of structs
>> around.  The number of bytes to be memcpy'd is dependent on the  
>> padding
>> of the struct.
>
> Anyway, I've got your point. sizeof() constant expression is  
> calculated
> during wrong stage of compilation process. Thanks for pointing it out!

Yes, not to mention stuff like:

#ifdef __i386__

or:
  case sizeof(foo):

This is addressed here:
http://llvm.org/docs/tutorial/LangImpl8.html#targetindep

Note that this doesn't affect cross compilation: you just need to  
configure llvm-gcc as a proper cross compiler.  This just means that  
llvm won't magically make your C code portable for you.  Real portable  
languages don't suffer from these problems.

-Chris



More information about the llvm-dev mailing list