[llvm-commits] [llvm-gcc-4.2] r81054 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Bob Wilson bob.wilson at apple.com
Tue Sep 8 13:46:26 PDT 2009


On Sep 5, 2009, at 1:35 AM, Duncan Sands wrote:

> Hi Bob,
>
>> Preserve alignment settings for string constants.
>
> CONSTANT_ALIGNMENT is for all constants, not just strings.
> Can you please make the corresponding change for other
> constants.
>
>> +  unsigned align = TYPE_ALIGN(TREE_TYPE(exp));
>> +#ifdef CONSTANT_ALIGNMENT
>> +  align = CONSTANT_ALIGNMENT (exp, align);
>> +#endif
>
> This logic could be factored into a get_constant_alignment
> method, like that (static) one in varasm.c.

OK.  I could only find a few places where this change looked  
relevant.  It seems like alignment is not generally supported for all  
constants in llvm.  E.G., from emit_global_to_llvm() in llvm- 
backend.cpp:

  // FIXME: Support alignment on globals: DECL_ALIGN.

I'm not going to attempt to fix all of that right now.



More information about the llvm-commits mailing list