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]
Other format: [Raw text]

[committed] Remove excess indentation from optc-gen.awk


The main for() loop in optc-gen.awk was over-indented by 8 columns.
I committed the patch below as obvious after testing on mips64-elf
and after checking that the generated options.c file didn't change.

Richard


	* optc-gen.awk: Remove excess indentation.

Index: optc-gen.awk
===================================================================
RCS file: /cvs/gcc/gcc/gcc/optc-gen.awk,v
retrieving revision 2.5
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r2.5 optc-gen.awk
*** optc-gen.awk	28 Apr 2005 20:52:08 -0000	2.5
--- optc-gen.awk	15 May 2005 08:06:25 -0000
*************** print "const struct cl_option cl_options
*** 98,144 ****
  for (i = 0; i < n_opts; i++)
  	back_chain[i] = "N_OPTS";
  
! 	for (i = 0; i < n_opts; i++) {
! 		# Combine the flags of identical switches.  Switches
! 		# appear many times if they are handled by many front
! 		# ends, for example.
! 		while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
! 			flags[i + 1] = flags[i] " " flags[i + 1];
! 			i++;
  		}
  
! 		len = length (opts[i]);
! 		enum = "OPT_" opts[i]
! 		if (opts[i] == "finline-limit=")
! 			enum = enum "eq"
! 		gsub ("[^A-Za-z0-9]", "_", enum)
! 
! 		# If this switch takes joined arguments, back-chain all
! 		# subsequent switches to it for which it is a prefix.  If
! 		# a later switch S is a longer prefix of a switch T, T
! 		# will be back-chained to S in a later iteration of this
! 		# for() loop, which is what we want.
! 		if (flag_set_p("Joined.*", flags[i])) {
! 			for (j = i + 1; j < n_opts; j++) {
! 				if (substr (opts[j], 1, len) != opts[i])
! 					break;
! 				back_chain[j] = enum;
! 			}
! 		}
! 
! 		s = substr("                                  ", length (opts[i]))
! 		if (i + 1 == n_opts)
! 			comma = ""
! 
! 		if (help[i] == "")
! 			hlp = "0"
! 		else
! 			hlp = quote help[i] quote;
! 
! 		printf("  { %c-%s%c,\n    %s,\n    %s, %u, %s, %s, %s }%s\n",
! 			quote, opts[i], quote, hlp, back_chain[i], len,
! 			switch_flags(flags[i]),
! 			var_ref(flags[i]), var_set(flags[i]), comma)
  }
  
  print "};"
--- 98,144 ----
  for (i = 0; i < n_opts; i++)
  	back_chain[i] = "N_OPTS";
  
! for (i = 0; i < n_opts; i++) {
! 	# Combine the flags of identical switches.  Switches
! 	# appear many times if they are handled by many front
! 	# ends, for example.
! 	while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
! 		flags[i + 1] = flags[i] " " flags[i + 1];
! 		i++;
! 	}
! 
! 	len = length (opts[i]);
! 	enum = "OPT_" opts[i]
! 	if (opts[i] == "finline-limit=")
! 		enum = enum "eq"
! 	gsub ("[^A-Za-z0-9]", "_", enum)
! 
! 	# If this switch takes joined arguments, back-chain all
! 	# subsequent switches to it for which it is a prefix.  If
! 	# a later switch S is a longer prefix of a switch T, T
! 	# will be back-chained to S in a later iteration of this
! 	# for() loop, which is what we want.
! 	if (flag_set_p("Joined.*", flags[i])) {
! 		for (j = i + 1; j < n_opts; j++) {
! 			if (substr (opts[j], 1, len) != opts[i])
! 				break;
! 			back_chain[j] = enum;
  		}
+ 	}
  
! 	s = substr("                                  ", length (opts[i]))
! 	if (i + 1 == n_opts)
! 		comma = ""
! 
! 	if (help[i] == "")
! 		hlp = "0"
! 	else
! 		hlp = quote help[i] quote;
! 
! 	printf("  { %c-%s%c,\n    %s,\n    %s, %u, %s, %s, %s }%s\n",
! 		quote, opts[i], quote, hlp, back_chain[i], len,
! 		switch_flags(flags[i]),
! 		var_ref(flags[i]), var_set(flags[i]), comma)
  }
  
  print "};"


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