This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: DECL_FIELD_CONTEXT woes


Dave Korn wrote:
On 10 January 2008 16:40, Gabriele SVELTO wrote:

  Yes, you're completely correct about the artificial initialiser function; I
thought the compiler might output it as a nested function, but I don't know
without checking.  (But I've been working on gcc for only ~7 years so I might
be badly wrong on this or indeed any other one..... ;-P it's a big old pile of
code!)

I guess so, it redefined my concept of "large, complex project".


  Really you should use CP_TYPE_CONST_P to test this; IIUC, things can be
const without being readonly (and perhaps even vice-versa), depending on which
kind of section (.data/.rdata) they're allocated to.

Thanks for the type, I was completely unaware of the existence of that macro.


  I believe this is indeed gcc's bog-standard way of creating a qualified
variant of an existing type.  Note that you should see in this case that
TYPE_MAIN_VARIANT (type) == DECL_FIELD_CONTEXT (TYPE_FIELDS (type)), I think.

Good to know, TYPE_MAIN_VARIANT () is exactly what I was looking for, unfortunately it's description in tree.def isn't exactly crystal clear :P Thank you very much


Gabriele


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]