unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Patch: etags -vs- GCC sources
@ 2007-06-06 19:58 Tom Tromey
  2008-02-04  4:53 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2007-06-06 19:58 UTC (permalink / raw)
  To: Emacs Hackers

GCC marks some global variables with 'GTY'.  This is defined to expand
to nothing when compiling, but a separate tool uses these markers to
generate information about roots for the garbage collector.

etags doesn't know what to do with these markers and consequently many
tags are not found when running etags on GCC.  Here's an example of a
definition from g++ that is not found by etags:

    static GTY (()) cp_parser *the_parser;

The appended patch changes etags to treat GTY as a synonym for
__attribute__.  This seems to work for me.  I spot-checked it by
looking for several tags which I previously could not find.

FWIW I'm not sure whether adding this to etags is the best thing to
do.  However I did notice that there is built-in support for other
GNU-specific macros.  So maybe it isn't too bad.

Tom

2007-06-06  Tom Tromey  <tromey@redhat.com>

	* etags.c: Added "GTY" as synonym for __attribute__.  Updated
	gperf output.

Index: lib-src/etags.c
===================================================================
RCS file: /sources/emacs/emacs/lib-src/etags.c,v
retrieving revision 3.72
diff -u -r3.72 etags.c
--- lib-src/etags.c 18 May 2007 08:43:54 -0000 3.72
+++ lib-src/etags.c 6 Jun 2007 20:15:01 -0000
@@ -2466,6 +2466,7 @@
 switch,		0,			st_C_ignore
 return,		0,			st_C_ignore
 __attribute__,	0,			st_C_attribute
+GTY,		0,			st_C_attribute
 @interface,	0,			st_C_objprot
 @protocol,	0,			st_C_objprot
 @implementation,0,			st_C_objimpl
@@ -2529,9 +2530,9 @@
       35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
       35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
       35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
-      35, 35, 35, 35, 35, 35, 35, 35, 35, 15,
-      14, 35, 35, 35, 35, 35, 35, 35, 14, 35,
-      35, 35, 35, 12, 13, 35, 35, 35, 35, 12,
+      35, 35, 35, 35, 35, 35, 35, 35, 35,  3,
+      26, 35, 35, 35, 35, 35, 35, 35, 27, 35,
+      35, 35, 35, 24,  0, 35, 35, 35, 35,  0,
       35, 35, 35, 35, 35,  1, 35, 16, 35,  6,
       23,  0,  0, 35, 22,  0, 35, 35,  5,  0,
        0, 15,  1, 35,  6, 35,  8, 19, 35, 16,
@@ -2571,7 +2572,7 @@
 {
   enum
     {
-      TOTAL_KEYWORDS = 32,
+      TOTAL_KEYWORDS = 33,
       MIN_WORD_LENGTH = 2,
       MAX_WORD_LENGTH = 15,
       MIN_HASH_VALUE = 2,
@@ -2582,7 +2583,7 @@
     {
       {""}, {""},
       {"if",		0,			st_C_ignore},
-      {""},
+      {"GTY",		0,			st_C_attribute},
       {"@end",		0,			st_C_objend},
       {"union",		0,			st_C_struct},
       {"define",		0,			st_C_define},

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch: etags -vs- GCC sources
  2007-06-06 19:58 Patch: etags -vs- GCC sources Tom Tromey
@ 2008-02-04  4:53 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2008-02-04  4:53 UTC (permalink / raw)
  To: Tom Tromey; +Cc: emacs-devel

Tom Tromey <tromey@redhat.com> writes:

> GCC marks some global variables with 'GTY'.  This is defined to expand
> to nothing when compiling, but a separate tool uses these markers to
> generate information about roots for the garbage collector.
>
> etags doesn't know what to do with these markers and consequently many
> tags are not found when running etags on GCC.  Here's an example of a
> definition from g++ that is not found by etags:
>
>     static GTY (()) cp_parser *the_parser;
>
> The appended patch changes etags to treat GTY as a synonym for
> __attribute__.  This seems to work for me.  I spot-checked it by
> looking for several tags which I previously could not find.

Sorry, this one seems to have been lost in the pile.

No one seems to have objected, so I committed it to the trunk.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-04  4:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-06 19:58 Patch: etags -vs- GCC sources Tom Tromey
2008-02-04  4:53 ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).