aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-parse.y
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1999-01-04 07:48:37 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1999-01-04 07:48:37 +0000
commit736b02fdfa3d7c93a3693e2fa41acf6d3d65df8c (patch)
treee6dcbf0a389b511b9751f2e3fbcbf9af76269446 /gcc/c-parse.y
parentfbc7f4a22d02ba59c589d13a50a7866d333e5e22 (diff)
downloadgcc-736b02fdfa3d7c93a3693e2fa41acf6d3d65df8c.zip
gcc-736b02fdfa3d7c93a3693e2fa41acf6d3d65df8c.tar.gz
gcc-736b02fdfa3d7c93a3693e2fa41acf6d3d65df8c.tar.bz2
c-common.c (decl_attributes): Allow applying attribute `unused' on a LABEL_DECL.
* c-common.c (decl_attributes): Allow applying attribute `unused' on a LABEL_DECL. * c-parse.in (label): Parse attributes after a label, and call `decl_attributes' to handle them. * gansidecl.h (ATTRIBUTE_UNUSED_LABEL): Define. * genrecog.c (OUTPUT_LABEL, write_tree_1, write_tree): When generating labels, mark them with ATTRIBUTE_UNUSED_LABEL. * invoke.texi: Note that labels can be marked `unused'. From-SVN: r24478
Diffstat (limited to 'gcc/c-parse.y')
-rw-r--r--gcc/c-parse.y7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/c-parse.y b/gcc/c-parse.y
index aa5a5b4..1d6064c 100644
--- a/gcc/c-parse.y
+++ b/gcc/c-parse.y
@@ -2019,12 +2019,15 @@ label: CASE expr_no_commas ':'
error_with_decl (duplicate, "this is the first default label");
}
position_after_white_space (); }
- | identifier ':'
+ | identifier ':' maybe_attribute
{ tree label = define_label (input_filename, lineno, $1);
stmt_count++;
emit_nop ();
if (label)
- expand_label (label);
+ {
+ expand_label (label);
+ decl_attributes (label, $3, NULL_TREE);
+ }
position_after_white_space (); }
;