> * a has_children DIE has no DW_AT_sibling (suboptimal)
This didn't cross my mind. I've put the check in, and it seems to be
quite a common case: 14K violations in that hefty OOo library, and 850
violations in libX11.so. Do we really want to flag this? Maybe make it
a strict warning only?
The last child cannot have a DW_AT_sibling. If it had one, it would have
to point to the null entry terminating its parent's child list. But a
proper ref form can't point to a null DIE, so it can't be done. This is
unfortunate, since this optimization is useful for the last child as for
any other. Unfortunately, we can't presume DW_AT_sibling is always there,
so we can't take absence of DW_AT_sibling as an indicator this is the last
child. (We could had an extension, a flag attribute DW_AT_last_sibling.
But let's not worry about that idea for now.)
I didn't mention this before because I hadn't thought about it before I
went and looked at how GCC generates them. It does exactly that: generate
one for all but the last, excluding !has_children ones.