OSDN Git Service

ch:
[pf3gnuchains/gcc-fork.git] / gcc / integrate.h
index f0c46ff..5bc4569 100644 (file)
@@ -1,5 +1,5 @@
 /* Function integration definitions for GNU C-Compiler
-   Copyright (C) 1990, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1990, 1995, 1998, 1999, 2000 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -18,6 +18,8 @@ along with GNU CC; see the file COPYING.  If not, write to
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+#include "varray.h"
+
 /* This structure is used to remap objects in the function being inlined to
    those belonging to the calling function.  It is passed by
    expand_inline_function to its children.
@@ -40,6 +42,8 @@ struct inline_remap
   union tree_node *fndecl;
   /* Place to put insns needed at start of function.  */
   rtx insns_at_start;
+  /* Mapping from old BLOCKs to new BLOCKs.  */
+  varray_type block_map;
   /* Mapping from old registers to new registers.
      It is allocated and deallocated in `expand_inline_function' */
   rtx *reg_map;
@@ -67,19 +71,15 @@ struct inline_remap
      pseudos that contain pointers into the replacement area allocated for
      this inline instance.  These pseudos are then marked as being equivalent
      to the appropriate address and substituted if valid.  */
-  rtx *const_equiv_map;
-  /* Number of entries in const_equiv_map and const_arg_map.  */
-  int const_equiv_map_size;
+  varray_type const_equiv_varray;
   /* This is incremented for each new basic block.
-     It is used to store in const_age_map to record the domain of validity
-     of each entry in const_equiv_map.
+     It is used to store in the age field to record the domain of validity
+     of each entry in const_equiv_varray.
      A value of -1 indicates an entry for a reg which is a parm.
      All other values are "positive".  */
 #define CONST_AGE_PARM (-1)
   unsigned int const_age;
-  /* In parallel with const_equiv_map, record the valid age for each entry.
-     The entry is invalid if its age is less than const_age.  */
-  unsigned int *const_age_map;
+
   /* Target of the inline function being expanded, or NULL if none.  */
   rtx inline_target;
   /* When an insn is being copied by copy_rtx_and_substitute,
@@ -95,7 +95,7 @@ struct inline_remap
 
   /* Indications for regs being pointers and their alignment.  */
   char *regno_pointer_flag;
-  char *regno_pointer_align;
+  unsigned char *regno_pointer_align;
 
   /* The next few fields are used for subst_constants to record the SETs
      that it saw.  */
@@ -116,22 +116,45 @@ struct inline_remap
 
 /* Return a copy of an rtx (as needed), substituting pseudo-register,
    labels, and frame-pointer offsets as necessary.  */
-extern rtx copy_rtx_and_substitute PROTO((rtx, struct inline_remap *));
+extern rtx copy_rtx_and_substitute PARAMS ((rtx, struct inline_remap *, int));
 
-extern void try_constants PROTO((rtx, struct inline_remap *));
+/* Copy a declaration when one function is substituted inline into
+   another.  */
+extern union tree_node *copy_decl_for_inlining PARAMS ((union tree_node *,
+                                                     union tree_node *,
+                                                     union tree_node *));
 
-extern void mark_stores PROTO((rtx, rtx));
+extern void try_constants PARAMS ((rtx, struct inline_remap *));
 
 /* Return the label indicated.  */
-extern rtx get_label_from_map PROTO((struct inline_remap *, int));
+extern rtx get_label_from_map PARAMS ((struct inline_remap *, int));
 
 /* Set the label indicated.  */
-#define set_label_in_map(map, i, x) \
-  ((map)->label_map[i] = (x))
-
-/* Unfortunately, we need a global copy of const_equiv map for communication
-   with a function called from note_stores.  Be *very* careful that this
-   is used properly in the presence of recursion.  */
-
-extern rtx *global_const_equiv_map;
-extern int global_const_equiv_map_size;
+#define set_label_in_map(MAP, I, X) ((MAP)->label_map[I] = (X))
+
+/* Unfortunately, we need a global copy of const_equiv varray for
+   communication with a function called from note_stores.  Be *very*
+   careful that this is used properly in the presence of recursion.  */
+
+extern varray_type global_const_equiv_varray;
+
+#define MAYBE_EXTEND_CONST_EQUIV_VARRAY(MAP,MAX)                       \
+  {                                                                    \
+    if ((size_t)(MAX) >= VARRAY_SIZE ((MAP)->const_equiv_varray))      \
+      {                                                                        \
+        int is_global = (global_const_equiv_varray                     \
+                        == (MAP)->const_equiv_varray);                 \
+        VARRAY_GROW ((MAP)->const_equiv_varray, (MAX)+1);              \
+       if (is_global)                                                  \
+          global_const_equiv_varray = (MAP)->const_equiv_varray;       \
+      }                                                                        \
+  }
+
+#define SET_CONST_EQUIV_DATA(MAP,REG,RTX,AGE)                          \
+  {                                                                    \
+    struct const_equiv_data *p;                                                \
+    MAYBE_EXTEND_CONST_EQUIV_VARRAY ((MAP), REGNO (REG));              \
+    p = &VARRAY_CONST_EQUIV ((MAP)->const_equiv_varray, REGNO (REG));  \
+    p->rtx = (RTX);                                                    \
+    p->age = (AGE);                                                    \
+  }