OSDN Git Service

2008-02-06 Douglas Gregor <doug.gregor@gmail.com>
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-operands.h
index 35d59a4..ba9793d 100644 (file)
@@ -1,11 +1,11 @@
 /* SSA operand management for trees.
-   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
+Software Foundation; either version 3, or (at your option) any later
 version.
 
 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
@@ -14,9 +14,8 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301, USA.  */
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
 
 #ifndef GCC_TREE_SSA_OPERANDS_H
 #define GCC_TREE_SSA_OPERANDS_H
@@ -58,7 +57,7 @@ typedef struct vuse_element_d
 
 typedef struct vuse_vec_d
 {
-  int num_vuse;
+  unsigned int num_vuse;
   vuse_element_t uses[1];
 } vuse_vec_t;
 typedef struct vuse_vec_d *vuse_vec_p;
@@ -70,23 +69,23 @@ typedef struct vuse_vec_d *vuse_vec_p;
 
 #ifdef ENABLE_CHECKING
 #define VUSE_VECT_ELEMENT(V,X)                                         \
-    (gcc_assert ((X) >= 0 && (X) < VUSE_VECT_NUM_ELEM (V)),            \
+    (gcc_assert (((unsigned int) (X)) < VUSE_VECT_NUM_ELEM (V)),       \
      VUSE_VECT_ELEMENT_NC (V,X))
 
 #define VUSE_ELEMENT_PTR(V,X)                                          \
-    (gcc_assert ((X) >= 0 && (X) < VUSE_VECT_NUM_ELEM (V)),            \
+    (gcc_assert (((unsigned int) (X)) < VUSE_VECT_NUM_ELEM (V)),       \
      VUSE_ELEMENT_PTR_NC (V, X))
 
 #define SET_VUSE_VECT_ELEMENT(V,X,N)                                   \
-    (gcc_assert ((X) >= 0 && (X) < VUSE_VECT_NUM_ELEM (V)),            \
+    (gcc_assert (((unsigned int) (X)) < VUSE_VECT_NUM_ELEM (V)),       \
      VUSE_VECT_ELEMENT_NC (V,X) = (N))
 
 #define SET_VUSE_ELEMENT_VAR(V,X,N)                                    \
-    (gcc_assert ((X) >= 0 && (X) < VUSE_VECT_NUM_ELEM (V)),            \
+    (gcc_assert (((unsigned int) (X)) < VUSE_VECT_NUM_ELEM (V)),       \
      VUSE_VECT_ELEMENT_NC ((V),(X)).use_var = (N))
 
 #define SET_VUSE_ELEMENT_PTR(V,X,N)                                    \
-    (gcc_assert ((X) >= 0 && (X) < VUSE_VECT_NUM_ELEM (V)),            \
+    (gcc_assert (((unsigned int) (X)) < VUSE_VECT_NUM_ELEM (V)),       \
      VUSE_ELEMENT_PTR_NC (V, X) = (N))
 #else
 #define VUSE_VECT_ELEMENT(V,X) VUSE_VECT_ELEMENT_NC(V,X)
@@ -124,6 +123,8 @@ struct ssa_operand_memory_d GTY((chain_next("%h.next")))
 struct ssa_operands GTY(()) {
    struct ssa_operand_memory_d *operand_memory;
    unsigned operand_memory_index;
+   /* Current size of the operand memory buffer.  */
+   unsigned int ssa_operand_mem_size;
 
    bool ops_active;
 
@@ -201,17 +202,16 @@ typedef struct stmt_operands_d *stmt_operands_p;
 #define PHI_ARG_INDEX_FROM_USE(USE)   phi_arg_index_from_use (USE)
 
 
-extern struct voptype_d *realloc_vdef (struct voptype_d *, int);
-extern struct voptype_d *realloc_vuse (struct voptype_d *, int);
-
 extern void init_ssa_operands (void);
 extern void fini_ssa_operands (void);
 extern void free_ssa_operands (stmt_operands_p);
 extern void update_stmt_operands (tree);
+extern void free_stmt_operands (tree);
 extern bool verify_imm_links (FILE *f, tree var);
 
 extern void copy_virtual_operands (tree, tree);
-extern void create_ssa_artificial_load_stmt (tree, tree);
+extern int operand_build_cmp (const void *, const void *);
+extern void create_ssa_artificial_load_stmt (tree, tree, bool);
 
 extern void dump_immediate_uses (FILE *file);
 extern void dump_immediate_uses_for (FILE *file, tree var);
@@ -252,8 +252,8 @@ typedef struct ssa_operand_iterator_d
   int num_phi;
   tree phi_stmt;
   bool done;
-  int vuse_index;
-  int mayuse_index;
+  unsigned int vuse_index;
+  unsigned int mayuse_index;
 } ssa_op_iter;
 
 /* These flags are used to determine which operands are returned during 
@@ -297,12 +297,12 @@ typedef struct ssa_operand_iterator_d
        DEFVAR = op_iter_next_def (&(ITER)))
 
 /* This macro executes a loop over the VDEF operands of STMT.  The def
-   and use for each VDEF is returned in DEFVAR and USEVAR
+   and use vector for each VDEF is returned in DEFVAR and USEVECT
    ITER is an ssa_op_iter structure used to control the loop.  */
-#define FOR_EACH_SSA_VDEF_OPERAND(DEFVAR, USEVAR, STMT, ITER)  \
-  for (op_iter_init_vdef (&(ITER), STMT, &(USEVAR), &(DEFVAR));        \
+#define FOR_EACH_SSA_VDEF_OPERAND(DEFVAR, USEVECT, STMT, ITER) \
+  for (op_iter_init_vdef (&(ITER), STMT, &(USEVECT), &(DEFVAR));       \
        !op_iter_done (&(ITER));                                        \
-       op_iter_next_vdef (&(USEVAR), &(DEFVAR), &(ITER)))
+       op_iter_next_vdef (&(USEVECT), &(DEFVAR), &(ITER)))
 
 /* This macro will execute a loop over all the arguments of a PHI which
    match FLAGS.   A use_operand_p is always returned via USEVAR.  FLAGS
@@ -355,8 +355,4 @@ typedef struct ssa_operand_iterator_d
 /* This macro counts the number of operands in STMT matching FLAGS.  */
 #define NUM_SSA_OPERANDS(STMT, FLAGS)  num_ssa_operands (STMT, FLAGS)
 
-extern tree get_mpt_for (tree);
-extern void dump_memory_partitions (FILE *);
-extern void debug_memory_partitions (void);
-
 #endif  /* GCC_TREE_SSA_OPERANDS_H  */