* array-notation-common.c: Use VAR_P throughout.
* c-ada-spec.c: Likewise.
* c-common.c: Likewise.
* c-format.c: Likewise.
* c-gimplify.c: Likewise.
* c-omp.c: Likewise.
* c-pragma.c: Likewise.
* c-pretty-print.c: Likewise.
* cilk.c: Likewise.
* c-array-notation.c: Use VAR_P throughout.
* c-decl.c: Likewise.
* c-objc-common.c: Likewise.
* c-parser.c: Likewise.
* c-typeck.c: Likewise.
From-SVN: r224949
+2015-06-25 Marek Polacek <polacek@redhat.com>
+
+ * array-notation-common.c: Use VAR_P throughout.
+ * c-ada-spec.c: Likewise.
+ * c-common.c: Likewise.
+ * c-format.c: Likewise.
+ * c-gimplify.c: Likewise.
+ * c-omp.c: Likewise.
+ * c-pragma.c: Likewise.
+ * c-pretty-print.c: Likewise.
+ * cilk.c: Likewise.
+
2015-06-25 Marek Polacek <polacek@redhat.com>
* cilk.c (extract_free_variables): Use is_global_var.
|| TREE_CODE (ii_tree) == INDIRECT_REF)
ii_tree = TREE_OPERAND (ii_tree, 0);
else if (TREE_CODE (ii_tree) == PARM_DECL
- || TREE_CODE (ii_tree) == VAR_DECL)
+ || VAR_P (ii_tree))
break;
else
gcc_unreachable ();
}
else
{
- if (TREE_CODE (t) == VAR_DECL
+ if (VAR_P (t)
&& decl_name
&& *IDENTIFIER_POINTER (decl_name) == '_')
return 0;
gcc_unreachable ();
if (!optimize
- || TREE_CODE (exp) != VAR_DECL
+ || !VAR_P (exp)
|| TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE
|| DECL_MODE (exp) == BLKmode)
return exp;
tree ARG_UNUSED (args),
int ARG_UNUSED (flags), bool *no_add_attrs)
{
- if (TREE_CODE (*node) == VAR_DECL)
+ if (VAR_P (*node))
DECL_COMMON (*node) = 0;
else
{
handle_common_attribute (tree *node, tree name, tree ARG_UNUSED (args),
int ARG_UNUSED (flags), bool *no_add_attrs)
{
- if (TREE_CODE (*node) == VAR_DECL)
+ if (VAR_P (*node))
DECL_COMMON (*node) = 1;
else
{
tree node = *pnode;
if (TREE_CODE (node) == FUNCTION_DECL
- || (TREE_CODE (node) == VAR_DECL && TREE_STATIC (node))
+ || (VAR_P (node) && TREE_STATIC (node))
|| (TREE_CODE (node) == TYPE_DECL))
{
TREE_USED (node) = 1;
DECL_PRESERVE_P (node) = 1;
- if (TREE_CODE (node) == VAR_DECL)
+ if (VAR_P (node))
DECL_READ_P (node) = 1;
}
else
tree decl = *node;
if (TREE_CODE (decl) == PARM_DECL
- || TREE_CODE (decl) == VAR_DECL
+ || VAR_P (decl)
|| TREE_CODE (decl) == FUNCTION_DECL
|| TREE_CODE (decl) == LABEL_DECL
|| TREE_CODE (decl) == TYPE_DECL)
{
TREE_USED (decl) = 1;
- if (TREE_CODE (decl) == VAR_DECL
- || TREE_CODE (decl) == PARM_DECL)
+ if (VAR_P (decl) || TREE_CODE (decl) == PARM_DECL)
DECL_READ_P (decl) = 1;
}
else
goto fail;
}
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
&& current_function_decl != NULL_TREE
&& !TREE_STATIC (decl))
{
goto fail;
}
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
&& !targetm.have_tls && targetm.emutls.tmpl_section
&& DECL_THREAD_LOCAL_P (decl))
{
tree decl = *node;
if (TREE_CODE (decl) != FUNCTION_DECL
- && (!is_alias || TREE_CODE (decl) != VAR_DECL))
+ && (!is_alias || !VAR_P (decl)))
{
warning (OPT_Wattributes, "%qE attribute ignored", name);
*no_add_attrs = true;
DECL_VISIBILITY_SPECIFIED (decl) = visibility_options.inpragma;
/* If visibility changed and DECL already has DECL_RTL, ensure
symbol flags are updated. */
- if (((TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
+ if (((VAR_P (decl) && TREE_STATIC (decl))
|| TREE_CODE (decl) == FUNCTION_DECL)
&& DECL_RTL_SET_P (decl))
make_decl_rtl (decl);
*no_add_attrs = true;
- if (TREE_CODE (decl) != VAR_DECL || !DECL_THREAD_LOCAL_P (decl))
+ if (!VAR_P (decl) || !DECL_THREAD_LOCAL_P (decl))
{
warning (OPT_Wattributes, "%qE attribute ignored", name);
return NULL_TREE;
for global destructors in C++. This requires infrastructure that
we don't have generically at the moment. It's also not a feature
we'd be missing too much, since we do have attribute constructor. */
- if (TREE_CODE (decl) != VAR_DECL || TREE_STATIC (decl))
+ if (!VAR_P (decl) || TREE_STATIC (decl))
{
warning (OPT_Wattributes, "%qE attribute ignored", name);
*no_add_attrs = true;
case COMPOUND_EXPR:
/* Handle static members of volatile structs. */
t = TREE_OPERAND (expr, 1);
- gcc_assert (TREE_CODE (t) == VAR_DECL);
+ gcc_assert (VAR_P (t));
return fold_offsetof_1 (t);
default:
G_("read-only member %qD used as %<asm%> output")),
TREE_OPERAND (arg, 1));
}
- else if (TREE_CODE (arg) == VAR_DECL)
+ else if (VAR_P (arg))
error_at (loc, READONLY_MSG (G_("assignment of read-only variable %qD"),
G_("increment of read-only variable %qD"),
G_("decrement of read-only variable %qD"),
{
while (handled_component_p (t))
t = TREE_OPERAND (t, 0);
- if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
+ if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
return;
TREE_ADDRESSABLE (t) = 1;
}
tree array_size = 0;
tree array_init;
- if (TREE_CODE (format_tree) == VAR_DECL)
+ if (VAR_P (format_tree))
{
/* Pull out a constant value if the front end didn't. */
format_tree = decl_constant_value (format_tree);
res->number_non_literal++;
return;
}
- if (TREE_CODE (format_tree) == VAR_DECL
+ if (VAR_P (format_tree)
&& TREE_CODE (TREE_TYPE (format_tree)) == ARRAY_TYPE
&& (array_init = decl_constant_value (format_tree)) != format_tree
&& TREE_CODE (array_init) == STRING_CST)
/* This is handled mostly by gimplify.c, but we have to deal with
not warning about int x = x; as it is a GCC extension to turn off
this warning but only if warn_init_self is zero. */
- if (TREE_CODE (DECL_EXPR_DECL (*expr_p)) == VAR_DECL
+ if (VAR_P (DECL_EXPR_DECL (*expr_p))
&& !DECL_EXTERNAL (DECL_EXPR_DECL (*expr_p))
&& !TREE_STATIC (DECL_EXPR_DECL (*expr_p))
&& (DECL_INITIAL (DECL_EXPR_DECL (*expr_p)) == DECL_EXPR_DECL (*expr_p))
addr = save_expr (addr);
if (TREE_CODE (addr) != SAVE_EXPR
&& (TREE_CODE (addr) != ADDR_EXPR
- || TREE_CODE (TREE_OPERAND (addr, 0)) != VAR_DECL))
+ || !VAR_P (TREE_OPERAND (addr, 0))))
{
/* Make sure LHS is simple enough so that goa_lhs_expr_p can recognize
it even after unsharing function body. */
/* Generally it is hard to prove lhs1 and lhs are the same memory
location, just diagnose different variables. */
if (rhs1
- && TREE_CODE (rhs1) == VAR_DECL
- && TREE_CODE (lhs) == VAR_DECL
+ && VAR_P (rhs1)
+ && VAR_P (lhs)
&& rhs1 != lhs)
{
if (code == OMP_ATOMIC)
{
/* Generally it is hard to prove lhs1 and lhs are the same memory
location, just diagnose different variables. */
- if (lhs1 && TREE_CODE (lhs1) == VAR_DECL && TREE_CODE (lhs) == VAR_DECL)
+ if (lhs1 && VAR_P (lhs1) && VAR_P (lhs))
{
if (lhs1 != lhs)
{
DECL_ARTIFICIAL (decl) = 1;
TREE_PUBLIC (decl) = 1;
DECL_WEAK (decl) = 1;
- if (TREE_CODE (decl) == VAR_DECL)
+ if (VAR_P (decl))
TREE_STATIC (decl) = 1;
if (!target)
{
if (value)
{
DECL_EXTERNAL (decl) = 0;
- if (TREE_CODE (decl) == VAR_DECL)
+ if (VAR_P (decl))
TREE_STATIC (decl) = 1;
assemble_alias (decl, value);
}
{
if (DECL_REGISTER (t))
pp_c_ws_string (this, "register");
- else if (TREE_STATIC (t) && TREE_CODE (t) == VAR_DECL)
+ else if (TREE_STATIC (t) && VAR_P (t))
pp_c_ws_string (this, "static");
}
}
argument list. Because register variables are
worker-local we don't need to work hard to support
them in code that spawns. */
- if ((TREE_CODE (arg) == VAR_DECL) && DECL_HARD_REGISTER (arg))
+ if (VAR_P (arg) && DECL_HARD_REGISTER (arg))
{
error_at (EXPR_LOCATION (arg),
"explicit register variable %qD may not be modified in "
work anyway. Warn here. This misses one case: if the
register variable is used as the loop bound or increment it
has already been added to the map. */
- if ((how != ADD_BIND) && (TREE_CODE (var) == VAR_DECL)
+ if ((how != ADD_BIND) && VAR_P (var)
&& !DECL_EXTERNAL (var) && DECL_HARD_REGISTER (var))
warning (0, "register assignment ignored for %qD used in Cilk block",
var);
+2015-06-25 Marek Polacek <polacek@redhat.com>
+
+ * c-array-notation.c: Use VAR_P throughout.
+ * c-decl.c: Likewise.
+ * c-objc-common.c: Likewise.
+ * c-parser.c: Likewise.
+ * c-typeck.c: Likewise.
+
2015-06-25 Marek Polacek <polacek@redhat.com>
* c-decl.c: Use is_global_var throughout.
tree var, new_exp;
if (TREE_CODE (*value) != INTEGER_CST
&& TREE_CODE (*value) != PARM_DECL
- && TREE_CODE (*value) != VAR_DECL)
+ && !VAR_P (*value))
{
var = build_decl (loc, VAR_DECL, NULL_TREE, integer_type_node);
new_exp = build_modify_expr (loc, var, TREE_TYPE (var), NOP_EXPR, loc,
return false;
/* Always warn about crossing variably modified types. */
- if ((TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == TYPE_DECL)
+ if ((VAR_P (decl) || TREE_CODE (decl) == TYPE_DECL)
&& variably_modified_type_p (TREE_TYPE (decl), NULL_TREE))
return true;
/* Otherwise, only warn if -Wgoto-misses-init and this is an
initialized automatic decl. */
if (warn_jump_misses_init
- && TREE_CODE (decl) == VAR_DECL
+ && VAR_P (decl)
&& !TREE_STATIC (decl)
&& DECL_INITIAL (decl) != NULL_TREE)
return true;
void
c_finish_incomplete_decl (tree decl)
{
- if (TREE_CODE (decl) == VAR_DECL)
+ if (VAR_P (decl))
{
tree type = TREE_TYPE (decl);
if (type != error_mark_node
struct c_scope *scope;
bool nested = false;
- if (TREE_CODE (decl) != VAR_DECL || current_function_scope == NULL)
+ if (!VAR_P (decl) || current_function_scope == NULL)
{
/* Types and functions are always considered to be global. */
scope = file_scope;
}
}
}
- else if (TREE_CODE (newdecl) == VAR_DECL)
+ else if (VAR_P (newdecl))
{
/* Only variables can be thread-local, and all declarations must
agree on this property. */
&& !(TREE_CODE (newdecl) == PARM_DECL
&& TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))
/* Don't warn about a variable definition following a declaration. */
- && !(TREE_CODE (newdecl) == VAR_DECL
+ && !(VAR_P (newdecl)
&& DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl)))
{
warned = warning (OPT_Wredundant_decls, "redundant redeclaration of %q+D",
DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
/* Merge the threadprivate attribute. */
- if (TREE_CODE (olddecl) == VAR_DECL && C_DECL_THREADPRIVATE_P (olddecl))
+ if (VAR_P (olddecl) && C_DECL_THREADPRIVATE_P (olddecl))
C_DECL_THREADPRIVATE_P (newdecl) = 1;
if (CODE_CONTAINS_STRUCT (TREE_CODE (olddecl), TS_DECL_WITH_VIS))
TREE_USED (newdecl) = 1;
else if (TREE_USED (newdecl))
TREE_USED (olddecl) = 1;
- if (TREE_CODE (olddecl) == VAR_DECL || TREE_CODE (olddecl) == PARM_DECL)
+ if (VAR_P (olddecl) || TREE_CODE (olddecl) == PARM_DECL)
DECL_READ_P (newdecl) |= DECL_READ_P (olddecl);
if (DECL_PRESERVE_P (olddecl))
DECL_PRESERVE_P (newdecl) = 1;
int __thread x attribute ((tls_model ("local-exec")));
extern int __thread x;
as we'll lose the "local-exec" model. */
- if (TREE_CODE (olddecl) == VAR_DECL
- && DECL_THREAD_LOCAL_P (newdecl))
+ if (VAR_P (olddecl) && DECL_THREAD_LOCAL_P (newdecl))
set_decl_tls_model (olddecl, DECL_TLS_MODEL (newdecl));
break;
}
flags and attributes. */
if (DECL_RTL_SET_P (olddecl)
&& (TREE_CODE (olddecl) == FUNCTION_DECL
- || (TREE_CODE (olddecl) == VAR_DECL
- && TREE_STATIC (olddecl))))
+ || (VAR_P (olddecl) && TREE_STATIC (olddecl))))
make_decl_rtl (olddecl);
}
type_saved = true;
}
if (B_IN_FILE_SCOPE (b)
- && TREE_CODE (b->decl) == VAR_DECL
+ && VAR_P (b->decl)
&& TREE_STATIC (b->decl)
&& TREE_CODE (TREE_TYPE (b->decl)) == ARRAY_TYPE
&& !TYPE_DOMAIN (TREE_TYPE (b->decl))
{
tree name;
bool nested = false;
- gcc_assert (TREE_CODE (x) == VAR_DECL || TREE_CODE (x) == CONST_DECL);
+ gcc_assert (VAR_P (x) || TREE_CODE (x) == CONST_DECL);
name = DECL_NAME (x);
{
/* Add implicit "omp declare target" attribute if requested. */
if (current_omp_declare_target_attribute
- && ((TREE_CODE (*node) == VAR_DECL
- && is_global_var (*node))
+ && ((VAR_P (*node) && is_global_var (*node))
|| TREE_CODE (*node) == FUNCTION_DECL))
{
- if (TREE_CODE (*node) == VAR_DECL
+ if (VAR_P (*node)
&& ((DECL_CONTEXT (*node)
&& TREE_CODE (DECL_CONTEXT (*node)) == FUNCTION_DECL)
|| (current_function_decl && !DECL_EXTERNAL (*node))))
error ("%q+D in block scope inside of declare target directive",
*node);
- else if (TREE_CODE (*node) == VAR_DECL
+ else if (VAR_P (*node)
&& !lang_hooks.types.omp_mappable_type (TREE_TYPE (*node)))
error ("%q+D in declare target directive does not have mappable type",
*node);
body of code to break, and it allows more efficient variable references
in the presence of dynamic linking. */
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
&& !initialized
&& TREE_PUBLIC (decl)
&& !DECL_THREAD_LOCAL_P (decl)
/* C99 6.7.4p3: An inline definition of a function with external
linkage shall not contain a definition of a modifiable object
with static storage duration... */
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
&& current_scope != file_scope
&& TREE_STATIC (decl)
&& !TREE_READONLY (decl)
if (asmspec_tree)
asmspec = TREE_STRING_POINTER (asmspec_tree);
- if (TREE_CODE (decl) == VAR_DECL
+ if (VAR_P (decl)
&& TREE_STATIC (decl)
&& global_bindings_p ())
/* So decl is a global variable. Record the types it uses
relayout_decl (decl);
}
- if (TREE_CODE (decl) == VAR_DECL)
+ if (VAR_P (decl))
{
if (init && TREE_CODE (init) == CONSTRUCTOR)
add_flexible_array_elts_to_size (decl, init);
GCC has accepted -- but ignored -- the ASMSPEC in
this case. */
if (!DECL_FILE_SCOPE_P (decl)
- && TREE_CODE (decl) == VAR_DECL
+ && VAR_P (decl)
&& !C_DECL_REGISTER (decl)
&& !TREE_STATIC (decl))
warning (0, "ignoring asm-specifier for non-static local "
}
/* Install a cleanup (aka destructor) if one was given. */
- if (TREE_CODE (decl) == VAR_DECL && !TREE_STATIC (decl))
+ if (VAR_P (decl) && !TREE_STATIC (decl))
{
tree attr = lookup_attribute ("cleanup", DECL_ATTRIBUTES (decl));
if (attr)
}
if (warn_cxx_compat
- && TREE_CODE (decl) == VAR_DECL
+ && VAR_P (decl)
&& !DECL_EXTERNAL (decl)
&& DECL_INITIAL (decl) == NULL_TREE)
{
if (global_decl
&& global_decl != visible_decl
- && TREE_CODE (global_decl) == VAR_DECL
+ && VAR_P (global_decl)
&& !TREE_PUBLIC (global_decl))
error_at (loc, "variable previously declared %<static%> "
"redeclared %<extern%>");
will be ignored, and would even crash the compiler.
Of course, this only makes sense on VAR,PARM, and RESULT decl's. */
if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (decl))
- && (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL
+ && (VAR_P (decl) || TREE_CODE (decl) == PARM_DECL
|| TREE_CODE (decl) == RESULT_DECL))
{
/* It is not an error for a structure with volatile fields to
gcc_assert (!DECL_ASSEMBLER_NAME_SET_P (decl));
if (warn_cxx_compat
- && TREE_CODE (decl) == VAR_DECL
+ && VAR_P (decl)
&& TREE_PUBLIC (decl)
&& TREE_STATIC (decl)
&& (TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
switch (*spec)
{
case 'D':
- if (TREE_CODE (t) == VAR_DECL && DECL_HAS_DEBUG_EXPR_P (t))
+ if (VAR_P (t) && DECL_HAS_DEBUG_EXPR_P (t))
{
t = DECL_DEBUG_EXPR (t);
if (!DECL_P (t))
c_parser_omp_var_list_parens() should construct a list of
locations to go along with the var list. */
- if (TREE_CODE (v) != VAR_DECL)
+ if (!VAR_P (v))
error_at (loc, "%qD is not a variable", v);
else if (TREE_TYPE (v) == error_mark_node)
;
/* If V had already been marked threadprivate, it doesn't matter
whether it had been used prior to this point. */
- if (TREE_CODE (v) != VAR_DECL)
+ if (!VAR_P (v))
error_at (loc, "%qD is not a variable", v);
else if (TREE_USED (v) && !C_DECL_THREADPRIVATE_P (v))
error_at (loc, "%qE declared %<threadprivate%> after first use", v);
if (TREE_CODE (type) == ERROR_MARK)
return;
- if (value != 0 && (TREE_CODE (value) == VAR_DECL
- || TREE_CODE (value) == PARM_DECL))
+ if (value != 0 && (VAR_P (value) || TREE_CODE (value) == PARM_DECL))
error ("%qD has an incomplete type %qT", value, type);
else
{
tree foo = array;
while (TREE_CODE (foo) == COMPONENT_REF)
foo = TREE_OPERAND (foo, 0);
- if (TREE_CODE (foo) == VAR_DECL && C_DECL_REGISTER (foo))
+ if (VAR_P (foo) && C_DECL_REGISTER (foo))
pedwarn (loc, OPT_Wpedantic,
"ISO C forbids subscripting %<register%> array");
else if (!lvalue_p (foo))
&& DECL_DECLARED_INLINE_P (current_function_decl)
&& DECL_EXTERNAL (current_function_decl)
&& VAR_OR_FUNCTION_DECL_P (ref)
- && (TREE_CODE (ref) != VAR_DECL || TREE_STATIC (ref))
+ && (!VAR_P (ref) || TREE_STATIC (ref))
&& ! TREE_PUBLIC (ref)
&& DECL_CONTEXT (ref) != current_function_decl)
record_inline_static (loc, current_function_decl, ref,
{
if (error_operand_p (t))
return error_mark_node;
- if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
+ if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
if (DECL_P (t))
error_at (OMP_CLAUSE_LOCATION (c),
return error_mark_node;
}
else if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_DEPEND
- && TREE_CODE (t) == VAR_DECL && DECL_THREAD_LOCAL_P (t))
+ && VAR_P (t) && DECL_THREAD_LOCAL_P (t))
{
error_at (OMP_CLAUSE_LOCATION (c),
"%qD is threadprivate variable in %qs clause", t,
case OMP_CLAUSE_COPYIN:
t = OMP_CLAUSE_DECL (c);
- if (TREE_CODE (t) != VAR_DECL || !DECL_THREAD_LOCAL_P (t))
+ if (!VAR_P (t) || !DECL_THREAD_LOCAL_P (t))
{
error_at (OMP_CLAUSE_LOCATION (c),
"%qE must be %<threadprivate%> for %<copyin%>", t);
check_dup_generic:
t = OMP_CLAUSE_DECL (c);
- if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
+ if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
error_at (OMP_CLAUSE_LOCATION (c),
"%qE is not a variable in clause %qs", t,
t = OMP_CLAUSE_DECL (c);
need_complete = true;
need_implicitly_determined = true;
- if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
+ if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
error_at (OMP_CLAUSE_LOCATION (c),
"%qE is not a variable in clause %<firstprivate%>", t);
t = OMP_CLAUSE_DECL (c);
need_complete = true;
need_implicitly_determined = true;
- if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
+ if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
error_at (OMP_CLAUSE_LOCATION (c),
"%qE is not a variable in clause %<lastprivate%>", t);
case OMP_CLAUSE_ALIGNED:
t = OMP_CLAUSE_DECL (c);
- if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
+ if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
error_at (OMP_CLAUSE_LOCATION (c),
"%qE is not a variable in %<aligned%> clause", t);
}
if (t == error_mark_node)
remove = true;
- else if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
+ else if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
error_at (OMP_CLAUSE_LOCATION (c),
"%qE is not a variable in %<depend%> clause", t);
}
if (t == error_mark_node)
remove = true;
- else if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
+ else if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
error_at (OMP_CLAUSE_LOCATION (c),
"%qE is not a variable in %qs clause", t,
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
remove = true;
}
- else if (TREE_CODE (t) == VAR_DECL && DECL_THREAD_LOCAL_P (t))
+ else if (VAR_P (t) && DECL_THREAD_LOCAL_P (t))
{
error_at (OMP_CLAUSE_LOCATION (c),
"%qD is threadprivate variable in %qs clause", t,
{
const char *share_name = NULL;
- if (TREE_CODE (t) == VAR_DECL && DECL_THREAD_LOCAL_P (t))
+ if (VAR_P (t) && DECL_THREAD_LOCAL_P (t))
share_name = "threadprivate";
else switch (c_omp_predetermined_sharing (t))
{
it means that it's going to be unified with whatever the
TARGET_EXPR is really supposed to initialize, so treat it
as being equivalent to anything. */
- if (TREE_CODE (o1) == VAR_DECL && DECL_NAME (o1) == NULL_TREE
+ if (VAR_P (o1) && DECL_NAME (o1) == NULL_TREE
&& !DECL_RTL_SET_P (o1))
/*Nop*/;
- else if (TREE_CODE (o2) == VAR_DECL && DECL_NAME (o2) == NULL_TREE
+ else if (VAR_P (o2) && DECL_NAME (o2) == NULL_TREE
&& !DECL_RTL_SET_P (o2))
/*Nop*/;
else if (!c_tree_equal (o1, o2))