[LLVMdev] Proposal: intp type

Duncan Sands baldrick at free.fr
Thu Nov 12 11:16:19 PST 2009


Hi Kenneth,

> On Thu, Nov 12, 2009 at 3:42 AM, Duncan Sands <baldrick at free.fr> wrote:
>>> I mean within a structure or array.  I don't know whether any
>>> platforms would pass them any differently as function arguments, but I
>>> do know that the "default" data layout (which I believe is the Sparc
>>> data layout) aligns int32's on 32-bit boundaries and 32-bit pointers
>>> on 64-bit boundaries.
>> Wrap the pointer in a packed struct maybe?
>>
>> Ciao,
>>
>> Duncan.
>>
> 
> That sets the alignment to 1 unconditionally, which might also be wrong.

you just have to set the alignment you want on alloca, add explicit struct
padding etc, to get the effect of the alignment you are seeking.  Of course
to do this you need to know the alignment...

Ciao,

Duncan.



More information about the llvm-dev mailing list