summaryrefslogtreecommitdiff
path: root/gcc/tree-gimple.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-20 22:47:58 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-20 22:47:58 +0000
commit6a050d3033ffeeb7c68ba3683658406e4d8da464 (patch)
treef7623cae82fb1fbeb03ddb9092988dee9f6d87c9 /gcc/tree-gimple.c
parent6ad9daa3fc480f9330efd5780c41e4be98253683 (diff)
downloadgcc-6a050d3033ffeeb7c68ba3683658406e4d8da464.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84975 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-gimple.c')
-rw-r--r--gcc/tree-gimple.c28
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