OSDN Git Service

* gcc.texi: Fixes for makeinfo 4.0 --html.
[pf3gnuchains/gcc-fork.git] / gcc / c-iterate.c
index 7fe7a12..1692d2a 100644 (file)
@@ -1,5 +1,6 @@
 /* Build expressions with type checking for C compiler.
-   Copyright (C) 1987, 88, 89, 92, 93, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996
+   1997, 1998, 2000 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -24,26 +25,14 @@ Boston, MA 02111-1307, USA.  */
    both their declarations and the expansion of statements using them.  */
 
 #include "config.h"
-#include <stdio.h>
+#include "system.h"
 #include "tree.h"
 #include "c-tree.h"
 #include "flags.h"
 #include "obstack.h"
 #include "rtl.h"
-
-static void expand_stmt_with_iterators_1 ();
-static tree collect_iterators ();
-static void iterator_loop_prologue ();
-static void iterator_loop_epilogue ();
-static void add_ixpansion ();
-static void delete_ixpansion();
-static int top_level_ixpansion_p ();
-static void istack_sublevel_to_current ();
-
-/* A special obstack, and a pointer to the start of
-   all the data in it (so we can free everything easily).  */
-static struct obstack ixp_obstack;
-static char *ixp_firstobj;
+#include "toplev.h"
+#include "expr.h"
 \f
 /*
                KEEPING TRACK OF EXPANSIONS
@@ -96,11 +85,26 @@ struct iter_stack_node
 };
 
 struct iter_stack_node *iter_stack;
-
 struct iter_stack_node sublevel_ixpansions;
 
+/* A special obstack, and a pointer to the start of
+   all the data in it (so we can free everything easily).  */
+static struct obstack ixp_obstack;
+static char *ixp_firstobj;
+
 /* During collect_iterators, a list of SAVE_EXPRs already scanned.  */
 static tree save_exprs;
+
+static void expand_stmt_with_iterators_1 PARAMS ((tree, tree));
+static tree collect_iterators          PARAMS ((tree, tree));
+static void iterator_loop_prologue     PARAMS ((tree, rtx *, rtx *));
+static void iterator_loop_epilogue     PARAMS ((tree, rtx *, rtx *));
+static int top_level_ixpansion_p       PARAMS ((void));
+static void isn_append                 PARAMS ((struct iter_stack_node *,
+                                                struct iter_stack_node *));
+static void istack_sublevel_to_current PARAMS ((void));
+static void add_ixpansion              PARAMS ((tree, rtx, rtx, rtx, rtx));
+static void delete_ixpansion           PARAMS ((tree));
 \f
 /* Initialize our obstack once per compilation.  */
 
@@ -254,6 +258,8 @@ collect_iterators (exp, list)
                break;
              case RTL_EXPR:
                return list;
+             default:
+               break;
              }
                
            for (i = 0; i < num_args; i++)
@@ -283,7 +289,8 @@ iterator_loop_prologue (idecl, start_note, end_note)
 
   /* Force the save_expr in DECL_INITIAL to be calculated
      if it hasn't been calculated yet.  */
-  expand_expr (DECL_INITIAL (idecl), const0_rtx, VOIDmode, 0);
+  expand_expr (DECL_INITIAL (idecl), const0_rtx, VOIDmode,
+              EXPAND_NORMAL);
 
   if (DECL_RTL (idecl) == 0)
     expand_decl (idecl);
@@ -294,7 +301,7 @@ iterator_loop_prologue (idecl, start_note, end_note)
   /* Initialize counter.  */
   expr = build (MODIFY_EXPR, TREE_TYPE (idecl), idecl, integer_zero_node);
   TREE_SIDE_EFFECTS (expr) = 1;
-  expand_expr (expr, const0_rtx, VOIDmode, 0);
+  expand_expr (expr, const0_rtx, VOIDmode, EXPAND_NORMAL);
 
   expand_start_loop_continue_elsewhere (1);
 
@@ -335,7 +342,7 @@ iterator_loop_epilogue (idecl, start_note, end_note)
   incr = build_binary_op (PLUS_EXPR, idecl, integer_one_node, 0);
   incr = build (MODIFY_EXPR, TREE_TYPE (idecl), idecl, incr);
   TREE_SIDE_EFFECTS (incr) = 1;
-  expand_expr (incr, const0_rtx, VOIDmode, 0);
+  expand_expr (incr, const0_rtx, VOIDmode, EXPAND_NORMAL);
   test = build_binary_op (LT_EXPR, idecl, DECL_INITIAL (idecl), 0);
   expand_exit_loop_if_false (0, test);
   expand_end_loop ();
@@ -411,7 +418,7 @@ void
 push_iterator_stack ()
 {
   struct iter_stack_node *new_top
-    = (struct iter_stack_node*) 
+    = (struct iter_stack_node *) 
       obstack_alloc (&ixp_obstack, sizeof (struct iter_stack_node));
 
   new_top->first = 0;
@@ -444,15 +451,15 @@ add_ixpansion (idecl, pro_start, pro_end, epi_start, epi_end)
      tree idecl;
      rtx pro_start, pro_end, epi_start, epi_end;
 {
-  struct ixpansionnewix;
+  struct ixpansion *newix;
     
   /* Do nothing if we are not inside "({...})",
      as in that case this expansion can't need subsequent RTL modification.  */
   if (iter_stack == 0)
     return;
 
-  newix = (struct ixpansion*) obstack_alloc (&ixp_obstack,
-                                            sizeof (struct ixpansion));
+  newix = (struct ixpansion *) obstack_alloc (&ixp_obstack,
+                                             sizeof (struct ixpansion));
   newix->ixdecl = idecl;
   newix->ixprologue_start = pro_start;
   newix->ixprologue_end   = pro_end;
@@ -473,7 +480,7 @@ static void
 delete_ixpansion (idecl)
      tree idecl;
 {
-  struct ixpansionprevix = 0, *ix;
+  struct ixpansion *previx = 0, *ix;
 
   for (ix = sublevel_ixpansions.first; ix; ix = ix->next)
     if (ix->ixdecl == idecl)
@@ -533,10 +540,10 @@ prdecl (d)
          fprintf (stderr, dname);
        }
       else
-       fprintf (stderr, "<<Not a Decl!!!>>");
+       fprintf (stderr, "<<?>>");
     }
   else
-    fprintf (stderr, "<<NULL!!>>");
+    fprintf (stderr, "<<0>>");
 }
 
 /* Print Iterator List -- names only */
@@ -579,7 +586,7 @@ pixl (head)
   return head;
 }
 
-/* Print Iterator Stack*/
+/* Print Iterator Stack.  */
 
 void
 pis ()