Commit 10b8fa2e by Jan Hubicka Committed by Jan Hubicka

tree.h (int_bit_position): Turn into inline function; implement using wide int.

	* tree.h (int_bit_position): Turn into inline function;
	implement using wide int.
	* tree.c (int_bit_position): Remove.

From-SVN: r215518
parent 54f9184b
2014-09-23 Jan Hubicka <hubicka@ucw.cz>
* tree.h (int_bit_position): Turn into inline function;
implement using wide int.
* tree.c (int_bit_position): Remove.
2014-09-23 Richard Sandiford <richard.sandiford@arm.com> 2014-09-23 Richard Sandiford <richard.sandiford@arm.com>
PR bootstrap/63280 PR bootstrap/63280
...@@ -2831,16 +2831,6 @@ bit_position (const_tree field) ...@@ -2831,16 +2831,6 @@ bit_position (const_tree field)
return bit_from_pos (DECL_FIELD_OFFSET (field), return bit_from_pos (DECL_FIELD_OFFSET (field),
DECL_FIELD_BIT_OFFSET (field)); DECL_FIELD_BIT_OFFSET (field));
} }
/* Likewise, but return as an integer. It must be representable in
that way (since it could be a signed value, we don't have the
option of returning -1 like int_size_in_byte can. */
HOST_WIDE_INT
int_bit_position (const_tree field)
{
return tree_to_shwi (bit_position (field));
}
/* Return the byte position of FIELD, in bytes from the start of the record. /* Return the byte position of FIELD, in bytes from the start of the record.
This is a tree of type sizetype. */ This is a tree of type sizetype. */
......
...@@ -3877,7 +3877,6 @@ extern tree size_in_bytes (const_tree); ...@@ -3877,7 +3877,6 @@ extern tree size_in_bytes (const_tree);
extern HOST_WIDE_INT int_size_in_bytes (const_tree); extern HOST_WIDE_INT int_size_in_bytes (const_tree);
extern HOST_WIDE_INT max_int_size_in_bytes (const_tree); extern HOST_WIDE_INT max_int_size_in_bytes (const_tree);
extern tree bit_position (const_tree); extern tree bit_position (const_tree);
extern HOST_WIDE_INT int_bit_position (const_tree);
extern tree byte_position (const_tree); extern tree byte_position (const_tree);
extern HOST_WIDE_INT int_byte_position (const_tree); extern HOST_WIDE_INT int_byte_position (const_tree);
...@@ -4797,4 +4796,14 @@ extern tree get_inner_reference (tree, HOST_WIDE_INT *, HOST_WIDE_INT *, ...@@ -4797,4 +4796,14 @@ extern tree get_inner_reference (tree, HOST_WIDE_INT *, HOST_WIDE_INT *,
EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */ EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
extern tree array_ref_low_bound (tree); extern tree array_ref_low_bound (tree);
/* Like bit_position, but return as an integer. It must be representable in
that way (since it could be a signed value, we don't have the
option of returning -1 like int_size_in_byte can. */
inline HOST_WIDE_INT
int_bit_position (const_tree field)
{
return (wi::lshift (wi::to_offset (DECL_FIELD_OFFSET (field)), BITS_PER_UNIT_LOG)
+ wi::to_offset (DECL_FIELD_BIT_OFFSET (field))).to_shwi ();
}
#endif /* GCC_TREE_H */ #endif /* GCC_TREE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment