diff options
author | obrien <obrien@FreeBSD.org> | 1999-10-16 06:09:09 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1999-10-16 06:09:09 +0000 |
commit | cae8fa8120c70195f34a2456f18c4c848a2d3e0c (patch) | |
tree | f7d3a3ab9c32694206552e767626366f016f2062 /contrib/gcc/varray.h | |
parent | 84656b55b6e25e30322dc903a05de53706361d3d (diff) | |
download | FreeBSD-src-cae8fa8120c70195f34a2456f18c4c848a2d3e0c.zip FreeBSD-src-cae8fa8120c70195f34a2456f18c4c848a2d3e0c.tar.gz |
Virgin import of the GCC 2.95.1 compilers
Diffstat (limited to 'contrib/gcc/varray.h')
-rw-r--r-- | contrib/gcc/varray.h | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/contrib/gcc/varray.h b/contrib/gcc/varray.h index df3ca31..7d4f697 100644 --- a/contrib/gcc/varray.h +++ b/contrib/gcc/varray.h @@ -22,10 +22,6 @@ #ifndef _VARRAY_H_ #define _VARRAY_H_ -#ifndef PROTO -#include "gansidecl.h" -#endif - #ifndef HOST_WIDE_INT #include "machmode.h" #endif @@ -34,6 +30,30 @@ #include "system.h" #endif +/* Auxiliary structure used inside the varray structure, used for + function integration data. */ + +struct const_equiv_data { + /* Map pseudo reg number in calling function to equivalent constant. We + cannot in general substitute constants into parameter pseudo registers, + since some machine descriptions (many RISCs) won't always handle + the resulting insns. So if an incoming parameter has a constant + equivalent, we record it here, and if the resulting insn is + recognizable, we go with it. + + We also use this mechanism to convert references to incoming arguments + and stacked variables. copy_rtx_and_substitute will replace the virtual + incoming argument and virtual stacked variables registers with new + 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 rtx; + + /* Record the valid age for each entry. The entry is invalid if its + age is less than const_age. */ + unsigned age; +}; + /* Union of various array types that are used. */ typedef union varray_data_tag { char c[1]; @@ -54,6 +74,8 @@ typedef union varray_data_tag { struct bitmap_head_def *bitmap[1]; struct sched_info_tag *sched[1]; struct reg_info_def *reg[1]; + struct const_equiv_data const_equiv[1]; + struct basic_block_def *bb[1]; } varray_data; /* Virtual array of pointers header. */ @@ -122,15 +144,24 @@ extern varray_type varray_init PROTO ((size_t, size_t, const char *)); #define VARRAY_REG_INIT(va, num, name) \ va = varray_init (num, sizeof (struct reg_info_def *), name) +#define VARRAY_CONST_EQUIV_INIT(va, num, name) \ + va = varray_init (num, sizeof (struct const_equiv_data), name) + +#define VARRAY_BB_INIT(va, num, name) \ + va = varray_init (num, sizeof (struct basic_block_def *), name) + /* Free up memory allocated by the virtual array, but do not free any of the elements involved. */ -#define VARRAY_FREE(vp) ((vp) && (free (vp), (vp = (varray_type)0))) +#define VARRAY_FREE(vp) \ + do { if (vp) { free (vp); vp = (varray_type)0; } } while (0) /* Grow/shrink the virtual array VA to N elements. */ extern varray_type varray_grow PROTO((varray_type, size_t)); #define VARRAY_GROW(VA, N) ((VA) = varray_grow (VA, N)) +#define VARRAY_SIZE(VA) ((VA)->num_elements) + /* Check for VARRAY_xxx macros being in bound, return N for use as an index. */ #ifdef ENABLE_CHECKING @@ -162,5 +193,7 @@ extern varray_type varray_grow PROTO((varray_type, size_t)); #define VARRAY_BITMAP(VA, N) ((VA)->data.bitmap[ VARRAY_CHECK (VA, N) ]) #define VARRAY_SCHED(VA, N) ((VA)->data.sched[ VARRAY_CHECK (VA, N) ]) #define VARRAY_REG(VA, N) ((VA)->data.reg[ VARRAY_CHECK (VA, N) ]) +#define VARRAY_CONST_EQUIV(VA, N) ((VA)->data.const_equiv[VARRAY_CHECK (VA, N)]) +#define VARRAY_BB(VA, N) ((VA)->data.bb[ VARRAY_CHECK (VA, N) ]) #endif /* _VARRAY_H_ */ |