This is the mail archive of the gcc-patches@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] |
2011/9/12 Dodji Seketeli <dodji@seketeli.org>: > Romain Geissler <romain.geissler@gmail.com> a Ãcrit: >> When i recontributed the PLUGIN_FINISH_DECL patch from the original >> Brian Hackett, i didn't exactly checked what may or may not trigger >> this new event. I know for example that declaring a function triggers >> this event, but defining it does not. >> >> I don't really know when those event should be triggered, we should >> clarify the meaning of those. >> >> According to me: >> PLUGIN_FINISH_DECL should be triggered anytime the parser parse a >> declaration (which includes declaration + definition of function, >> typedef definition, namespaces, ..., all DECL_P trees built by the >> parser). > > The general idea sounds sensible, IMHO. However, we must keep in mind > that there are cases like, e.g, 'struct C;' where G++ creates a typedef > 'typedef struct C C;' so that you can name that type 'C' instead of > having to type "struct C' all the time. For these cases, I don't think > the PLUGIN_FINISH_DECL event should be emitted.
> >> For, PLUGIN_FINISH_TYPE i don't really know it means a new type >> declaration (or declaration + definition) or if it means usage of a >> type (in a function prototype, the type of a local variable. > > I'd say it's a definition of a new type, IMHO.
> >> I would rather vote for new type definition (including typedefs) > > My understanding is that a typedef declaration doesn't define a new > type. Rather, it declares an alias for an existing type. As such, I > would think that notifying typedef declarations via PLUGIN_FINISH_DECL > would be the way to go.
> >> but for special cases of struct, you can declare and use them at the >> same time: > > Just to be sure I understand, do you need to be notified about *uses* of > types and decls as well? If so, maybe a new kind of event should > probably be defined, because PLUGIN_FINISH_DECL and PLUGIN_FINISH_TYPE > seem to have more to do with declaring/defining decls and types than > using them. >
> -- > Dodji >
Attachment:
test_fail.c
Description: Text document
Attachment:
test_pass.c
Description: Text document
Attachment:
test_plugin.c
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |