* cilk.c (extract_free_variables): Use is_global_var.
* c-decl.c: Use is_global_var throughout.
* c-parser.c: Likewise.
* c-typeck.c: Likewise.
From-SVN: r224947
+2015-06-25 Marek Polacek <polacek@redhat.com>
+
+ * cilk.c (extract_free_variables): Use is_global_var.
+
2015-06-23 Richard Sandiford <richard.sandiford@arm.com>
* c-common.c: Don't include target-def.h.
TREE_ADDRESSABLE (t) = 1;
case VAR_DECL:
case PARM_DECL:
- if (!TREE_STATIC (t) && !DECL_EXTERNAL (t))
+ if (!is_global_var (t))
add_variable (wd, t, how);
return;
+2015-06-25 Marek Polacek <polacek@redhat.com>
+
+ * c-decl.c: Use is_global_var throughout.
+ * c-parser.c: Likewise.
+ * c-typeck.c: Likewise.
+
2015-06-17 Andrew MacLeod <amacleod@redhat.com>
* c-array-notation.c: Do not include input.h, line-map.h or is-a.h.
/* Add implicit "omp declare target" attribute if requested. */
if (current_omp_declare_target_attribute
&& ((TREE_CODE (*node) == VAR_DECL
- && (TREE_STATIC (*node) || DECL_EXTERNAL (*node)))
+ && is_global_var (*node))
|| TREE_CODE (*node) == FUNCTION_DECL))
{
if (TREE_CODE (*node) == VAR_DECL
TREE_TYPE (decl) = error_mark_node;
}
- if ((DECL_EXTERNAL (decl) || TREE_STATIC (decl))
- && DECL_SIZE (decl) != 0)
+ if (is_global_var (decl) && DECL_SIZE (decl) != 0)
{
if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST)
constant_expression_warning (DECL_SIZE (decl));
{
/* Recompute the RTL of a local array now
if it used to be an incomplete type. */
- if (was_incomplete
- && !TREE_STATIC (decl) && !DECL_EXTERNAL (decl))
+ if (was_incomplete && !is_global_var (decl))
{
/* If we used it already as memory, it must stay in memory. */
TREE_ADDRESSABLE (decl) = TREE_USED (decl);
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);
- else if (! TREE_STATIC (v) && ! DECL_EXTERNAL (v))
+ else if (! is_global_var (v))
error_at (loc, "automatic variable %qE cannot be %<threadprivate%>", v);
else if (TREE_TYPE (v) == error_mark_node)
;
if (C_DECL_REGISTER (x)
&& DECL_NONLOCAL (x))
{
- if (TREE_PUBLIC (x) || TREE_STATIC (x) || DECL_EXTERNAL (x))
+ if (TREE_PUBLIC (x) || is_global_var (x))
{
error
("global register variable %qD used in nested function", x);
}
else if (C_DECL_REGISTER (x))
{
- if (TREE_PUBLIC (x) || TREE_STATIC (x) || DECL_EXTERNAL (x))
+ if (TREE_PUBLIC (x) || is_global_var (x))
error ("address of global register variable %qD requested", x);
else
error ("address of register variable %qD requested", x);