aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.h
diff options
context:
space:
mode:
authorIlya Enkovich <ilya.enkovich@intel.com>2013-10-30 09:09:44 +0000
committerKirill Yukhin <kyukhin@gcc.gnu.org>2013-10-30 09:09:44 +0000
commitea9637cdcdf4b66f56c19079c786927174289f59 (patch)
tree5587fa3d365aa2710f61defe58124d11a5e1e147 /gcc/gimple.h
parent0038da669587ccb1781a136f153a7e951d04465a (diff)
downloadgcc-ea9637cdcdf4b66f56c19079c786927174289f59.zip
gcc-ea9637cdcdf4b66f56c19079c786927174289f59.tar.gz
gcc-ea9637cdcdf4b66f56c19079c786927174289f59.tar.bz2
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
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r--gcc/gimple.h47
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 \