aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 2266333..0b1a0be 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -665,7 +665,7 @@ force_constant_size (tree var)
HOST_WIDE_INT max_size;
- gcc_assert (TREE_CODE (var) == VAR_DECL);
+ gcc_assert (VAR_P (var));
max_size = max_int_size_in_bytes (TREE_TYPE (var));
@@ -1108,7 +1108,7 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p)
/* Mark variables seen in this bind expr. */
for (t = BIND_EXPR_VARS (bind_expr); t ; t = DECL_CHAIN (t))
{
- if (TREE_CODE (t) == VAR_DECL)
+ if (VAR_P (t))
{
struct gimplify_omp_ctx *ctx = gimplify_omp_ctxp;
@@ -1138,7 +1138,7 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p)
if ((TREE_CODE (TREE_TYPE (t)) == COMPLEX_TYPE
|| TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
&& !TREE_THIS_VOLATILE (t)
- && (TREE_CODE (t) == VAR_DECL && !DECL_HARD_REGISTER (t))
+ && (VAR_P (t) && !DECL_HARD_REGISTER (t))
&& !needs_to_live_in_memory (t))
DECL_GIMPLE_REG_P (t) = 1;
}
@@ -1190,7 +1190,7 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p)
/* Add clobbers for all variables that go out of scope. */
for (t = BIND_EXPR_VARS (bind_expr); t ; t = DECL_CHAIN (t))
{
- if (TREE_CODE (t) == VAR_DECL
+ if (VAR_P (t)
&& !is_global_var (t)
&& DECL_CONTEXT (t) == current_function_decl
&& !DECL_HARD_REGISTER (t)
@@ -1450,7 +1450,7 @@ gimplify_decl_expr (tree *stmt_p, gimple_seq *seq_p)
return GS_ERROR;
if ((TREE_CODE (decl) == TYPE_DECL
- || TREE_CODE (decl) == VAR_DECL)
+ || VAR_P (decl))
&& !TYPE_SIZES_GIMPLIFIED (TREE_TYPE (decl)))
{
gimplify_type_sizes (TREE_TYPE (decl), seq_p);
@@ -1469,7 +1469,7 @@ gimplify_decl_expr (tree *stmt_p, gimple_seq *seq_p)
gimplify_type_sizes (TREE_TYPE (DECL_ORIGINAL_TYPE (decl)), seq_p);
}
- if (TREE_CODE (decl) == VAR_DECL && !DECL_EXTERNAL (decl))
+ if (VAR_P (decl) && !DECL_EXTERNAL (decl))
{
tree init = DECL_INITIAL (decl);
@@ -2378,7 +2378,7 @@ gimplify_var_or_parm_decl (tree *expr_p)
be really nice if the front end wouldn't leak these at all.
Currently the only known culprit is C++ destructors, as seen
in g++.old-deja/g++.jason/binding.C. */
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
&& !DECL_SEEN_IN_BIND_EXPR_P (decl)
&& !TREE_STATIC (decl) && !DECL_EXTERNAL (decl)
&& decl_function_context (decl) == current_function_decl)
@@ -2398,7 +2398,7 @@ gimplify_var_or_parm_decl (tree *expr_p)
/* For referenced nonlocal VLAs add a decl for debugging purposes
to the current function. */
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
&& TREE_CODE (DECL_SIZE_UNIT (decl)) != INTEGER_CST
&& nonlocal_vlas != NULL
&& TREE_CODE (value_expr) == INDIRECT_REF
@@ -2533,7 +2533,7 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
;
/* Expand DECL_VALUE_EXPR now. In some cases that may expose
additional COMPONENT_REFs. */
- else if ((TREE_CODE (*p) == VAR_DECL || TREE_CODE (*p) == PARM_DECL)
+ else if ((VAR_P (*p) || TREE_CODE (*p) == PARM_DECL)
&& gimplify_var_or_parm_decl (p) == GS_OK)
goto restart;
else
@@ -4447,7 +4447,7 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
if (valid_const_initializer
&& num_nonzero_elements > 1
&& TREE_READONLY (object)
- && TREE_CODE (object) == VAR_DECL
+ && VAR_P (object)
&& (flag_merge_constants >= 2 || !TREE_ADDRESSABLE (object)))
{
if (notify_temp_creation)
@@ -5200,8 +5200,7 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
if (ret == GS_ERROR)
return ret;
gcc_assert (!want_value
- && (TREE_CODE (*to_p) == VAR_DECL
- || TREE_CODE (*to_p) == MEM_REF));
+ && (VAR_P (*to_p) || TREE_CODE (*to_p) == MEM_REF));
gimplify_seq_add_stmt (pre_p, gimple_build_assign (*to_p, *from_p));
*expr_p = NULL;
return GS_ALL_DONE;
@@ -5349,7 +5348,7 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
temporaries (see for example is_gimple_reg_rhs) on the debug info, but
make sure not to create DECL_DEBUG_EXPR links across functions. */
if (!gimplify_ctxp->into_ssa
- && TREE_CODE (*from_p) == VAR_DECL
+ && VAR_P (*from_p)
&& DECL_IGNORED_P (*from_p)
&& DECL_P (*to_p)
&& !DECL_IGNORED_P (*to_p)
@@ -5935,7 +5934,7 @@ gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
if (TREE_CODE (x) == MEM_REF
&& TREE_CODE (TREE_OPERAND (x, 0)) == ADDR_EXPR)
x = TREE_OPERAND (TREE_OPERAND (x, 0), 0);
- if ((TREE_CODE (x) == VAR_DECL
+ if ((VAR_P (x)
|| TREE_CODE (x) == PARM_DECL
|| TREE_CODE (x) == RESULT_DECL)
&& !TREE_ADDRESSABLE (x)
@@ -9055,7 +9054,7 @@ gimplify_oacc_declare (tree *expr_p, gimple_seq *pre_p)
if (TREE_CODE (decl) == MEM_REF)
continue;
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
&& !is_global_var (decl)
&& DECL_CONTEXT (decl) == current_function_decl)
{
@@ -12045,10 +12044,10 @@ gimplify_type_sizes (tree type, gimple_seq *list_p)
&& INTEGRAL_TYPE_P (TYPE_DOMAIN (type)))
{
t = TYPE_MIN_VALUE (TYPE_DOMAIN (type));
- if (t && TREE_CODE (t) == VAR_DECL && DECL_ARTIFICIAL (t))
+ if (t && VAR_P (t) && DECL_ARTIFICIAL (t))
DECL_IGNORED_P (t) = 0;
t = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
- if (t && TREE_CODE (t) == VAR_DECL && DECL_ARTIFICIAL (t))
+ if (t && VAR_P (t) && DECL_ARTIFICIAL (t))
DECL_IGNORED_P (t) = 0;
}
break;