OSDN Git Service

* config/alpha/vms.h (INCLUDE_DEFAULTS): Add /gnu/lib/gcc-lib/include.
[pf3gnuchains/gcc-fork.git] / gcc / ch / loop.c
index 5a1385e..393349b 100644 (file)
@@ -1,5 +1,6 @@
 /* Implement looping actions for CHILL.
-   Copyright (C) 1992, 93, 1994, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000
+   Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -36,15 +37,15 @@ Boston, MA 02111-1307, USA.  */
 int flag_local_loop_counter = 1;
 
 /* forward declarations */
-static int  declare_temps            PROTO((void));
-static int  initialize_iter_var      PROTO((void));
-static void maybe_skip_loop          PROTO((void));
-static int  bottom_loop_end_check    PROTO((void));
-static int  increment_temps          PROTO((void));
-static tree build_temporary_variable PROTO((const char *, tree));
-static tree maybe_make_for_temp      PROTO((tree, const char *, tree));
+static int  declare_temps            PARAMS ((void));
+static int  initialize_iter_var      PARAMS ((void));
+static void maybe_skip_loop          PARAMS ((void));
+static int  bottom_loop_end_check    PARAMS ((void));
+static int  increment_temps          PARAMS ((void));
+static tree build_temporary_variable PARAMS ((const char *, tree));
+static tree maybe_make_for_temp      PARAMS ((tree, const char *, tree));
 #if 0
-static tree chill_unsigned_type      PROTO((tree));
+static tree chill_unsigned_type      PARAMS ((tree));
 #endif
 \f
 /* In terms of the parameters passed to build_loop_iterator,
@@ -130,7 +131,7 @@ typedef struct loop {
 
 static LOOP *loopstack = (LOOP *)0;
 \f
-#if 0
+/*
 
 Here is a CHILL DO FOR statement:
 
@@ -146,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
@@ -159,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.  
@@ -194,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:
@@ -217,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:
@@ -233,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.
 \f
 
@@ -248,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
@@ -289,20 +290,20 @@ Here''s how it works, in C:
        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
@@ -321,7 +322,7 @@ the 'increment_temps' step must increment all temporaries
        "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;
@@ -330,9 +331,9 @@ the 'increment_temps' step must increment all temporaries
              ...
              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
@@ -522,7 +523,7 @@ build_loop_iterator (user_var, start_exp, step_exp, end_exp,
        ip->itype = DO_LOC_VARYING;
       else
        {
-         error ("Loop's IN expression is not a composite object");
+         error ("loop's IN expression is not a composite object");
          return;
        }
     }
@@ -843,7 +844,7 @@ declare_temps ()
              
              if (TREE_CODE (TREE_TYPE (array_type)) == BOOLEAN_TYPE)
                {
-                 error ("Can't iterate through array of BOOL");
+                 error ("can't iterate through array of BOOL");
                  firstp->error_flag = 1;
                  return firstp->error_flag;
                }