This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] use call_expr_flags more
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 5 May 2004 10:08:18 -0700
- Subject: [tree-ssa] use call_expr_flags more
Noticed while looking at something else. Note that call_expr_flags
is more through than either of these places.
r~
* tree-ssa-operands.c (get_call_flags): Remove.
(get_expr_operands): Use call_expr_flags.
* tree-alias-common.c (call_may_clobber): Likewise.
(call_may_return): Likewise.
Index: tree-alias-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-alias-common.c,v
retrieving revision 1.1.2.54
diff -c -p -d -u -r1.1.2.54 tree-alias-common.c
--- tree-alias-common.c 3 Apr 2004 11:12:00 -0000 1.1.2.54
+++ tree-alias-common.c 5 May 2004 17:02:07 -0000
@@ -105,14 +105,12 @@ static bool call_may_return (tree);
static bool
call_may_clobber (tree expr)
{
- tree callee;
int flags;
if (TREE_CODE (expr) != CALL_EXPR)
return false;
- callee = get_callee_fndecl (expr);
- flags = (callee) ? flags_from_decl_or_type (callee) : 0;
+ flags = call_expr_flags (expr);
return (! (flags & (ECF_CONST | ECF_PURE | ECF_NORETURN)));
}
@@ -121,14 +119,12 @@ call_may_clobber (tree expr)
static bool
call_may_return (tree expr)
{
- tree callee;
int flags;
if (TREE_CODE (expr) != CALL_EXPR)
return false;
- callee = get_callee_fndecl (expr);
- flags = (callee) ? flags_from_decl_or_type (callee) : 0;
+ flags = call_expr_flags (expr);
return ! (flags & ECF_NORETURN);
}
Index: tree-ssa-operands.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-operands.c,v
retrieving revision 1.1.2.21
diff -c -p -d -u -r1.1.2.21 tree-ssa-operands.c
--- tree-ssa-operands.c 9 Apr 2004 18:22:38 -0000 1.1.2.21
+++ tree-ssa-operands.c 5 May 2004 17:02:07 -0000
@@ -78,7 +78,6 @@ static void append_vdef (tree, tree, vop
static void add_call_clobber_ops (tree, voperands_t);
static void add_call_read_ops (tree, voperands_t);
static void add_stmt_operand (tree *, tree, int, voperands_t);
-static int get_call_flags (tree);
struct freelist_d GTY((chain_next ("%h.next")))
@@ -636,24 +635,6 @@ add_vuse (tree var, tree stmt)
}
-
-/* Return the ECF_ flags associated with the function called by the
- CALL_EXPR node EXPR. */
-
-static int
-get_call_flags (tree expr)
-{
- tree callee;
-
-#if defined ENABLE_CHECKING
- if (TREE_CODE (expr) != CALL_EXPR)
- abort ();
-#endif
-
- callee = get_callee_fndecl (expr);
- return (callee) ? flags_from_decl_or_type (callee) : 0;
-}
-
/* Get the operands of statement STMT. Note that repeated calls to
get_stmt_operands for the same statement will do nothing until the
statement is marked modified by a call to modify_stmt(). */
@@ -1030,7 +1011,7 @@ get_expr_operands (tree stmt, tree *expr
if (code == CALL_EXPR)
{
tree op;
- int call_flags = get_call_flags (expr);
+ int call_flags = call_expr_flags (expr);
/* Find uses in the called function. */
get_expr_operands (stmt, &TREE_OPERAND (expr, 0), opf_none, prev_vops);