Expunge uses of #if 0 for comments in Chill front end

Zack Weinberg zack@codesourcery.com
Mon Oct 29 20:26:00 GMT 2001


While testing some changes to the i18n framework I discovered that the
Chill front end uses the abominable idiom of surrounding comments with
#if 0...#endif instead of /* */.  This patch cleans it up.

Bootstrapped i686-linux.  Also, I configured with
--enable-languages=CHILL and compiled all the source files, to verify
that I did not introduce any errors.  (It doesn't compile for other
reasons, of course.)

Applied as obvious.

zw

	* convert.c, inout.c, loop.c, nloop.c, tasking.c, timing.c,
	typeck.c: Use /* */ for all commentary, not #if 0 ... #endif.
	Change the nested comments this creates to // notation.
	Un-double apostrophes.

===================================================================
Index: ch/convert.c
--- ch/convert.c	2001/02/04 23:18:43	1.12
+++ ch/convert.c	2001/10/30 04:23:40
@@ -1086,9 +1086,7 @@ convert (type, expr)
 	  error ("initializer is not an array or string mode");
 	  return error_mark_node;
 	}
-#if 0
-      FIXME check that nentries will fit in type;
-#endif
+      /* FIXME check that nentries will fit in type; */
       if (!integer_zerop (needed_padding))
 	{
 	  tree padding, padding_type, padding_range;
===================================================================
Index: ch/inout.c
--- ch/inout.c	2000/12/07 01:55:52	1.15
+++ ch/inout.c	2001/10/30 04:23:41
@@ -1466,7 +1466,7 @@ access_dynamic (access)
   return integer_zero_node;
 }
 
-#if 0
+/*
    returns a structure like
    STRUCT (data STRUCT (flags ULONG,
                         reclength ULONG,
@@ -1480,7 +1480,7 @@ access_dynamic (access)
    TYPE_DECL __recordmode recordmode ? recordmode : void_type_node
    TYPE_DECL __indexmode  indexmode  ? indexmode  : void_type_node
    CONST_DECL __dynamic   dynamic ? integer_one_node : integer_zero_node
-#endif
+*/
 
 static tree
 build_access_part ()
@@ -1547,7 +1547,7 @@ build_access_mode (indexmode, recordmode
   return type;
 }
 
-#if 0
+/*
   returns a structure like:
   STRUCT (txt STRUCT (flags ULONG,
                       text_record PTR,
@@ -1567,7 +1567,7 @@ build_access_mode (indexmode, recordmode
   TYPE_DECL __indexmode indexmode ? indexmode : void_type_node
   CONST_DECL __text_length
   CONST_DECL __dynamic  dynamic ? integer_one_node : integer_zero_node
-#endif
+*/
 tree
 build_text_mode (textlength, indexmode, dynamic)
      tree textlength;
===================================================================
Index: ch/loop.c
--- ch/loop.c	2000/12/07 01:55:52	1.9
+++ ch/loop.c	2001/10/30 04:23:41
@@ -131,7 +131,7 @@ typedef struct loop {
 
 static LOOP *loopstack = (LOOP *)0;
 
-#if 0
+/*
 
 Here is a CHILL DO FOR statement:
 
@@ -147,10 +147,10 @@ following works:
           FOR i := (i+1) TO (i+10) DO
 
 To prevent changes to the start/end/step expressions from
-effecting the loop''s termination, and to make the loop end-check
+effecting the loop's termination, and to make the loop end-check
 as simple as possible, we evaluate the step expression into
 a temporary and compute a hidden iteration count before entering 
-the loop''s body.  User code cannot effect the counter, and the
+the loop's body.  User code cannot effect the counter, and the
 end-loop check simply decrements the counter and checks for zero.
 
 The whole phrase FOR iter := ... TO end_exp can be repeated
@@ -160,7 +160,7 @@ is discussed later.
 The loop counter calculations need careful design since a loop
 from MININT TO MAXINT must work, in the precision of integers.
 
-Here''s how it works, in C:
+Here's how it works, in C:
 
         0) The DO ... OD loop is simply a block with 
            its own scope.  
@@ -195,7 +195,7 @@ Here''s how it works, in C:
                 start_temp = start_exp
                 end_temp = end_exp
 		if (end_exp < start_exp) goto end_loop
-                /* following line is all unsigned arithmetic */
+                // following line is all unsigned arithmetic
 		iter_var = (end_exp - start_exp) / step_exp
                 user_var = start_temp
 	   loop_top:
@@ -218,7 +218,7 @@ Here''s how it works, in C:
                 start_temp = start_exp
                 end_temp = end_exp
 		if (end_exp > start_exp) goto end_loop
-                /* following line is all unsigned arithmetic */
+                // following line is all unsigned arithmetic
 		iter_var = (start_exp - end_exp) / step_exp
                 user_var = start_temp
 	   loop_top:
@@ -234,9 +234,9 @@ Here''s how it works, in C:
 	pop scope
 
 
-        5) The range loop, which iterates over a mode''s possible
+        5) The range loop, which iterates over a mode's possible
            values, works just like the above step loops, but with
-           the start and end values taken from the mode''s lower
+           the start and end values taken from the mode's lower
            and upper domain values.
 
 
@@ -249,7 +249,7 @@ Here''s how it works, in C:
              loc_ptr_temp as pointer to a composite base type
         
                if array is varying
-                   iter_var = array''s length field
+                   iter_var = array's length field
                else
                    iter_var = sizeof array / sizeof base_type
 	       loc_ptr_temp = &of highest or lowest indexable entry
@@ -290,20 +290,20 @@ Here''s how it works, in C:
 	pop scope
 
 
-So, here''s the general DO FOR schema, as implemented here:
+So, here's the general DO FOR schema, as implemented here:
 
-        expand_start_loop   -- start the loop''s control scope
+        expand_start_loop   -- start the loop's control scope
         -- start scope for synthesized loop variables
         declare_temps       -- create, initialize temporary variables
         maybe_skip_loop     -- skip loop if end conditions unsatisfiable
         initialize_iter_var -- initialize the iteration counter
-                            -- initialize user''s loop variable
+                            -- initialize user's loop variable
         expand_start_loop   -- generate top-of-loop label
         top_loop_end_check  -- generate while code and/or
                                powerset find-a-bit function call
         .
         .
-        .  user''s loop body code
+        .  user's loop body code
         .
         .
         bottom_loop_end_check  -- exit if counter has become zero
@@ -322,7 +322,7 @@ the 'increment_temps' step must incremen
        "the actions statement list in a do action, including any
        loop counter and while control".  This means that an exp-
        ression in a WHILE control can include references to the
-       loop counters created for the loop''s exclusive use.  
+       loop counters created for the loop's exclusive use.  
        Example:
 
              DCL a (1:10) INT;
@@ -331,9 +331,9 @@ the 'increment_temps' step must incremen
              ...
              OD;
        The 'j' referenced in the while is the loc-identity 'j'
-       created inside the loop''s scope, and NOT the 'j' declared
+       created inside the loop's scope, and NOT the 'j' declared
        before the loop.
-#endif
+*/
 
 /*
  * The following routines are called directly by the
===================================================================
Index: ch/nloop.c
--- ch/nloop.c	2000/12/07 01:55:52	1.6
+++ ch/nloop.c	2001/10/30 04:23:41
@@ -143,7 +143,7 @@ typedef struct loop {
 
 static LOOP *loop_stack = (LOOP *)0;
 
-#if 0
+/*
 
 Here is a CHILL DO FOR statement:
 
@@ -159,10 +159,10 @@ following works:
           FOR i := (i+1) TO (i+10) DO
 
 To prevent changes to the start/end/step expressions from
-effecting the loop''s termination, and to make the loop end-check
+effecting the loop's termination, and to make the loop end-check
 as simple as possible, we evaluate the step expression into
 a temporary and compute a hidden iteration count before entering 
-the loop''s body.  User code cannot effect the counter, and the
+the loop's body.  User code cannot effect the counter, and the
 end-loop check simply decrements the counter and checks for zero.
 
 The whole phrase FOR iter := ... TO end_exp can be repeated
@@ -172,7 +172,7 @@ is discussed later.
 The loop counter calculations need careful design since a loop
 from MININT TO MAXINT must work, in the precision of integers.
 
-Here''s how it works, in C:
+Here's how it works, in C:
 
         0) The DO ... OD loop is simply a block with 
            its own scope.  
@@ -207,7 +207,7 @@ Here''s how it works, in C:
                 start_temp = start_exp
                 end_temp = end_exp
 		if (end_exp < start_exp) goto end_loop
-                /* following line is all unsigned arithmetic */
+                // following line is all unsigned arithmetic
 		iter_var = (end_exp - start_exp + step_exp) / step_exp
                 user_var = start_temp
 	   loop_top:
@@ -230,7 +230,7 @@ Here''s how it works, in C:
                 start_temp = start_exp
                 end_temp = end_exp
 		if (end_exp > start_exp) goto end_loop
-                /* following line is all unsigned arithmetic */
+                // following line is all unsigned arithmetic
 		iter_var = (start_exp - end_exp + step_exp) / step_exp
                 user_var = start_temp
 	   loop_top:
@@ -246,9 +246,9 @@ Here''s how it works, in C:
 	pop scope
 
 
-        5) The range loop, which iterates over a mode''s possible
+        5) The range loop, which iterates over a mode's possible
            values, works just like the above step loops, but with
-           the start and end values taken from the mode''s lower
+           the start and end values taken from the mode's lower
            and upper domain values.
 
 
@@ -261,7 +261,7 @@ Here''s how it works, in C:
              loc_ptr_temp as pointer to a composite base type
         
                if array is varying
-                   iter_var = array''s length field
+                   iter_var = array's length field
                else
                    iter_var = sizeof array / sizeof base_type
 	       loc_ptr_temp = &of highest or lowest indexable entry
@@ -285,9 +285,9 @@ Here''s how it works, in C:
 
 	        powerset_temp := start_exp
 	   loop_top:
-	        /* if DOWN */
+	        // if DOWN
                 if (__flsetclrpowerset () == 0) goto end_loop;
-                /* not DOWN */
+                // not DOWN
                 if (__ffsetclrpowerset () == 0) goto end_loop;
 		if (!condition) goto end_loop
 		.
@@ -298,22 +298,22 @@ Here''s how it works, in C:
 	pop scope
 
 
-So, here''s the general DO FOR schema, as implemented here:
+So, here's the general DO FOR schema, as implemented here:
 
         classify_loop       -- what type of loop have we?
                             -- build_iterator does some of this, also
-        expand_start_loop   -- start the loop''s control scope
+        expand_start_loop   -- start the loop's control scope
         -- start scope for synthesized loop variables
         declare_temps       -- create, initialize temporary variables
         maybe_skip_loop     -- skip loop if end conditions unsatisfiable
         initialize_iter_var -- initialize the iteration counter
-                            -- initialize user''s loop variable
+                            -- initialize user's loop variable
         expand_start_loop   -- generate top-of-loop label
         top_loop_end_check  -- generate while code and/or
                                powerset find-a-bit function call
         .
         .
-        .  user''s loop body code
+        .  user's loop body code
         .
         .
         bottom_loop_end_check  -- exit if counter has become zero
@@ -332,7 +332,7 @@ the 'increment_temps' step must incremen
        "the actions statement list in a do action, including any
        loop counter and while control".  This means that an exp-
        ression in a WHILE control can include references to the
-       loop counters created for the loop''s exclusive use.  
+       loop counters created for the loop's exclusive use.  
        Example:
 
              DCL a (1:10) INT;
@@ -341,9 +341,9 @@ the 'increment_temps' step must incremen
              ...
              OD;
        The 'j' referenced in the while is the loc-identity 'j'
-       created inside the loop''s scope, and NOT the 'j' declared
+       created inside the loop's scope, and NOT the 'j' declared
        before the loop.
-#endif
+*/
 
 /*
  * The following routines are called directly by the
===================================================================
Index: ch/tasking.c
--- ch/tasking.c	2000/12/07 01:55:52	1.16
+++ ch/tasking.c	2001/10/30 04:23:42
@@ -1218,19 +1218,19 @@ build_instance_type ()
   pointer_to_instance = build_chill_pointer_type (instance_type_node);
 }
 
-#if 0
+/*
  *
  * The tasking message descriptor looks like this C structure:
  *
  * typedef struct
  *   {
- *     short *sc;                 /* ptr to code integer */
- *     int    data_len;           /* length of signal/buffer data msg */
- *     void  *data;               /* ptr to signal/buffer data */
+ *     short *sc;                 // ptr to code integer
+ *     int    data_len;           // length of signal/buffer data msg
+ *     void  *data;               // ptr to signal/buffer data
  *   } SignalDescr;
  *
  *
-#endif
+ */
 
 static void
 build_tasking_message_type ()
@@ -1486,7 +1486,7 @@ expand_send_signal (sigmsgbuffer, optrou
 		  tree_cons (NULL_TREE, linenumber, NULL_TREE)))))))));
 }
 
-#if 0
+/*
  * The following code builds a RECEIVE CASE action, which actually
  * has 2 different functionalities:
  *
@@ -1512,16 +1512,16 @@ expand_send_signal (sigmsgbuffer, optrou
  *        STOP;
  *      ESAC;
  *
- * Because we don''t know until we get to the ESAC how
+ * Because we don't know until we get to the ESAC how
  * many signals need processing, we generate the following
  * C-equivalent code:
  *
- * /* define the codes for the signals */
+ * // define the codes for the signals
  * static short __tmp_advance_code;
  * static short __tmp_terminate_code;
  * static short __tmp_sig1_code;
  *
- * /* define the types of the signals */
+ * // define the types of the signals
  * typedef struct
  *  {
  *     char fld0;
@@ -1536,7 +1536,7 @@ expand_send_signal (sigmsgbuffer, optrou
  * static short count;
  * static char char_code;
  *
- * {               /* start a new symbol context */
+ * {               // start a new symbol context
  *   int    number_of_sigs;
  *   short *sig_code [];
  *   void  *sigdatabuf;
@@ -1554,22 +1554,22 @@ expand_send_signal (sigmsgbuffer, optrou
  *                                 &instance_loc);
  *   if (sigcode == __tmp_advance_code)
  *     {
- *       /* code for advance alternative's action_statement_list */
+ *       // code for advance alternative's action_statement_list
  *       count++;
  *     }
  *   else if (sigcode == __tmp_terminate_code)
  *     {
- *        /* copy signal's data to where they belong,
- *           with range-check, if enabled */
+ *        // copy signal's data to where they belong,
+ *           with range-check, if enabled
  *        char_code = ((__tmp_terminate_struct *)sigdatabuf)->fld0;
  *
- *       /* code for terminate alternative's action_statement_list */
+ *       // code for terminate alternative's action_statement_list
  *        __send_signal (sig1 ..... );
  *        goto __workloop_end;
  *     }
  *   else
  *     {
- *        /* code here for the ELSE action_statement_list */
+ *        // code here for the ELSE action_statement_list
  *        __stop_process ();
  *     }
  *   goto __rc_done;
@@ -1586,7 +1586,7 @@ expand_send_signal (sigmsgbuffer, optrou
  *   goto __rcdoit;
  *
  * __rc_done: ;
- * }               /* end the new symbol context */
+ * }               // end the new symbol context
  * __workloop_end: ;
  *
  *
@@ -1612,7 +1612,7 @@ expand_send_signal (sigmsgbuffer, optrou
  *          STOP;
  *      ESAC;
  *
- * Because we don''t know until we get to the ESAC how
+ * Because we don't know until we get to the ESAC how
  * many buffers need processing, we generate the following
  * C-equivalent code:
  *
@@ -1630,7 +1630,7 @@ expand_send_signal (sigmsgbuffer, optrou
  * static short count;
  *
  * workloop:
- * {                     /* start a new symbol context */
+ * {                     // start a new symbol context
  *   int     number_of_sigs;
  *   void   *sig_code [];
  *   void   *sigdatabuf;
@@ -1684,10 +1684,10 @@ expand_send_signal (sigmsgbuffer, optrou
  *   goto __rcdoit;
  *
  *  __rc_done;
- * }          /* end of symbol context */
+ * }          // end of symbol context
  * __workloop_end:
  *
-#endif
+ */
 
 struct rc_state_type
 {
@@ -2381,7 +2381,7 @@ void expand_continue_event (evloc)
           tree_cons (NULL_TREE, linenumber, NULL_TREE)))));
 }
 
-#if 0
+/*
  * The following code builds a DELAY CASE statement,
  * which looks like this in CHILL:
  *
@@ -2394,12 +2394,12 @@ void expand_continue_event (evloc)
  *      (ev2, ev3): count2 +:= 1;
  *    ESAC; 
  *
- * Because we don''t know until we get to the ESAC how
+ * Because we don't know until we get to the ESAC how
  * many events need processing, we generate the following
  * C-equivalent code:
  *
  *
- * {               /* start a new symbol context */
+ * {               // start a new symbol context
  *   typedef struct
  *   {
  *      void           *p;
@@ -2419,12 +2419,12 @@ void expand_continue_event (evloc)
  *                                    linenumber);
  *   if (whatevent == &ev1)
  *     {
- *       /* code for ev1 alternative's action_statement_list */
+ *       // code for ev1 alternative's action_statement_list
  *       count1 += 1;
  *     }
  *   else if (whatevent == &ev2 || whatevent == &ev3)
  *     {
- *       /* code for ev2 and ev3 alternative's action_statement_list */
+ *       // code for ev2 and ev3 alternative's action_statement_list
  *       count2 += 1;
  *     }
  *   goto __dl_done;
@@ -2440,9 +2440,9 @@ void expand_continue_event (evloc)
  *
  * __dl_done: 
  *   ;
- * }               /* end the new symbol context */
+ * }               // end the new symbol context
  *
-#endif
+ */
 
 struct dl_state_type
 {
@@ -2708,7 +2708,7 @@ gen_dldoit: 
   free(dl_state);
 }
 
-#if 0
+/*
  * The following code builds a simple delay statement,
  * which looks like this in CHILL:
  *
@@ -2729,16 +2729,15 @@ gen_dldoit: 
  *
  * static short __tmp_ev1_code;
  * 
- * {  /* start a new symbol context */
+ * {  // start a new symbol context
  *
  *   Descr __delay_array[1] = { { ev1, 5 } };
  *
  *   __delay_event (1, &__delay_array, 7, NULL,
  *		    filename, linenumber);
  *
- * } /* end of symbol scope */
+ * } // end of symbol scope
  */
-#endif
 void
 build_delay_action (event, optpriority)
 	tree event, optpriority;
===================================================================
Index: ch/timing.c
--- ch/timing.c	2001/01/28 01:50:08	1.10
+++ ch/timing.c	2001/10/30 04:23:42
@@ -189,7 +189,7 @@ timing_init ()
 		    0, NOT_BUILT_IN, NULL_PTR);
 }
 
-#if 0
+/*
  *
  * build AT action
  *
@@ -206,7 +206,7 @@ timing_init ()
  * else
  *   to-action-list
  *
-#endif
+ */
 
 void
 build_at_action (t)
@@ -235,7 +235,7 @@ build_at_action (t)
   emit_line_note (input_filename, lineno);
 }
 
-#if 0
+/* 
  *
  * build CYCLE action
  *
@@ -254,7 +254,7 @@ build_at_action (t)
  *    goto label;
  *  }
  *
-#endif
+ */
 
 tree
 build_cycle_start (t)
@@ -317,7 +317,7 @@ build_cycle_end (toid)
   expand_goto (TREE_VALUE (toid));
 }
 
-#if 0
+/*
  *
  * build AFTER ACTION
  *
@@ -343,7 +343,7 @@ build_cycle_end (toid)
  *   end-label:
  * }
  *
-#endif
+ */
 
 void
 build_after_start (duration, delay_flag)
===================================================================
Index: ch/typeck.c
--- ch/typeck.c	2000/11/07 22:49:55	1.26
+++ ch/typeck.c	2001/10/30 04:23:43
@@ -1722,12 +1722,10 @@ chill_similar (mode1, mode2, chain)
 
     default:
       ;
-#if 0
       /* Need to handle row modes, instance modes,
 	 association modes, access modes, text modes,
 	 duration modes, absolute time modes, structure modes,
 	 parameterized structure modes */
-#endif
     }
   return 1;
 }
@@ -1809,9 +1807,9 @@ chill_l_equivalent (mode1, mode2, chain)
     return 0;
   if (TYPE_READONLY (mode1) != TYPE_READONLY (mode2))
     return 0;
-#if 0
+/*
   ... other conditions ...;
-#endif
+ */
   return 1;
 }
 
@@ -1837,9 +1835,9 @@ chill_read_compatible (modeM, modeN)
 	{
 	  return chill_l_equivalent (TREE_TYPE (modeM), TREE_TYPE (modeN), 0);
 	}
-#if 0
+/*
       ...;
-#endif
+*/
     }
   return 1;
 }
@@ -1889,13 +1887,12 @@ chill_compatible (expr, mode)
     case CH_REFERENCE_CLASS:
       if (!CH_IS_REFERENCE_MODE (mode))
 	return 0;
-#if 0
-      /* FIXME! */
+/* FIXME!
       if (class.mode is a row mode)
 	...;
       else if (class.mode is not a static mode)
-	return 0; /* is this possible? FIXME */
-#endif
+	return 0; is this possible?
+*/
       return !CH_IS_BOUND_REFERENCE_MODE(mode)
 	|| CH_READ_COMPATIBLE (TREE_TYPE (mode), class.mode);
     }



More information about the Gcc-patches mailing list