diff options
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r-- | gcc/gimple.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h index b0fb861..b34424c 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -918,6 +918,7 @@ extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *); extern tree get_formal_tmp_var (tree, gimple_seq *); extern void declare_vars (tree, gimple, bool); extern void annotate_all_with_location (gimple_seq, location_t); +extern unsigned gimple_call_get_nobnd_arg_index (const_gimple, unsigned); /* Validation of GIMPLE expressions. Note that these predicates only check the basic form of the expression, they don't recurse to make sure that @@ -2413,6 +2414,32 @@ gimple_call_arg (const_gimple gs, unsigned index) } +/* Return the number of arguments used by call statement GS + ignoring bound ones. */ + +static inline unsigned +gimple_call_num_nobnd_args (const_gimple gs) +{ + unsigned num_args = gimple_call_num_args (gs); + unsigned res = num_args; + for (unsigned n = 0; n < num_args; n++) + if (POINTER_BOUNDS_P (gimple_call_arg (gs, n))) + res--; + return res; +} + + +/* Return INDEX's call argument ignoring bound ones. */ +static inline tree +gimple_call_nobnd_arg (const_gimple gs, unsigned index) +{ + /* No bound args may exist if pointers checker is off. */ + if (!flag_check_pointer_bounds) + return gimple_call_arg (gs, index); + return gimple_call_arg (gs, gimple_call_get_nobnd_arg_index (gs, index)); +} + + /* Return a pointer to the argument at position INDEX for call statement GS. */ @@ -5219,6 +5246,26 @@ gimple_return_set_retval (gimple gs, tree retval) } +/* Return the return bounds for GIMPLE_RETURN GS. */ + +static inline tree +gimple_return_retbnd (const_gimple gs) +{ + GIMPLE_CHECK (gs, GIMPLE_RETURN); + return gimple_op (gs, 1); +} + + +/* Set RETVAL to be the return bounds for GIMPLE_RETURN GS. */ + +static inline void +gimple_return_set_retbnd (gimple gs, tree retval) +{ + GIMPLE_CHECK (gs, GIMPLE_RETURN); + gimple_set_op (gs, 1, retval); +} + + /* Returns true when the gimple statement STMT is any of the OpenMP types. */ #define CASE_GIMPLE_OMP \ |