Commit 7455080c by David Malcolm Committed by David Malcolm

Const-correctness fixes for some gimple accessors

gcc/
	* gimple.h (gimple_assign_single_p): Accept a const_gimple rather
	than a gimple.
	(gimple_store_p): Likewise.
	(gimple_assign_load_p): Likewise.
	(gimple_assign_cast_p): Likewise.
	(gimple_clobber_p): Likewise.

	* doc/gimple.texi (gimple_assign_cast_p): Accept a const_gimple
	rather than a gimple.
	(gimple_assign_cast_p): Likewise.

From-SVN: r209548
parent aeb9579a
2014-04-21 David Malcolm <dmalcolm@redhat.com>
* gimple.h (gimple_assign_single_p): Accept a const_gimple rather
than a gimple.
(gimple_store_p): Likewise.
(gimple_assign_load_p): Likewise.
(gimple_assign_cast_p): Likewise.
(gimple_clobber_p): Likewise.
* doc/gimple.texi (gimple_assign_cast_p): Accept a const_gimple
rather than a gimple.
(gimple_assign_cast_p): Likewise.
2014-04-21 Michael Meissner <meissner@linux.vnet.ibm.com> 2014-04-21 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/60735 PR target/60735
......
...@@ -701,7 +701,7 @@ Return true if the code of g is @code{GIMPLE_CALL}. ...@@ -701,7 +701,7 @@ Return true if the code of g is @code{GIMPLE_CALL}.
Return true if the code of g is @code{GIMPLE_DEBUG}. Return true if the code of g is @code{GIMPLE_DEBUG}.
@end deftypefn @end deftypefn
@deftypefn {GIMPLE function} bool gimple_assign_cast_p (gimple g) @deftypefn {GIMPLE function} bool gimple_assign_cast_p (const_gimple g)
Return true if g is a @code{GIMPLE_ASSIGN} that performs a type cast Return true if g is a @code{GIMPLE_ASSIGN} that performs a type cast
operation. operation.
@end deftypefn @end deftypefn
...@@ -1102,7 +1102,7 @@ Set @code{RHS} to be the third operand on the @code{RHS} of assignment ...@@ -1102,7 +1102,7 @@ Set @code{RHS} to be the third operand on the @code{RHS} of assignment
statement @code{G}. statement @code{G}.
@end deftypefn @end deftypefn
@deftypefn {GIMPLE function} bool gimple_assign_cast_p (gimple s) @deftypefn {GIMPLE function} bool gimple_assign_cast_p (const_gimple s)
Return true if @code{S} is a type-cast assignment. Return true if @code{S} is a type-cast assignment.
@end deftypefn @end deftypefn
......
...@@ -2330,7 +2330,7 @@ gimple_assign_rhs_class (const_gimple gs) ...@@ -2330,7 +2330,7 @@ gimple_assign_rhs_class (const_gimple gs)
and do not have the semantics of a copy, such as COND_EXPR. */ and do not have the semantics of a copy, such as COND_EXPR. */
static inline bool static inline bool
gimple_assign_single_p (gimple gs) gimple_assign_single_p (const_gimple gs)
{ {
return (is_gimple_assign (gs) return (is_gimple_assign (gs)
&& gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS); && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS);
...@@ -2339,7 +2339,7 @@ gimple_assign_single_p (gimple gs) ...@@ -2339,7 +2339,7 @@ gimple_assign_single_p (gimple gs)
/* Return true if GS performs a store to its lhs. */ /* Return true if GS performs a store to its lhs. */
static inline bool static inline bool
gimple_store_p (gimple gs) gimple_store_p (const_gimple gs)
{ {
tree lhs = gimple_get_lhs (gs); tree lhs = gimple_get_lhs (gs);
return lhs && !is_gimple_reg (lhs); return lhs && !is_gimple_reg (lhs);
...@@ -2348,7 +2348,7 @@ gimple_store_p (gimple gs) ...@@ -2348,7 +2348,7 @@ gimple_store_p (gimple gs)
/* Return true if GS is an assignment that loads from its rhs1. */ /* Return true if GS is an assignment that loads from its rhs1. */
static inline bool static inline bool
gimple_assign_load_p (gimple gs) gimple_assign_load_p (const_gimple gs)
{ {
tree rhs; tree rhs;
if (!gimple_assign_single_p (gs)) if (!gimple_assign_single_p (gs))
...@@ -2365,7 +2365,7 @@ gimple_assign_load_p (gimple gs) ...@@ -2365,7 +2365,7 @@ gimple_assign_load_p (gimple gs)
/* Return true if S is a type-cast assignment. */ /* Return true if S is a type-cast assignment. */
static inline bool static inline bool
gimple_assign_cast_p (gimple s) gimple_assign_cast_p (const_gimple s)
{ {
if (is_gimple_assign (s)) if (is_gimple_assign (s))
{ {
...@@ -2381,7 +2381,7 @@ gimple_assign_cast_p (gimple s) ...@@ -2381,7 +2381,7 @@ gimple_assign_cast_p (gimple s)
/* Return true if S is a clobber statement. */ /* Return true if S is a clobber statement. */
static inline bool static inline bool
gimple_clobber_p (gimple s) gimple_clobber_p (const_gimple s)
{ {
return gimple_assign_single_p (s) return gimple_assign_single_p (s)
&& TREE_CLOBBER_P (gimple_assign_rhs1 (s)); && TREE_CLOBBER_P (gimple_assign_rhs1 (s));
......
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