diff options
author | Kazu Hirata <kazu@codesourcery.com> | 2007-01-02 17:03:22 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2007-01-02 17:03:22 +0000 |
commit | d887a68299b172a03c4648b16fdfbef9dcf25ce0 (patch) | |
tree | 1f25b7cb7537dc60cde280443031fd6d10f7a458 /gcc/vec.h | |
parent | f1441c81b036c3fd8ec8effc6035d8458e187f38 (diff) | |
download | gcc-d887a68299b172a03c4648b16fdfbef9dcf25ce0.zip gcc-d887a68299b172a03c4648b16fdfbef9dcf25ce0.tar.gz gcc-d887a68299b172a03c4648b16fdfbef9dcf25ce0.tar.bz2 |
alias.c (init_alias_analysis): Use VEC_safe_grow_cleared.
* alias.c (init_alias_analysis): Use VEC_safe_grow_cleared.
* cfgbuild.c (find_basic_blocks): Likewise.
* cfgrtl.c (rtl_create_basic_block): Likewise.
* function.c (temp_slots_at_level): Likewise.
* reg-stack.c (stack_regs_mentioned): Likewise.
* regclass.c (allocate_reg_info): Likewise.
* tree-cfg.c (init_empty_tree_cfg, build_tree_cfg, create_bb,
set_bb_for_stmt, move_block_to_fn): Likewise.
* tree-complex.c (tree_lower_complex): Likewise.
* vec.h (VEC_safe_grow_cleared): New.
From-SVN: r120345
Diffstat (limited to 'gcc/vec.h')
-rw-r--r-- | gcc/vec.h | 46 |
1 files changed, 46 insertions, 0 deletions
@@ -302,6 +302,16 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #define VEC_safe_grow(T,A,V,I) \ (VEC_OP(T,A,safe_grow)(&(V),I VEC_CHECK_INFO MEM_STAT_INFO)) +/* Grow to a specific length. + void VEC_T_A_safe_grow_cleared (VEC(T,A) *&v, int len); + + Grow the vector to a specific length. The LEN must be as + long or longer than the current length. The new elements are + initialized to zero. */ + +#define VEC_safe_grow_cleared(T,A,V,I) \ + (VEC_OP(T,A,safe_grow_cleared)(&(V),I VEC_CHECK_INFO MEM_STAT_INFO)) + /* Replace element T VEC_T_replace (VEC(T) *v, unsigned ix, T val); // Integer T VEC_T_replace (VEC(T) *v, unsigned ix, T val); // Pointer @@ -745,6 +755,15 @@ static inline void VEC_OP (T,A,safe_grow) \ VEC_BASE (*vec_)->num = size_; \ } \ \ +static inline void VEC_OP (T,A,safe_grow_cleared) \ + (VEC(T,A) **vec_, int size_ VEC_CHECK_DECL MEM_STAT_DECL) \ +{ \ + int oldsize = VEC_OP(T,base,length) VEC_BASE(*vec_); \ + VEC_OP (T,A,safe_grow) (vec_, size_ VEC_CHECK_PASS PASS_MEM_STAT); \ + memset (&(VEC_OP (T,base,address) (VEC_BASE(*vec_)))[oldsize], 0, \ + sizeof (T) * (size_ - oldsize)); \ +} \ + \ static inline T *VEC_OP (T,A,safe_push) \ (VEC(T,A) **vec_, T obj_ VEC_CHECK_DECL MEM_STAT_DECL) \ { \ @@ -1014,6 +1033,15 @@ static inline void VEC_OP (T,A,safe_grow) \ VEC_BASE (*vec_)->num = size_; \ } \ \ +static inline void VEC_OP (T,A,safe_grow_cleared) \ + (VEC(T,A) **vec_, int size_ VEC_CHECK_DECL MEM_STAT_DECL) \ +{ \ + int oldsize = VEC_OP(T,base,length) VEC_BASE(*vec_); \ + VEC_OP (T,A,safe_grow) (vec_, size_ VEC_CHECK_PASS PASS_MEM_STAT); \ + memset (&(VEC_OP (T,base,address) (VEC_BASE(*vec_)))[oldsize], 0, \ + sizeof (T) * (size_ - oldsize)); \ +} \ + \ static inline T *VEC_OP (T,A,safe_push) \ (VEC(T,A) **vec_, const T *obj_ VEC_CHECK_DECL MEM_STAT_DECL) \ { \ @@ -1097,6 +1125,24 @@ static inline void VEC_OP (T,A,safe_grow) \ VEC_BASE (*vec_)->num = size_; \ } \ \ +static inline void VEC_OP (T,A,safe_grow_cleared) \ + (VEC(T,A) **vec_, int size_ VEC_CHECK_DECL MEM_STAT_DECL) \ +{ \ + int oldsize = VEC_OP(T,base,length) VEC_BASE(*vec_); \ + VEC_OP (T,A,safe_grow) (vec, size_); \ + memset ((VEC_OP (T,base,address) (vec_))[oldsize], 0, \ + sizeof (T) * (size_ - oldsize)); \ +} \ + \ +static inline void VEC_OP (T,A,safe_grow_cleared) \ + (VEC(T,A) **vec_, int size_ VEC_CHECK_DECL MEM_STAT_DECL) \ +{ \ + int oldsize = VEC_OP(T,base,length) VEC_BASE(*vec_); \ + VEC_OP (T,A,safe_grow) (vec_, size_ VEC_CHECK_PASS PASS_MEM_STAT); \ + memset (&(VEC_OP (T,base,address) (VEC_BASE(*vec_)))[oldsize], 0, \ + sizeof (T) * (size_ - oldsize)); \ +} \ + \ static inline T *VEC_OP (T,A,safe_push) \ (VEC(T,A) **vec_, const T obj_ VEC_CHECK_DECL MEM_STAT_DECL) \ { \ |