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]

gcc/ch/Makefile.in: remove unnecessary invocations of gawk, sed


ch/Makefile.in unnecessary invokes gawk and sed when generating
hash.h.  as you can see, the use of 'tr' in the first cmd (pipeline) in
the rule to hash.h insures that the result of the pipeline is all
upper-case, so there's no point in using the gawk and sed to convert
the first word in the line to upper case.  (it's also worth noting
that even if it were worthwhile, that wouldn't work as-ins, because
it'd be looking for 'foo,,' rather than 'foo,'...)

I've tested a patch very similar to this one (identical other than
mucking with uses of srcdir), but i've not tested this _exact_ patch.
somebody should probably throw it into a build before they check it
in...


As previously noted, I don't have an assignment currently on file, but
this is another truly trivial one...


cgd


2000-04-17  Chris Demetriou  <cgd@netbsd.org>

	* Makefile.in (hash.h): Delete a redundant use of gawk and sed.

Index: gcc/ch/Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ch/Makefile.in,v
retrieving revision 1.22
diff -u -r1.22 Makefile.in
--- Makefile.in	2000/02/26 13:51:58	1.22
+++ Makefile.in	2000/04/18 00:55:07
@@ -250,16 +250,14 @@
 # one all lowercase.  The hash table ends up with both sets in it.
 $(srcdir)/hash.h:
 	sed -e '1,/^%%/d' < $(srcdir)/gperf | \
-	  sed '/^[^a-zA-Z]/d' | tr "[a-z]" "[A-Z]" > gperf.tmp
-	gawk '{ printf ("s/^%s,/%s,/\n", $$1, toupper ($$1)) }' < gperf.tmp > sed.tmp
-	sed -f sed.tmp < gperf.tmp > gperf.tmp2
+	  sed '/^[^a-zA-Z]/d' | tr "[a-z]" "[A-Z]" > gperf.tmp2
 	cat $(srcdir)/gperf gperf.tmp2 > gperf.tmp
 	gperf -L C -F ', 0, 0, 0' -D -E -S1 -p -j1 -i 1 -g -o -t -k'*' \
 	  gperf.tmp > $(srcdir)/hash.h || ( \
 	echo "Please update your 'gperf' from the GCC infrastructure" >&2 ; \
 	echo "	ftp://sourceware.cygnus.com/pub/egcs/infrastructure/gperf*" >&2 ; \
 	exit 1 )
-	$(RM) gperf.tmp gperf.tmp2 sed.tmp
+	$(RM) gperf.tmp gperf.tmp2
 
 actions.o : actions.c $(CONFIG_H) $(CHILL_TREE_H) actions.h $(RTL_H)	\
 	lex.h $(srcdir)/../flags.h $(srcdir)/../input.h			\

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]