Explicit field layout

Ricardo FERNANDEZ PASCUAL ricardo.fernandez@st.com
Fri Sep 22 13:33:00 GMT 2006


Hello,

    I am writing a new GCC front end. One of the features provided by my 
language (CIL) is explicit field layout and size for records.
   
    I don't know if any other languaje supported by GCC provides this 
feature. If that's the case, please point me to it so that I can see how 
to do it.

    For the case of explicit record size, what I am doing currently is 
modifying the TYPE_SIZE() of the declaration after the call to 
layout_type. It seems to work, but I am not sure if this is the correct 
way to do this.

    As for setting the explicit field offset, I haven't tried to do it 
yet. Would it be enough to set the DECL_FIELD_OFFSET and 
DECL_FIELD_BIT_OFFSET fields of each field declaration manually? When 
should it be done (after calling layout_type or before)?

    Any pointers would be greatly appreciated.


Thank you in advance,
Ricardo Fernández Pascual.



More information about the Gcc mailing list