diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2013-11-18 14:51:45 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2013-11-18 14:51:45 +0000 |
commit | 7c5efc1206d99472b0a1615b9da8f31cd849014b (patch) | |
tree | ea1865acfa2c48b11b47c74919bbc11f420abb9a /gcc/tree.h | |
parent | 5a36c51b09466ab6c403be328a970aa65e47bc90 (diff) | |
download | gcc-7c5efc1206d99472b0a1615b9da8f31cd849014b.zip gcc-7c5efc1206d99472b0a1615b9da8f31cd849014b.tar.gz gcc-7c5efc1206d99472b0a1615b9da8f31cd849014b.tar.bz2 |
tree.h (tree_to_shwi, [...]): Declare, with inline expansions.
gcc/
* tree.h (tree_to_shwi, tree_to_uhwi): Declare, with inline expansions.
* tree.c (tree_to_shwi, tree_to_uhwi): New functions.
From-SVN: r204958
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -3673,6 +3673,8 @@ extern bool tree_fits_uhwi_p (const_tree) #endif ; extern HOST_WIDE_INT tree_low_cst (const_tree, int); +extern HOST_WIDE_INT tree_to_shwi (const_tree); +extern HOST_WIDE_INT tree_to_uhwi (const_tree); #if !defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 4003) extern inline __attribute__ ((__gnu_inline__)) HOST_WIDE_INT tree_low_cst (const_tree t, int pos) @@ -3680,6 +3682,20 @@ tree_low_cst (const_tree t, int pos) gcc_assert (host_integerp (t, pos)); return TREE_INT_CST_LOW (t); } + +extern inline __attribute__ ((__gnu_inline__)) HOST_WIDE_INT +tree_to_shwi (const_tree t) +{ + gcc_assert (tree_fits_shwi_p (t)); + return TREE_INT_CST_LOW (t); +} + +extern inline __attribute__ ((__gnu_inline__)) HOST_WIDE_INT +tree_to_uhwi (const_tree t) +{ + gcc_assert (tree_fits_uhwi_p (t)); + return TREE_INT_CST_LOW (t); +} #endif extern int tree_int_cst_sgn (const_tree); extern int tree_int_cst_sign_bit (const_tree); |