diff options
author | Richard Henderson <rth@redhat.com> | 2004-07-20 15:47:58 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-07-20 15:47:58 -0700 |
commit | 14797075918d654f5af84c932568b9e18613ba39 (patch) | |
tree | f7623cae82fb1fbeb03ddb9092988dee9f6d87c9 /gcc/tree-gimple.c | |
parent | 40a37b0473df632dc35e34d1060a12e05d4a2110 (diff) | |
download | gcc-14797075918d654f5af84c932568b9e18613ba39.tar.gz |
gimplify.c (is_gimple_tmp_var): Move to tree-gimple.c.
* gimplify.c (is_gimple_tmp_var): Move to tree-gimple.c.
(gimplify_compound_lval): Use is_gimple_tmp_reg.
* tree-gimple.c (is_gimple_tmp_var): Move from gimplify.c.
(is_gimple_tmp_reg): New.
* tree-gimple.h (is_gimple_tmp_reg): Declare.
From-SVN: r84975
Diffstat (limited to 'gcc/tree-gimple.c')
-rw-r--r-- | gcc/tree-gimple.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/tree-gimple.c b/gcc/tree-gimple.c index 488173fb620..2b119fdab87 100644 --- a/gcc/tree-gimple.c +++ b/gcc/tree-gimple.c @@ -447,6 +447,34 @@ is_gimple_reg (tree t) && ! needs_to_live_in_memory (t)); } +/* Returns true if T is a GIMPLE temporary variable, false otherwise. */ + +bool +is_gimple_tmp_var (tree t) +{ + /* FIXME this could trigger for other local artificials, too. */ + return (TREE_CODE (t) == VAR_DECL && DECL_ARTIFICIAL (t) + && !TREE_STATIC (t) && !DECL_EXTERNAL (t)); +} + +/* Returns true if T is a GIMPLE temporary register variable. */ + +bool +is_gimple_tmp_reg (tree t) +{ + /* The intent of this is to get hold of a value that won't change. + An SSA_NAME qualifies no matter if its of a user variable or not. */ + if (TREE_CODE (t) == SSA_NAME) + return true; + + /* We don't know the lifetime characteristics of user variables. */ + if (TREE_CODE (t) != VAR_DECL || !DECL_ARTIFICIAL (t)) + return false; + + /* Finally, it must be capable of being placed in a register. */ + return is_gimple_reg (t); +} + /* Return true if T is a GIMPLE variable whose address is not needed. */ bool |