[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch: etags -vs- GCC sources
From: |
Tom Tromey |
Subject: |
Patch: etags -vs- GCC sources |
Date: |
Wed, 06 Jun 2007 13:58:08 -0600 |
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 <address@hidden>
* 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},
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Patch: etags -vs- GCC sources,
Tom Tromey <=