[LLVMdev] RFA: Alignment of Strings

Duncan Sands baldrick at free.fr
Tue Jun 2 23:50:05 PDT 2009


Hi Bill,

> Index: llvm-gcc.src/gcc/llvm-convert.cpp
> ===================================================================
> --- llvm-gcc.src/gcc/llvm-convert.cpp	(revision 72733)
> +++ llvm-gcc.src/gcc/llvm-convert.cpp	(working copy)
> @@ -7418,6 +7418,8 @@
>                                             TAI ?
>                                              TAI->getStringConstantPrefix() :
>                                              ".str", TheModule);
> +  GV->setAlignment(TYPE_ALIGN(TREE_TYPE(exp)));

the gcc alignment is in bits, so you need to divide by 8.

Ciao,

Duncan.



More information about the llvm-dev mailing list