[LLVMdev] LLVMdev Digest, Vol 81, Issue 5

Renato Golin rengolin at systemcall.org
Sat Mar 5 02:28:32 PST 2011


On 4 March 2011 18:21, Peter Lawrence <peterl95124 at sbcglobal.net> wrote:
> seems like two different but related meanings for the word "packed".
>
> am I confused ?

Hi Peter,

You're absolutely right.

Using the packed attribute was an idea presented by John in the
beginning of the thread and I found elegant and simple, and since then
I'm trying to stress the boundaries of it to make sure if I ever go in
that direction, I'll not end up with yet another load of kludge as I
have now.

Some people have shown counter-examples that some kludge will be
required (including having non-packed structures with packed
structures inside, or a special type of packed that only packs the
last member). I'm losing confidence in this idea already. ;)

Jochen proposed a keyword "inherit" to stress the packing of the
tail-pad only, that would solve both problems, but introducing new
keywords to LLVM IR is always a dangerous enterprise. While this is
obviously a benefit for C++ (and I'm biased to request that keyword),
it might be used by other languages with slightly different semantics
and it'll be difficult to not add kludge to whatever part that does
the magic.

The Itanium C+ ABI is full of magic and we're bound to produce kludge
somewhere if we are to support C++ along with other languages. Today
we all do that kludge in the front-end, the idea was to simplify it,
but at what cost? It depends on what the IR is for in the long run.

cheers,
--renato



More information about the llvm-dev mailing list