From ea9637cdcdf4b66f56c19079c786927174289f59 Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Wed, 30 Oct 2013 09:09:44 +0000 Subject: tree-core.h (tree_index): Add TI_POINTER_BOUNDS_TYPE. * tree-core.h (tree_index): Add TI_POINTER_BOUNDS_TYPE. * tree.h (POINTER_BOUNDS_P): New. (BOUNDED_TYPE_P): New. (BOUNDED_P): New. (pointer_bounds_type_node): New. * tree.c (build_common_tree_nodes): Initialize pointer_bounds_type_node. * gimple.h (gimple_call_get_nobnd_arg_index): New. (gimple_call_num_nobnd_args): New. (gimple_call_nobnd_arg): New. (gimple_return_retbnd): New. (gimple_return_set_retbnd): New * gimple.c (gimple_build_return): Increase number of ops for return statement. (gimple_call_get_nobnd_arg_index): New. * gimple-pretty-print.c (dump_gimple_return): Print second op. From-SVN: r204199 --- gcc/gimple.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'gcc/gimple.c') diff --git a/gcc/gimple.c b/gcc/gimple.c index 3ddceb9..20f6010 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -174,7 +174,7 @@ gimple_build_with_ops_stat (enum gimple_code code, unsigned subcode, gimple gimple_build_return (tree retval) { - gimple s = gimple_build_with_ops (GIMPLE_RETURN, ERROR_MARK, 1); + gimple s = gimple_build_with_ops (GIMPLE_RETURN, ERROR_MARK, 2); if (retval) gimple_return_set_retval (s, retval); return s; @@ -366,6 +366,26 @@ gimple_build_call_from_tree (tree t) } +/* Return index of INDEX's non bound argument of the call. */ + +unsigned +gimple_call_get_nobnd_arg_index (const_gimple gs, unsigned index) +{ + unsigned num_args = gimple_call_num_args (gs); + for (unsigned n = 0; n < num_args; n++) + { + if (POINTER_BOUNDS_P (gimple_call_arg (gs, n))) + continue; + else if (index) + index--; + else + return n; + } + + gcc_unreachable (); +} + + /* Extract the operands and code for expression EXPR into *SUBCODE_P, *OP1_P, *OP2_P and *OP3_P respectively. */ -- cgit v1.1