This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

gas cleanups


This patch removes all #if 0 blocks in the gas directory.  Is there
anything here that really ought to be kept?

Sweep, sweep,

Ben

2005-01-21  Ben Elliston  <bje@au.ibm.com>

	* as.h: Remove #if 0'd code.
	* atof-generic.c (atof_generic): Likewise.
	* ecoff.c (ecoff_directive_frame): Likewise.
	* frags.h (FRAG_APPEND_1_CHAR): Likewise.
	* itbl-ops.c (itbl_add_reg): Likewise.
	* listing.c (calc_hex): Likewise.
	* read.c (MASK_CHAR): Likewise.
	* subsegs.c (subsegs_print_statistics): Likewise.
	* symbols.c (indent): Likewise.
	* write.c (write_relocs): Likewise.
	(write_object_file): Likewise.
	(relax_frag): Likewise.

Index: as.h
===================================================================
RCS file: /home/bje/src-cvs/src/gas/as.h,v
retrieving revision 1.39
diff -u -p -r1.39 as.h
--- as.h	17 Aug 2004 12:19:55 -0000	1.39
+++ as.h	20 Jan 2005 23:55:23 -0000
@@ -104,26 +104,9 @@ extern void *alloca ();
 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
 #define __PRETTY_FUNCTION__  ((char*)0)
 #endif
-#if 0
-
-/* Handle lossage with assert.h.  */
-#ifndef BROKEN_ASSERT
-#include <assert.h>
-#else /* BROKEN_ASSERT */
-#ifndef NDEBUG
-#define assert(p) ((p) ? 0 : (as_assert (__FILE__, __LINE__, __PRETTY_FUNCTION__), 0))
-#else
-#define assert(p) ((p), 0)
-#endif
-#endif /* BROKEN_ASSERT */
-
-#else
-
 #define assert(P) ((P) ? 0 : (as_assert (__FILE__, __LINE__, __PRETTY_FUNCTION__), 0))
 #undef abort
 #define abort()		as_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
-
-#endif
 
 /* Now GNU header files...  */
 #include "ansidecl.h"
Index: atof-generic.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/atof-generic.c,v
retrieving revision 1.8
diff -u -p -r1.8 atof-generic.c
--- atof-generic.c	21 Nov 2003 01:52:16 -0000	1.8
+++ atof-generic.c	20 Jan 2005 23:55:23 -0000
@@ -324,19 +324,10 @@ atof_generic (/* return pointer to just 
 		   + 1);	/* Number of destination littlenums.  */
 
       /* Includes guard bits (two littlenums worth) */
-#if 0 /* The integer version below is very close, and it doesn't
-	 require floating point support (which is currently buggy on
-	 the Alpha).  */
-      maximum_useful_digits = (((double) (precision - 2))
-			       * ((double) (LITTLENUM_NUMBER_OF_BITS))
-			       / (LOG_TO_BASE_2_OF_10))
-	+ 2;			/* 2 :: guard digits.  */
-#else
       maximum_useful_digits = (((precision - 2))
 			       * ( (LITTLENUM_NUMBER_OF_BITS))
 			       * 1000000 / 3321928)
 	+ 2;			/* 2 :: guard digits.  */
-#endif
 
       if (number_of_digits_available > maximum_useful_digits)
 	{
@@ -353,13 +344,8 @@ atof_generic (/* return pointer to just 
       decimal_exponent += ((long) number_of_digits_before_decimal
 			   - (long) number_of_digits_to_use);
 
-#if 0
-      more_than_enough_bits_for_digits
-	= ((((double) number_of_digits_to_use) * LOG_TO_BASE_2_OF_10) + 1);
-#else
       more_than_enough_bits_for_digits
 	= (number_of_digits_to_use * 3321928 / 1000000 + 1);
-#endif
 
       more_than_enough_littlenums_for_digits
 	= (more_than_enough_bits_for_digits
Index: ecoff.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/ecoff.c,v
retrieving revision 1.18
diff -u -p -r1.18 ecoff.c
--- ecoff.c	29 Apr 2004 05:14:21 -0000	1.18
+++ ecoff.c	20 Jan 2005 23:55:23 -0000
@@ -3185,14 +3185,7 @@ ecoff_directive_frame (int ignore ATTRIB
 
   cur_proc_ptr->pdr.pcreg = tc_get_register (0);
 
-#if 0
-  /* Alpha-OSF1 adds "the offset of saved $a0 from $sp", according to
-     Sandro.  I don't yet know where this value should be stored, if
-     anywhere.  */
-  demand_empty_rest_of_line ();
-#else
   s_ignore (42);
-#endif
 }
 
 /* Parse .mask directives.  */
Index: frags.h
===================================================================
RCS file: /home/bje/src-cvs/src/gas/frags.h,v
retrieving revision 1.16
diff -u -p -r1.16 frags.h
--- frags.h	2 Jul 2004 06:40:19 -0000	1.16
+++ frags.h	20 Jan 2005 23:55:23 -0000
@@ -119,22 +119,8 @@ COMMON fragS zero_address_frag;
 /* For local common (N_BSS segment) fixups.  */
 COMMON fragS bss_address_frag;
 
-#if 0
-/* A macro to speed up appending exactly 1 char to current frag.  */
-/* JF changed < 1 to <= 1 to avoid a race condition.  */
-#define FRAG_APPEND_1_CHAR(datum)			\
-{							\
-  if (obstack_room (&frags) <= 1)			\
-    {							\
-      frag_wane (frag_now);				\
-      frag_new (0);					\
-    }							\
-  obstack_1grow (&frags, datum);			\
-}
-#else
 extern void frag_append_1_char (int);
 #define FRAG_APPEND_1_CHAR(X) frag_append_1_char (X)
-#endif
 
 void frag_init (void);
 fragS *frag_alloc (struct obstack *);
Index: itbl-ops.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/itbl-ops.c,v
retrieving revision 1.13
diff -u -p -r1.13 itbl-ops.c
--- itbl-ops.c	24 Nov 2003 03:37:58 -0000	1.13
+++ itbl-ops.c	20 Jan 2005 23:55:23 -0000
@@ -204,18 +204,6 @@ struct itbl_entry *
 itbl_add_reg (int yyprocessor, int yytype, char *regname,
 	      int regnum)
 {
-#if 0
-#include "as.h"
-#include "symbols.h"
-  /* Since register names don't have a prefix, we put them in the symbol table so
-     they can't be used as symbols.  This also simplifies argument parsing as
-     we can let gas parse registers for us.  The recorded register number is
-     regnum.  */
-  /* Use symbol_create here instead of symbol_new so we don't try to
-     output registers into the object file's symbol table.  */
-  symbol_table_insert (symbol_create (regname, reg_section,
-				      regnum, &zero_address_frag));
-#endif
   return alloc_entry (get_processor (yyprocessor), get_type (yytype), regname,
 		      (unsigned long) regnum);
 }
Index: listing.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/listing.c,v
retrieving revision 1.25
diff -u -p -r1.25 listing.c
--- listing.c	19 Dec 2003 15:23:40 -0000	1.25
+++ listing.c	20 Jan 2005 23:55:23 -0000
@@ -613,10 +613,6 @@ calc_hex (list_info_type *list)
 	      sprintf (data_buffer + data_buffer_size,
 		       "%02X",
 		       (frag_ptr->fr_literal[var_rep_idx]) & 0xff);
-#if 0
-	      data_buffer[data_buffer_size++] = '*';
-	      data_buffer[data_buffer_size++] = '*';
-#endif
 	      data_buffer_size += 2;
 
 	      var_rep_idx++;
Index: read.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/read.c,v
retrieving revision 1.86
diff -u -p -r1.86 read.c
--- read.c	20 Jan 2005 06:46:41 -0000	1.86
+++ read.c	20 Jan 2005 23:55:23 -0000
@@ -20,14 +20,10 @@ along with GAS; see the file COPYING.  I
 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
-#if 0
-/* If your chars aren't 8 bits, you will change this a bit.
+/* If your chars aren't 8 bits, you will change this a bit (eg. to 0xFF).
    But then, GNU isn't spozed to run on your machine anyway.
    (RMS is so shortsighted sometimes.)  */
-#define MASK_CHAR (0xFF)
-#else
 #define MASK_CHAR ((int)(unsigned char) -1)
-#endif
 
 /* This is the largest known floating point format (for now). It will
    grow when we do 4361 style flonums.  */
Index: subsegs.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/subsegs.c,v
retrieving revision 1.17
diff -u -p -r1.17 subsegs.c
--- subsegs.c	19 Jul 2004 19:15:43 -0000	1.17
+++ subsegs.c	20 Jan 2005 23:55:23 -0000
@@ -616,27 +616,6 @@ subsegs_print_statistics (FILE *file)
 
       for (fragp = frchp->frch_root; fragp; fragp = fragp->fr_next)
 	{
-#if 0
-	  switch (fragp->fr_type)
-	    {
-	    case rs_fill:
-	      fprintf (file, "f"); break;
-	    case rs_align:
-	      fprintf (file, "a"); break;
-	    case rs_align_code:
-	      fprintf (file, "c"); break;
-	    case rs_org:
-	      fprintf (file, "o"); break;
-	    case rs_machine_dependent:
-	      fprintf (file, "m"); break;
-	    case rs_space:
-	      fprintf (file, "s"); break;
-	    case 0:
-	      fprintf (file, "0"); break;
-	    default:
-	      fprintf (file, "?"); break;
-	    }
-#endif
 	  count++;
 	}
       fprintf (file, "\n");
Index: symbols.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/symbols.c,v
retrieving revision 1.53
diff -u -p -r1.53 symbols.c
--- symbols.c	9 Nov 2004 01:01:17 -0000	1.53
+++ symbols.c	20 Jan 2005 23:55:23 -0000
@@ -2370,16 +2370,6 @@ int indent_level;
    Available for modification inside a gdb session.  */
 int max_indent_level = 8;
 
-#if 0
-
-static void
-indent (void)
-{
-  printf ("%*s", indent_level * 4, "");
-}
-
-#endif
-
 void
 print_symbol_value_1 (FILE *file, symbolS *sym)
 {
Index: write.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/write.c,v
retrieving revision 1.80
diff -u -p -r1.80 write.c
--- write.c	10 Jan 2005 17:22:49 -0000	1.80
+++ write.c	20 Jan 2005 23:55:23 -0000
@@ -942,13 +942,6 @@ write_relocs (bfd *abfd, asection *sec, 
 	  continue;
 	}
 
-#if 0
-      /* This test is triggered inappropriately for the SH.  */
-      if (fixp->fx_where + fixp->fx_size
-	  > fixp->fx_frag->fr_fix + fixp->fx_frag->fr_offset)
-	abort ();
-#endif
-
       s = bfd_install_relocation (stdoutput, reloc,
 				  fixp->fx_frag->fr_literal,
 				  fixp->fx_frag->fr_address,
@@ -1929,13 +1922,6 @@ write_object_file (void)
 	  if (S_IS_DEFINED (symp) == 0
 	      && S_GET_VALUE (symp) != 0)
 	    S_SET_SEGMENT (symp, bfd_com_section_ptr);
-#if 0
-	  printf ("symbol `%s'\n\t@%x: value=%d flags=%x seg=%s\n",
-		  S_GET_NAME (symp), symp,
-		  S_GET_VALUE (symp),
-		  symbol_get_bfdsym (symp)->flags,
-		  segment_name (S_GET_SEGMENT (symp)));
-#endif
 
 #ifdef obj_frob_symbol
 	  obj_frob_symbol (symp, punt);
@@ -2083,14 +2069,10 @@ relax_frag (segT segment, fragS *fragP, 
 #ifdef TC_PCREL_ADJUST
   /* Currently only the ns32k family needs this.  */
   aim += TC_PCREL_ADJUST (fragP);
-/* #else */
-  /* This machine doesn't want to use pcrel_adjust.
-     In that case, pcrel_adjust should be zero.  */
-#if 0
-  assert (fragP->fr_targ.ns32k.pcrel_adjust == 0);
 #endif
-#endif
-#ifdef md_prepare_relax_scan /* formerly called M68K_AIM_KLUDGE  */
+
+#ifdef md_prepare_relax_scan
+  /* Formerly called M68K_AIM_KLUDGE.  */
   md_prepare_relax_scan (fragP, address, aim, this_state, this_type);
 #endif
 


Attachment: signature.asc
Description: Digital signature


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