TAGs for variables created through common.opt

Aldy Hernandez aldyh@redhat.com
Thu Aug 21 17:53:00 GMT 2014


Well, whadayaknow... Tom Tromey pointed me at --regex which we can use 
to add patterns for not only the .opt files, but for a bunch of other 
files/languages we define in GCC.

The following patch adds support for common.opt, rtl.def, tree.def, and 
gimple.def.  Now you can use your editor to tag things like GIMPLE_NOP, 
and PLUS_EXPR, which means I'll get lost less often.

Kinda neat, IMO.

Tested by inspecting TAGS.sub manually, as well as searching for random 
stuff with both vi and emacs.

OK for mainline?
-------------- next part --------------
	* Makefile.in (TAGS): Handle constructs in common.opt, rtl.def,
	tree.def, and gimple.def

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 1b3820b..f761153 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3799,7 +3799,10 @@ TAGS: lang.tags
 	    incs="$$incs --include $$dir/TAGS.sub";	\
 	  fi;						\
 	done;						\
-	etags -o TAGS.sub c-family/*.h c-family/*.c *.h *.c *.cc; \
+	etags -o TAGS.sub c-family/*.h c-family/*.c *.h *.c *.cc \
+	      --language=none --regex="/\(char\|unsigned int\|int\|bool\|void\|HOST_WIDE_INT\|enum [A-Za-z_0-9]+\) [*]?\([A-Za-z_0-9]+\)/\2/" common.opt	\
+	      --language=none --regex="/\(DEF_RTL_EXPR\|DEFTREECODE\|DEFGSCODE\).*(\([A-Za-z_0-9]+\)/\2/" rtl.def tree.def gimple.def \
+		; \
 	etags --include TAGS.sub $$incs)
 
 # -----------------------------------------------------


More information about the Gcc-patches mailing list