(enum attrs): New attribute, A_NOCOMMON.
(init_attribute): Initialize it. (decl_attributes): Implement it. From-SVN: r9347
This commit is contained in:
parent
f507a07044
commit
bbb1ae016c
|
@ -28,8 +28,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
|
||||
extern struct obstack permanent_obstack;
|
||||
|
||||
enum attrs {A_PACKED, A_NORETURN, A_CONST, A_T_UNION, A_CONSTRUCTOR,
|
||||
A_DESTRUCTOR, A_MODE, A_SECTION, A_ALIGNED, A_FORMAT};
|
||||
enum attrs {A_PACKED, A_NOCOMMON, A_NORETURN, A_CONST, A_T_UNION,
|
||||
A_CONSTRUCTOR, A_DESTRUCTOR, A_MODE, A_SECTION, A_ALIGNED,
|
||||
A_FORMAT};
|
||||
|
||||
static void declare_hidden_char_array PROTO((char *, char *));
|
||||
static void add_attribute PROTO((enum attrs, char *,
|
||||
|
@ -246,6 +247,7 @@ static void
|
|||
init_attributes ()
|
||||
{
|
||||
add_attribute (A_PACKED, "packed", 0, 0, 1);
|
||||
add_attribute (A_NOCOMMON, "nocommon", 0, 0, 1);
|
||||
add_attribute (A_NORETURN, "noreturn", 0, 0, 1);
|
||||
add_attribute (A_NORETURN, "volatile", 0, 0, 1);
|
||||
add_attribute (A_CONST, "const", 0, 0, 1);
|
||||
|
@ -329,6 +331,13 @@ decl_attributes (node, attributes, prefix_attributes)
|
|||
warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
|
||||
break;
|
||||
|
||||
case A_NOCOMMON:
|
||||
if (TREE_CODE (decl) == VAR_DECL)
|
||||
DECL_COMMON (decl) = 0;
|
||||
else
|
||||
warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
|
||||
break;
|
||||
|
||||
case A_NORETURN:
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL)
|
||||
TREE_THIS_VOLATILE (decl) = 1;
|
||||
|
|
Loading…
Reference in New Issue