Re: Accessor macro wrappers removal [Re: [patch] static_kind -> bit0, bit1]

Tom Tromey
2008-09-26T23:15:38Z

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

[accessor macros]

Joel> Personally, I find them to be very useful to quickly find who is using
Joel> field "main_type" in struct type.

Jan> How does it differ from
Jan> grep -- '->main_type\>' *.[ch]
Jan> ?

Like Daniel said, this is a pain if unrelated fields have the same
name. Also it is a pain if there are formatting oddities.

However, if I am really desperate I just rename the field I want to
find to something odd, then "make -k". The compiler will tell me all
(or most) of the spots it is used :-)

One thing that is nice about the accessor macros is that it makes it
much simpler to play with certain kinds of field rearrangements. This
isn't common, of course, but I did do it recently. It turns out you
can push fields into struct general_symbol_info and save a word from
minimal_symbol and symbol. Trying this out was easy since I only had
to modify a few macros (well, once I fixed the code not using them :-)

Anyway, I don't really care either way about this stuff. It seems to
be a GNU cultural thing more than anything technical.

Tom