Commit 1c4fadec by Richard Kenner

(enum attrs): Add A_UNUSED.

(init_attributes): Initialize it.
(decl_attributes, case A_UNUSED): New case.

From-SVN: r9545
parent 97279364
......@@ -30,7 +30,7 @@ extern struct obstack permanent_obstack;
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, A_WEAK, A_ALIAS};
A_UNUSED, A_FORMAT, A_WEAK, A_ALIAS};
static void declare_hidden_char_array PROTO((char *, char *));
static void add_attribute PROTO((enum attrs, char *,
......@@ -250,6 +250,7 @@ init_attributes ()
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_UNUSED, "unused", 0, 0, 1);
add_attribute (A_CONST, "const", 0, 0, 1);
add_attribute (A_T_UNION, "transparent_union", 0, 0, 0);
add_attribute (A_CONSTRUCTOR, "constructor", 0, 0, 1);
......@@ -355,6 +356,14 @@ decl_attributes (node, attributes, prefix_attributes)
warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
break;
case A_UNUSED:
if (TREE_CODE (decl) == PARM_DECL || TREE_CODE (decl) == VAR_DECL
|| TREE_CODE (decl) == FUNCTION_DECL)
TREE_USED (decl) = 1;
else
warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
break;
case A_CONST:
if (TREE_CODE (decl) == FUNCTION_DECL)
TREE_READONLY (decl) = 1;
......
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