Commit 1394aabd by Richard Stallman

Renamed TREE_INLINE...

Renamed TREE_INLINE, TREE_NONLOCAL, TREE_REGDECL, TREE_EXTERNAL
to DECL_INLINE, DECL_NONLOCAL, DECL_REGISTER, DECL_EXTERNAL.

From-SVN: r1569
parent a82ad570
...@@ -126,12 +126,12 @@ affix_data_type (type_or_decl) ...@@ -126,12 +126,12 @@ affix_data_type (type_or_decl)
for (;;) for (;;)
{ {
if (!strncmp (p, "volatile", 8)) if (!strncmp (p, "volatile ", 9))
{ {
p += 9; p += 9;
continue; continue;
} }
if (!strncmp (p, "const", 5)) if (!strncmp (p, "const ", 6))
{ {
p += 6; p += 6;
continue; continue;
...@@ -568,7 +568,7 @@ gen_decl (decl, is_func_definition, style) ...@@ -568,7 +568,7 @@ gen_decl (decl, is_func_definition, style)
ret_val = affix_data_type (ret_val); ret_val = affix_data_type (ret_val);
if (TREE_REGDECL (decl)) if (DECL_REGISTER (decl))
ret_val = concat ("register ", ret_val); ret_val = concat ("register ", ret_val);
if (TREE_PUBLIC (decl)) if (TREE_PUBLIC (decl))
ret_val = concat ("extern ", ret_val); ret_val = concat ("extern ", ret_val);
......
...@@ -196,7 +196,7 @@ decl_attributes (decl, attributes) ...@@ -196,7 +196,7 @@ decl_attributes (decl, attributes)
if (TREE_CODE (decl) == FIELD_DECL) if (TREE_CODE (decl) == FIELD_DECL)
DECL_PACKED (decl) = 1; DECL_PACKED (decl) = 1;
/* We can't set DECL_PACKED for a VAR_DECL, because the bit is /* We can't set DECL_PACKED for a VAR_DECL, because the bit is
used for TREE_REGDECL. It wouldn't mean anything anyway. */ used for DECL_REGISTER. It wouldn't mean anything anyway. */
} }
else if (TREE_VALUE (a) != 0 else if (TREE_VALUE (a) != 0
&& TREE_CODE (TREE_VALUE (a)) == TREE_LIST && TREE_CODE (TREE_VALUE (a)) == TREE_LIST
......
...@@ -877,7 +877,7 @@ poplevel (keep, reverse, functionbody) ...@@ -877,7 +877,7 @@ poplevel (keep, reverse, functionbody)
{ {
/* If the ident. was used or addressed via a local extern decl, /* If the ident. was used or addressed via a local extern decl,
don't forget that fact. */ don't forget that fact. */
if (TREE_EXTERNAL (link)) if (DECL_EXTERNAL (link))
{ {
if (TREE_USED (link)) if (TREE_USED (link))
TREE_USED (DECL_NAME (link)) = 1; TREE_USED (DECL_NAME (link)) = 1;
...@@ -1386,12 +1386,12 @@ duplicate_decls (newdecl, olddecl) ...@@ -1386,12 +1386,12 @@ duplicate_decls (newdecl, olddecl)
/* Warn if function is now inline /* Warn if function is now inline
but was previously declared not inline and has been called. */ but was previously declared not inline and has been called. */
if (TREE_CODE (olddecl) == FUNCTION_DECL if (TREE_CODE (olddecl) == FUNCTION_DECL
&& ! TREE_INLINE (olddecl) && TREE_INLINE (newdecl) && ! DECL_INLINE (olddecl) && DECL_INLINE (newdecl)
&& TREE_USED (olddecl)) && TREE_USED (olddecl))
warning_with_decl (newdecl, warning_with_decl (newdecl,
"`%s' declared inline after being called"); "`%s' declared inline after being called");
if (TREE_CODE (olddecl) == FUNCTION_DECL if (TREE_CODE (olddecl) == FUNCTION_DECL
&& ! TREE_INLINE (olddecl) && TREE_INLINE (newdecl) && ! DECL_INLINE (olddecl) && DECL_INLINE (newdecl)
&& DECL_INITIAL (olddecl) != 0) && DECL_INITIAL (olddecl) != 0)
warning_with_decl (newdecl, warning_with_decl (newdecl,
"`%s' declared inline after its definition"); "`%s' declared inline after its definition");
...@@ -1500,23 +1500,23 @@ duplicate_decls (newdecl, olddecl) ...@@ -1500,23 +1500,23 @@ duplicate_decls (newdecl, olddecl)
if (! TREE_PUBLIC (olddecl)) if (! TREE_PUBLIC (olddecl))
TREE_PUBLIC (DECL_NAME (olddecl)) = 0; TREE_PUBLIC (DECL_NAME (olddecl)) = 0;
} }
if (TREE_EXTERNAL (newdecl)) if (DECL_EXTERNAL (newdecl))
{ {
TREE_STATIC (newdecl) = TREE_STATIC (olddecl); TREE_STATIC (newdecl) = TREE_STATIC (olddecl);
TREE_EXTERNAL (newdecl) = TREE_EXTERNAL (olddecl); DECL_EXTERNAL (newdecl) = DECL_EXTERNAL (olddecl);
/* An extern decl does not override previous storage class. */ /* An extern decl does not override previous storage class. */
TREE_PUBLIC (newdecl) = TREE_PUBLIC (olddecl); TREE_PUBLIC (newdecl) = TREE_PUBLIC (olddecl);
} }
else else
{ {
TREE_STATIC (olddecl) = TREE_STATIC (newdecl); TREE_STATIC (olddecl) = TREE_STATIC (newdecl);
TREE_EXTERNAL (olddecl) = 0; DECL_EXTERNAL (olddecl) = 0;
TREE_PUBLIC (olddecl) = TREE_PUBLIC (newdecl); TREE_PUBLIC (olddecl) = TREE_PUBLIC (newdecl);
} }
/* If either decl says `inline', this fn is inline, /* If either decl says `inline', this fn is inline,
unless its definition was passed already. */ unless its definition was passed already. */
if (TREE_INLINE (newdecl) && DECL_INITIAL (olddecl) == 0) if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == 0)
TREE_INLINE (olddecl) = 1; DECL_INLINE (olddecl) = 1;
/* Get rid of any built-in function if new arg types don't match it /* Get rid of any built-in function if new arg types don't match it
or if we have a function definition. */ or if we have a function definition. */
...@@ -1575,7 +1575,7 @@ pushdecl (x) ...@@ -1575,7 +1575,7 @@ pushdecl (x)
if (TREE_CODE (x) == FUNCTION_DECL && DECL_INITIAL (x) == 0) if (TREE_CODE (x) == FUNCTION_DECL && DECL_INITIAL (x) == 0)
DECL_CONTEXT (x) = 0; DECL_CONTEXT (x) = 0;
if (warn_nested_externs && TREE_EXTERNAL (x) && b != global_binding_level if (warn_nested_externs && DECL_EXTERNAL (x) && b != global_binding_level
&& x != IDENTIFIER_IMPLICIT_DECL (name)) && x != IDENTIFIER_IMPLICIT_DECL (name))
warning ("nested extern declaration of `%s'", IDENTIFIER_POINTER (name)); warning ("nested extern declaration of `%s'", IDENTIFIER_POINTER (name));
...@@ -1611,7 +1611,7 @@ pushdecl (x) ...@@ -1611,7 +1611,7 @@ pushdecl (x)
warn. But don't complain if -traditional, warn. But don't complain if -traditional,
since traditional compilers don't complain. */ since traditional compilers don't complain. */
if (!flag_traditional && TREE_PUBLIC (name) if (!flag_traditional && TREE_PUBLIC (name)
&& ! TREE_PUBLIC (x) && ! TREE_EXTERNAL (x) && ! TREE_PUBLIC (x) && ! DECL_EXTERNAL (x)
/* We used to warn also for explicit extern followed by static, /* We used to warn also for explicit extern followed by static,
but sometimes you need to do it that way. */ but sometimes you need to do it that way. */
&& IDENTIFIER_IMPLICIT_DECL (name) != 0) && IDENTIFIER_IMPLICIT_DECL (name) != 0)
...@@ -1695,12 +1695,12 @@ pushdecl (x) ...@@ -1695,12 +1695,12 @@ pushdecl (x)
/* Multiple external decls of the same identifier ought to match. */ /* Multiple external decls of the same identifier ought to match. */
if (TREE_EXTERNAL (x) && IDENTIFIER_GLOBAL_VALUE (name) != 0 if (DECL_EXTERNAL (x) && IDENTIFIER_GLOBAL_VALUE (name) != 0
&& (TREE_EXTERNAL (IDENTIFIER_GLOBAL_VALUE (name)) && (DECL_EXTERNAL (IDENTIFIER_GLOBAL_VALUE (name))
|| TREE_PUBLIC (IDENTIFIER_GLOBAL_VALUE (name))) || TREE_PUBLIC (IDENTIFIER_GLOBAL_VALUE (name)))
/* We get warnings about inline functions where they are defined. /* We get warnings about inline functions where they are defined.
Avoid duplicate warnings where they are used. */ Avoid duplicate warnings where they are used. */
&& !TREE_INLINE (x)) && !DECL_INLINE (x))
{ {
if (! comptypes (TREE_TYPE (x), if (! comptypes (TREE_TYPE (x),
TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (name)))) TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (name))))
...@@ -1728,7 +1728,7 @@ pushdecl (x) ...@@ -1728,7 +1728,7 @@ pushdecl (x)
/* In PCC-compatibility mode, extern decls of vars with no current decl /* In PCC-compatibility mode, extern decls of vars with no current decl
take effect at top level no matter where they are. */ take effect at top level no matter where they are. */
if (flag_traditional && TREE_EXTERNAL (x) if (flag_traditional && DECL_EXTERNAL (x)
&& lookup_name (name) == 0) && lookup_name (name) == 0)
{ {
tree type = TREE_TYPE (x); tree type = TREE_TYPE (x);
...@@ -1793,11 +1793,11 @@ pushdecl (x) ...@@ -1793,11 +1793,11 @@ pushdecl (x)
/* If this decl is `static' and an `extern' was seen previously, /* If this decl is `static' and an `extern' was seen previously,
that is erroneous. */ that is erroneous. */
if (TREE_PUBLIC (name) if (TREE_PUBLIC (name)
&& ! TREE_PUBLIC (x) && ! TREE_EXTERNAL (x)) && ! TREE_PUBLIC (x) && ! DECL_EXTERNAL (x))
{ {
/* Okay to declare an ANSI built-in as inline static. */ /* Okay to declare an ANSI built-in as inline static. */
if (t != 0 && DECL_BUILT_IN (t) if (t != 0 && DECL_BUILT_IN (t)
&& TREE_INLINE (x)) && DECL_INLINE (x))
; ;
/* Okay to declare a non-ANSI built-in as anything. */ /* Okay to declare a non-ANSI built-in as anything. */
else if (t != 0 && DECL_BUILT_IN_NONANSI (t)) else if (t != 0 && DECL_BUILT_IN_NONANSI (t))
...@@ -1820,7 +1820,7 @@ pushdecl (x) ...@@ -1820,7 +1820,7 @@ pushdecl (x)
/* If this is an extern function declaration, see if we /* If this is an extern function declaration, see if we
have a global definition for the function. */ have a global definition for the function. */
if (oldlocal == 0 if (oldlocal == 0
&& TREE_EXTERNAL (x) && !TREE_INLINE (x) && DECL_EXTERNAL (x) && !DECL_INLINE (x)
&& oldglobal != 0 && oldglobal != 0
&& TREE_CODE (x) == FUNCTION_DECL && TREE_CODE (x) == FUNCTION_DECL
&& TREE_CODE (oldglobal) == FUNCTION_DECL) && TREE_CODE (oldglobal) == FUNCTION_DECL)
...@@ -1830,7 +1830,7 @@ pushdecl (x) ...@@ -1830,7 +1830,7 @@ pushdecl (x)
TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (name)))) TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (name))))
pedwarn_with_decl (x, "local declaration of `%s' doesn't match global one"); pedwarn_with_decl (x, "local declaration of `%s' doesn't match global one");
/* If the global one is inline, make the local one inline. */ /* If the global one is inline, make the local one inline. */
else if (TREE_INLINE (oldglobal) else if (DECL_INLINE (oldglobal)
|| DECL_BUILT_IN (oldglobal) || DECL_BUILT_IN (oldglobal)
|| (TYPE_ARG_TYPES (TREE_TYPE (oldglobal)) != 0 || (TYPE_ARG_TYPES (TREE_TYPE (oldglobal)) != 0
&& TYPE_ARG_TYPES (TREE_TYPE (x)) == 0)) && TYPE_ARG_TYPES (TREE_TYPE (x)) == 0))
...@@ -1843,7 +1843,7 @@ pushdecl (x) ...@@ -1843,7 +1843,7 @@ pushdecl (x)
have been static. */ have been static. */
if (oldlocal == 0 && oldglobal != 0 if (oldlocal == 0 && oldglobal != 0
&& !TREE_PUBLIC (oldglobal) && !TREE_PUBLIC (oldglobal)
&& TREE_EXTERNAL (x) && TREE_PUBLIC (x)) && DECL_EXTERNAL (x) && TREE_PUBLIC (x))
warning ("`%s' locally external but globally static", warning ("`%s' locally external but globally static",
IDENTIFIER_POINTER (name)); IDENTIFIER_POINTER (name));
#endif #endif
...@@ -1853,14 +1853,14 @@ pushdecl (x) ...@@ -1853,14 +1853,14 @@ pushdecl (x)
then if we later have a file-scope decl it must not be static. */ then if we later have a file-scope decl it must not be static. */
if (oldlocal == 0 if (oldlocal == 0
&& oldglobal == 0 && oldglobal == 0
&& TREE_EXTERNAL (x) && DECL_EXTERNAL (x)
&& TREE_PUBLIC (x)) && TREE_PUBLIC (x))
{ {
TREE_PUBLIC (name) = 1; TREE_PUBLIC (name) = 1;
} }
/* Warn if shadowing an argument at the top level of the body. */ /* Warn if shadowing an argument at the top level of the body. */
if (oldlocal != 0 && !TREE_EXTERNAL (x) if (oldlocal != 0 && !DECL_EXTERNAL (x)
/* This warning doesn't apply to the parms of a nested fcn. */ /* This warning doesn't apply to the parms of a nested fcn. */
&& ! current_binding_level->parm_flag && ! current_binding_level->parm_flag
/* Check that this is one level down from the parms. */ /* Check that this is one level down from the parms. */
...@@ -1878,7 +1878,7 @@ pushdecl (x) ...@@ -1878,7 +1878,7 @@ pushdecl (x)
} }
/* Maybe warn if shadowing something else. */ /* Maybe warn if shadowing something else. */
else if (warn_shadow && !TREE_EXTERNAL (x) else if (warn_shadow && !DECL_EXTERNAL (x)
/* No shadow warnings for internally generated vars. */ /* No shadow warnings for internally generated vars. */
&& !DECL_IGNORED_P (x) && !DECL_IGNORED_P (x)
/* No shadow warnings for vars made for inlining. */ /* No shadow warnings for vars made for inlining. */
...@@ -1968,7 +1968,7 @@ implicitly_declare (functionid) ...@@ -1968,7 +1968,7 @@ implicitly_declare (functionid)
/* Warn once of an implicit declaration. */ /* Warn once of an implicit declaration. */
implicit_warning = (IDENTIFIER_IMPLICIT_DECL (functionid) == 0); implicit_warning = (IDENTIFIER_IMPLICIT_DECL (functionid) == 0);
TREE_EXTERNAL (decl) = 1; DECL_EXTERNAL (decl) = 1;
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
/* Record that we have an implicit decl and this is it. */ /* Record that we have an implicit decl and this is it. */
...@@ -2026,8 +2026,8 @@ redeclaration_error_message (newdecl, olddecl) ...@@ -2026,8 +2026,8 @@ redeclaration_error_message (newdecl, olddecl)
if (DECL_INITIAL (olddecl) != 0 && DECL_INITIAL (newdecl) != 0 if (DECL_INITIAL (olddecl) != 0 && DECL_INITIAL (newdecl) != 0
/* However, defining once as extern inline and a second /* However, defining once as extern inline and a second
time in another way is ok. */ time in another way is ok. */
&& !(TREE_INLINE (olddecl) && TREE_EXTERNAL (olddecl) && !(DECL_INLINE (olddecl) && DECL_EXTERNAL (olddecl)
&& !(TREE_INLINE (newdecl) && TREE_EXTERNAL (newdecl)))) && !(DECL_INLINE (newdecl) && DECL_EXTERNAL (newdecl))))
return "redefinition of `%s'"; return "redefinition of `%s'";
return 0; return 0;
} }
...@@ -2035,7 +2035,7 @@ redeclaration_error_message (newdecl, olddecl) ...@@ -2035,7 +2035,7 @@ redeclaration_error_message (newdecl, olddecl)
{ {
/* Objects declared at top level: */ /* Objects declared at top level: */
/* If at least one is a reference, it's ok. */ /* If at least one is a reference, it's ok. */
if (TREE_EXTERNAL (newdecl) || TREE_EXTERNAL (olddecl)) if (DECL_EXTERNAL (newdecl) || DECL_EXTERNAL (olddecl))
return 0; return 0;
/* Reject two definitions. */ /* Reject two definitions. */
if (DECL_INITIAL (olddecl) != 0 && DECL_INITIAL (newdecl) != 0) if (DECL_INITIAL (olddecl) != 0 && DECL_INITIAL (newdecl) != 0)
...@@ -2054,7 +2054,7 @@ redeclaration_error_message (newdecl, olddecl) ...@@ -2054,7 +2054,7 @@ redeclaration_error_message (newdecl, olddecl)
/* Objects declared with block scope: */ /* Objects declared with block scope: */
/* Reject two definitions, and reject a definition /* Reject two definitions, and reject a definition
together with an external reference. */ together with an external reference. */
if (!(TREE_EXTERNAL (newdecl) && TREE_EXTERNAL (olddecl))) if (!(DECL_EXTERNAL (newdecl) && DECL_EXTERNAL (olddecl)))
return "redeclaration of `%s'"; return "redeclaration of `%s'";
return 0; return 0;
} }
...@@ -2754,7 +2754,7 @@ builtin_function (name, type, function_code, library_name) ...@@ -2754,7 +2754,7 @@ builtin_function (name, type, function_code, library_name)
char *library_name; char *library_name;
{ {
tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type); tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
TREE_EXTERNAL (decl) = 1; DECL_EXTERNAL (decl) = 1;
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
/* If -traditional, permit redefining a builtin function any way you like. /* If -traditional, permit redefining a builtin function any way you like.
(Though really, if the program redefines these functions, (Though really, if the program redefines these functions,
...@@ -2967,12 +2967,12 @@ start_decl (declarator, declspecs, initialized) ...@@ -2967,12 +2967,12 @@ start_decl (declarator, declspecs, initialized)
{ {
#if 0 /* Seems redundant with grokdeclarator. */ #if 0 /* Seems redundant with grokdeclarator. */
if (current_binding_level != global_binding_level if (current_binding_level != global_binding_level
&& TREE_EXTERNAL (decl) && DECL_EXTERNAL (decl)
&& TREE_CODE (decl) != FUNCTION_DECL) && TREE_CODE (decl) != FUNCTION_DECL)
warning ("declaration of `%s' has `extern' and is initialized", warning ("declaration of `%s' has `extern' and is initialized",
IDENTIFIER_POINTER (DECL_NAME (decl))); IDENTIFIER_POINTER (DECL_NAME (decl)));
#endif #endif
TREE_EXTERNAL (decl) = 0; DECL_EXTERNAL (decl) = 0;
if (current_binding_level == global_binding_level) if (current_binding_level == global_binding_level)
TREE_STATIC (decl) = 1; TREE_STATIC (decl) = 1;
...@@ -3074,7 +3074,7 @@ finish_decl (decl, init, asmspec_tree) ...@@ -3074,7 +3074,7 @@ finish_decl (decl, init, asmspec_tree)
/* Even if pedantic, an external linkage array /* Even if pedantic, an external linkage array
may have incomplete type at first. */ may have incomplete type at first. */
? pedantic && !TREE_PUBLIC (decl) ? pedantic && !TREE_PUBLIC (decl)
: !TREE_EXTERNAL (decl)); : !DECL_EXTERNAL (decl));
int failure int failure
= complete_array_type (type, DECL_INITIAL (decl), do_default); = complete_array_type (type, DECL_INITIAL (decl), do_default);
...@@ -3089,7 +3089,7 @@ finish_decl (decl, init, asmspec_tree) ...@@ -3089,7 +3089,7 @@ finish_decl (decl, init, asmspec_tree)
if (do_default) if (do_default)
error_with_decl (decl, "array size missing in `%s'"); error_with_decl (decl, "array size missing in `%s'");
else if (!pedantic && TREE_STATIC (decl)) else if (!pedantic && TREE_STATIC (decl))
TREE_EXTERNAL (decl) = 1; DECL_EXTERNAL (decl) = 1;
} }
if (pedantic && TYPE_DOMAIN (type) != 0 if (pedantic && TYPE_DOMAIN (type) != 0
...@@ -3111,7 +3111,7 @@ finish_decl (decl, init, asmspec_tree) ...@@ -3111,7 +3111,7 @@ finish_decl (decl, init, asmspec_tree)
if (! (TREE_PUBLIC (decl) && DECL_INITIAL (decl) == 0)) if (! (TREE_PUBLIC (decl) && DECL_INITIAL (decl) == 0))
error_with_decl (decl, "storage size of `%s' isn't known"); error_with_decl (decl, "storage size of `%s' isn't known");
} }
else if (!TREE_EXTERNAL (decl) && DECL_SIZE (decl) == 0) else if (!DECL_EXTERNAL (decl) && DECL_SIZE (decl) == 0)
{ {
/* An automatic variable with an incomplete type: /* An automatic variable with an incomplete type:
that is an error. */ that is an error. */
...@@ -3119,7 +3119,7 @@ finish_decl (decl, init, asmspec_tree) ...@@ -3119,7 +3119,7 @@ finish_decl (decl, init, asmspec_tree)
TREE_TYPE (decl) = error_mark_node; TREE_TYPE (decl) = error_mark_node;
} }
if ((TREE_EXTERNAL (decl) || TREE_STATIC (decl)) if ((DECL_EXTERNAL (decl) || TREE_STATIC (decl))
&& DECL_SIZE (decl) != 0 && DECL_SIZE (decl) != 0
&& TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST) && TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST)
error_with_decl (decl, "storage size of `%s' isn't constant"); error_with_decl (decl, "storage size of `%s' isn't constant");
...@@ -3155,7 +3155,7 @@ finish_decl (decl, init, asmspec_tree) ...@@ -3155,7 +3155,7 @@ finish_decl (decl, init, asmspec_tree)
/* Recompute the RTL of a local array now /* Recompute the RTL of a local array now
if it used to be an incomplete type. */ if it used to be an incomplete type. */
if (was_incomplete if (was_incomplete
&& ! TREE_STATIC (decl) && ! TREE_EXTERNAL (decl)) && ! TREE_STATIC (decl) && ! DECL_EXTERNAL (decl))
{ {
/* If we used it already as memory, it must stay in memory. */ /* If we used it already as memory, it must stay in memory. */
TREE_ADDRESSABLE (decl) = TREE_USED (decl); TREE_ADDRESSABLE (decl) = TREE_USED (decl);
...@@ -4118,7 +4118,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) ...@@ -4118,7 +4118,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
and we use it for forward declarations for nested functions. */ and we use it for forward declarations for nested functions. */
if (!(specbits & (1 << (int) RID_AUTO)) if (!(specbits & (1 << (int) RID_AUTO))
|| current_binding_level == global_binding_level) || current_binding_level == global_binding_level)
TREE_EXTERNAL (decl) = 1; DECL_EXTERNAL (decl) = 1;
/* Record absence of global scope for `static' or `auto'. */ /* Record absence of global scope for `static' or `auto'. */
TREE_PUBLIC (decl) TREE_PUBLIC (decl)
= !(specbits & ((1 << (int) RID_STATIC) | (1 << (int) RID_AUTO))); = !(specbits & ((1 << (int) RID_STATIC) | (1 << (int) RID_AUTO)));
...@@ -4133,7 +4133,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) ...@@ -4133,7 +4133,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
warning ("inline declaration ignored for function with `...'"); warning ("inline declaration ignored for function with `...'");
else else
/* Assume that otherwise the function can be inlined. */ /* Assume that otherwise the function can be inlined. */
TREE_INLINE (decl) = 1; DECL_INLINE (decl) = 1;
if (specbits & (1 << (int) RID_EXTERN)) if (specbits & (1 << (int) RID_EXTERN))
current_extern_inline = 1; current_extern_inline = 1;
...@@ -4162,7 +4162,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) ...@@ -4162,7 +4162,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
pedwarn_with_decl (decl, "variable `%s' declared `inline'"); pedwarn_with_decl (decl, "variable `%s' declared `inline'");
/* An uninitialized decl with `extern' is a reference. */ /* An uninitialized decl with `extern' is a reference. */
TREE_EXTERNAL (decl) DECL_EXTERNAL (decl)
= !initialized && (specbits & (1 << (int) RID_EXTERN)); = !initialized && (specbits & (1 << (int) RID_EXTERN));
/* At top level, the presence of a `static' or `register' storage /* At top level, the presence of a `static' or `register' storage
class specifier, or the absence of all storage class specifiers class specifier, or the absence of all storage class specifiers
...@@ -4173,13 +4173,13 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) ...@@ -4173,13 +4173,13 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
TREE_PUBLIC (decl) TREE_PUBLIC (decl)
= !(specbits = !(specbits
& ((1 << (int) RID_STATIC) | (1 << (int) RID_REGISTER))); & ((1 << (int) RID_STATIC) | (1 << (int) RID_REGISTER)));
TREE_STATIC (decl) = ! TREE_EXTERNAL (decl); TREE_STATIC (decl) = ! DECL_EXTERNAL (decl);
} }
/* Not at top level, only `static' makes a static definition. */ /* Not at top level, only `static' makes a static definition. */
else else
{ {
TREE_STATIC (decl) = (specbits & (1 << (int) RID_STATIC)) != 0; TREE_STATIC (decl) = (specbits & (1 << (int) RID_STATIC)) != 0;
TREE_PUBLIC (decl) = TREE_EXTERNAL (decl); TREE_PUBLIC (decl) = DECL_EXTERNAL (decl);
} }
} }
...@@ -4187,7 +4187,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) ...@@ -4187,7 +4187,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
and in case doing stupid register allocation. */ and in case doing stupid register allocation. */
if (specbits & (1 << (int) RID_REGISTER)) if (specbits & (1 << (int) RID_REGISTER))
TREE_REGDECL (decl) = 1; DECL_REGISTER (decl) = 1;
/* Record constancy and volatility. */ /* Record constancy and volatility. */
...@@ -5177,10 +5177,10 @@ start_function (declspecs, declarator, nested) ...@@ -5177,10 +5177,10 @@ start_function (declspecs, declarator, nested)
warning_with_decl (decl1, "`%s' was used with no prototype before its definition"); warning_with_decl (decl1, "`%s' was used with no prototype before its definition");
/* This is a definition, not a reference. /* This is a definition, not a reference.
So normally clear TREE_EXTERNAL. So normally clear DECL_EXTERNAL.
However, `extern inline' acts like a declaration However, `extern inline' acts like a declaration
except for defining how to inline. So set TREE_EXTERNAL in that case. */ except for defining how to inline. So set DECL_EXTERNAL in that case. */
TREE_EXTERNAL (decl1) = current_extern_inline; DECL_EXTERNAL (decl1) = current_extern_inline;
/* This function exists in static storage. /* This function exists in static storage.
(This does not mean `static' in the C sense!) */ (This does not mean `static' in the C sense!) */
......
...@@ -1200,7 +1200,7 @@ build_array_ref (array, index) ...@@ -1200,7 +1200,7 @@ build_array_ref (array, index)
if (pedantic && !lvalue_p (array)) if (pedantic && !lvalue_p (array))
{ {
if (TREE_REGDECL (array)) if (DECL_REGISTER (array))
pedwarn ("ANSI C forbids subscripting `register' array"); pedwarn ("ANSI C forbids subscripting `register' array");
else else
pedwarn ("ANSI C forbids subscripting non-lvalue array"); pedwarn ("ANSI C forbids subscripting non-lvalue array");
...@@ -1211,7 +1211,7 @@ build_array_ref (array, index) ...@@ -1211,7 +1211,7 @@ build_array_ref (array, index)
tree foo = array; tree foo = array;
while (TREE_CODE (foo) == COMPONENT_REF) while (TREE_CODE (foo) == COMPONENT_REF)
foo = TREE_OPERAND (foo, 0); foo = TREE_OPERAND (foo, 0);
if (TREE_CODE (foo) == VAR_DECL && TREE_REGDECL (foo)) if (TREE_CODE (foo) == VAR_DECL && DECL_REGISTER (foo))
pedwarn ("ANSI C forbids subscripting non-lvalue array"); pedwarn ("ANSI C forbids subscripting non-lvalue array");
} }
...@@ -3206,7 +3206,7 @@ convert_sequence (conversions, arg) ...@@ -3206,7 +3206,7 @@ convert_sequence (conversions, arg)
/* Return nonzero if REF is an lvalue valid for this language. /* Return nonzero if REF is an lvalue valid for this language.
Lvalues can be assigned, unless their type has TYPE_READONLY. Lvalues can be assigned, unless their type has TYPE_READONLY.
Lvalues can have their address taken, unless they have TREE_REGDECL. */ Lvalues can have their address taken, unless they have DECL_REGISTER. */
int int
lvalue_p (ref) lvalue_p (ref)
...@@ -3353,8 +3353,8 @@ mark_addressable (exp) ...@@ -3353,8 +3353,8 @@ mark_addressable (exp)
case CONST_DECL: case CONST_DECL:
case PARM_DECL: case PARM_DECL:
case RESULT_DECL: case RESULT_DECL:
if (TREE_REGDECL (x) && !TREE_ADDRESSABLE (x) if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)
&& TREE_NONLOCAL (x)) && DECL_NONLOCAL (x))
{ {
if (TREE_PUBLIC (x)) if (TREE_PUBLIC (x))
{ {
...@@ -3365,7 +3365,7 @@ mark_addressable (exp) ...@@ -3365,7 +3365,7 @@ mark_addressable (exp)
pedwarn ("register variable `%s' used in nested function", pedwarn ("register variable `%s' used in nested function",
IDENTIFIER_POINTER (DECL_NAME (x))); IDENTIFIER_POINTER (DECL_NAME (x)));
} }
else if (TREE_REGDECL (x) && !TREE_ADDRESSABLE (x)) else if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x))
{ {
if (TREE_PUBLIC (x)) if (TREE_PUBLIC (x))
{ {
...@@ -4708,7 +4708,19 @@ digest_init (type, init, tail, require_constant, constructor_constant, ofwhat) ...@@ -4708,7 +4708,19 @@ digest_init (type, init, tail, require_constant, constructor_constant, ofwhat)
" `%s'", ofwhat); " `%s'", ofwhat);
return error_mark_node; return error_mark_node;
} }
inside_init = element; else
{
/* Deal with extra levels of {...}. */
if (TREE_CODE (element) == CONSTRUCTOR
&& TREE_TYPE (element) == 0)
{
error_init (
"initializer for scalar%s requires one element",
" `%s'", ofwhat);
return error_mark_node;
}
inside_init = element;
}
} }
#if 0 /* A non-raw constructor is an actual expression. */ #if 0 /* A non-raw constructor is an actual expression. */
......
...@@ -767,12 +767,12 @@ struct tree_type ...@@ -767,12 +767,12 @@ struct tree_type
/* In a VAR_DECL or FUNCTION_DECL, /* In a VAR_DECL or FUNCTION_DECL,
nonzero means external reference: nonzero means external reference:
do not allocate storage, and refer to a definition elsewhere. */ do not allocate storage, and refer to a definition elsewhere. */
#define TREE_EXTERNAL(NODE) ((NODE)->decl.external_flag) #define DECL_EXTERNAL(NODE) ((NODE)->decl.external_flag)
/* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. /* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'.
In LABEL_DECL nodes, nonzero means that an error message about In LABEL_DECL nodes, nonzero means that an error message about
jumping into such a binding contour has been printed for this label. */ jumping into such a binding contour has been printed for this label. */
#define TREE_REGDECL(NODE) ((NODE)->decl.regdecl_flag) #define DECL_REGISTER(NODE) ((NODE)->decl.regdecl_flag)
/* In a FIELD_DECL, indicates this field should be bit-packed. */ /* In a FIELD_DECL, indicates this field should be bit-packed. */
#define DECL_PACKED(NODE) ((NODE)->decl.regdecl_flag) #define DECL_PACKED(NODE) ((NODE)->decl.regdecl_flag)
...@@ -783,11 +783,11 @@ struct tree_type ...@@ -783,11 +783,11 @@ struct tree_type
Also set in some languages for variables, etc., outside the normal Also set in some languages for variables, etc., outside the normal
lexical scope, such as class instance variables. */ lexical scope, such as class instance variables. */
#define TREE_NONLOCAL(NODE) ((NODE)->decl.nonlocal_flag) #define DECL_NONLOCAL(NODE) ((NODE)->decl.nonlocal_flag)
/* Nonzero in a FUNCTION_DECL means this function can be substituted /* Nonzero in a FUNCTION_DECL means this function can be substituted
where it is called. */ where it is called. */
#define TREE_INLINE(NODE) ((NODE)->decl.inline_flag) #define DECL_INLINE(NODE) ((NODE)->decl.inline_flag)
/* Nonzero in a FUNCTION_DECL means this is a built-in function /* Nonzero in a FUNCTION_DECL means this is a built-in function
that is not specified by ansi C and that users are supposed to be allowed that is not specified by ansi C and that users are supposed to be allowed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment