search for: derivedpadding

Displaying 1 result from an estimated 1 matches for "derivedpadding".

2011 Mar 25
1
[LLVMdev] Named metadata to represent language specific logic
...e string into a common group, even though it's not declared itself as such. ;==================================== ; Class size ; struct Base { char a[3]; Base() {} }; ; struct Derived : Base { char b; } %struct.Base = type { [3 x i8] }, !BasePadding; %struct.Derived type { %struct.Base, i8 }, !DerivedPadding; !BasePadding = { metadata !"size", i8 1 }; !DerivedPadding = { metadata !"size", i8 3 }; So, Base's padding is only applied when inside Derived, and GEP can still work on the element directly. Sizes could be relative to WORD size, if one wanted a truly generic IR, but tha...