order of declared filed in a struct

Wang,Yi netantz@gmail.com
Thu Jun 15 20:40:00 GMT 2006


Hi all:

 In the GIMPLE tree, How do I get the order of the field declared in a
struct (RECORD_TYPE) ? The GCC Internal explains that I could not make
any assumptions abut the ordering of th field.


-------------------------------
RECORD_TYPE
    Used to represent struct and class types, as well as pointers to
member functions and similar constructs in other languages.
TYPE_FIELDS contains the items contained in this type, each of which
can be a FIELD_DECL, VAR_DECL, CONST_DECL, or TYPE_DECL. You may not
make any assumptions about the ordering of the fields in the type or
whether one or more of them overlap. If TYPE_PTRMEMFUNC_P holds, then
this type is a pointer-to-member type. In that case, the
TYPE_PTRMEMFUNC_FN_TYPE is a POINTER_TYPE pointing to a METHOD_TYPE.
The METHOD_TYPE is the type of a function pointed to by the
pointer-to-member function. If TYPE_PTRMEMFUNC_P does not hold, this
type is a class type. For more information, see see Classes.
-----------------------------


Thanks

-- 
Yi Wang
Software Engineering, ComSci@U of T



More information about the Gcc-help mailing list