+2001-10-29 Zack Weinberg <zack@codesourcery.com>
+
+ * 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.
+
Sat Sep 22 09:15:08 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* Make-lang.in (cc1chill): Add attribs.o.
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;
return integer_zero_node;
}
-#if 0
+/*
returns a structure like
STRUCT (data STRUCT (flags ULONG,
reclength ULONG,
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 ()
return type;
}
\f
-#if 0
+/*
returns a structure like:
STRUCT (txt STRUCT (flags ULONG,
text_record PTR,
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;
static LOOP *loopstack = (LOOP *)0;
\f
-#if 0
+/*
Here is a CHILL DO FOR statement:
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
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.
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:
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:
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.
\f
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
pop scope
\f
-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
"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;
...
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
+*/
\f
/*
* The following routines are called directly by the
static LOOP *loop_stack = (LOOP *)0;
\f
-#if 0
+/*
Here is a CHILL DO FOR statement:
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
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.
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:
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:
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.
\f
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
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
.
pop scope
\f
-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
"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;
...
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
+*/
\f
/*
* The following routines are called directly by the
pointer_to_instance = build_chill_pointer_type (instance_type_node);
}
\f
-#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 ()
tree_cons (NULL_TREE, linenumber, NULL_TREE)))))))));
}
\f
-#if 0
+/*
* The following code builds a RECEIVE CASE action, which actually
* has 2 different functionalities:
*
* 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;
* 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;
* &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;
* goto __rcdoit;
*
* __rc_done: ;
- * } /* end the new symbol context */
+ * } // end the new symbol context
* __workloop_end: ;
*
*
* 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:
*
* static short count;
*
* workloop:
- * { /* start a new symbol context */
+ * { // start a new symbol context
* int number_of_sigs;
* void *sig_code [];
* void *sigdatabuf;
* goto __rcdoit;
*
* __rc_done;
- * } /* end of symbol context */
+ * } // end of symbol context
* __workloop_end:
*
-#endif
+ */
\f
struct rc_state_type
{
tree_cons (NULL_TREE, linenumber, NULL_TREE)))));
}
\f
-#if 0
+/*
* The following code builds a DELAY CASE statement,
* which looks like this in CHILL:
*
* (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;
* 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;
*
* __dl_done:
* ;
- * } /* end the new symbol context */
+ * } // end the new symbol context
*
-#endif
+ */
\f
struct dl_state_type
{
free(dl_state);
}
\f
-#if 0
+/*
* The following code builds a simple delay statement,
* which looks like this in CHILL:
*
*
* 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;
0, NOT_BUILT_IN, NULL_PTR);
}
-#if 0
+/*
*
* build AT action
*
* else
* to-action-list
*
-#endif
+ */
void
build_at_action (t)
emit_line_note (input_filename, lineno);
}
-#if 0
+/*
*
* build CYCLE action
*
* goto label;
* }
*
-#endif
+ */
tree
build_cycle_start (t)
expand_goto (TREE_VALUE (toid));
}
-#if 0
+/*
*
* build AFTER ACTION
*
* end-label:
* }
*
-#endif
+ */
void
build_after_start (duration, delay_flag)
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;
}
return 0;
if (TYPE_READONLY (mode1) != TYPE_READONLY (mode2))
return 0;
-#if 0
+/*
... other conditions ...;
-#endif
+ */
return 1;
}
{
return chill_l_equivalent (TREE_TYPE (modeM), TREE_TYPE (modeN), 0);
}
-#if 0
+/*
...;
-#endif
+*/
}
return 1;
}
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);
}