Module Name: src
Committed By: christos
Date: Thu Dec 29 18:44:49 UTC 2016
Modified Files:
src/usr.bin/xlint/lint1: cgram.y scan.l
Log Message:
Add alias attribute
To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/xlint/lint1/scan.l
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.85 src/usr.bin/xlint/lint1/cgram.y:1.86
--- src/usr.bin/xlint/lint1/cgram.y:1.85 Thu Dec 29 13:37:32 2016
+++ src/usr.bin/xlint/lint1/cgram.y Thu Dec 29 13:44:49 2016
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.85 2016/12/29 18:37:32 christos Exp $ */
+/* $NetBSD: cgram.y,v 1.86 2016/12/29 18:44:49 christos Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.85 2016/12/29 18:37:32 christos Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.86 2016/12/29 18:44:49 christos Exp $");
#endif
#include <stdlib.h>
@@ -198,6 +198,7 @@ anonymize(sym_t *s)
%token T_PACKED
/* Type Attributes */
%token <y_type> T_ATTRIBUTE
+%token <y_type> T_AT_ALIAS
%token <y_type> T_AT_ALIGNED
%token <y_type> T_AT_ALWAYS_INLINE
%token <y_type> T_AT_COLD
@@ -513,6 +514,7 @@ type_attribute_spec:
| T_AT_SENTINEL T_LPARN constant T_RPARN
| T_AT_FORMAT_ARG T_LPARN constant T_RPARN
| T_AT_MODE T_LPARN T_NAME T_RPARN
+ | T_AT_ALIAS T_LPARN string T_RPARN
| T_AT_SECTION T_LPARN string T_RPARN
| T_AT_ALIGNED
| T_AT_CONSTRUCTOR
Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.70 src/usr.bin/xlint/lint1/scan.l:1.71
--- src/usr.bin/xlint/lint1/scan.l:1.70 Thu Dec 29 13:37:32 2016
+++ src/usr.bin/xlint/lint1/scan.l Thu Dec 29 13:44:49 2016
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: scan.l,v 1.70 2016/12/29 18:37:32 christos Exp $ */
+/* $NetBSD: scan.l,v 1.71 2016/12/29 18:44:49 christos Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.70 2016/12/29 18:37:32 christos Exp $");
+__RCSID("$NetBSD: scan.l,v 1.71 2016/12/29 18:44:49 christos Exp $");
#endif
#include <stdlib.h>
@@ -209,6 +209,8 @@ static struct kwtab {
{ "__attribute",T_ATTRIBUTE, 0, 0, 0, 0, 0, 1, 0 },
{ "__packed__", T_AT_PACKED, 0, 0, 0, 0, 0, 1, 1 },
{ "packed", T_AT_PACKED, 0, 0, 0, 0, 0, 1, 1 },
+ { "__alias__", T_AT_ALIAS, 0, 0, 0, 0, 0, 1, 1 },
+ { "alias", T_AT_ALIAS, 0, 0, 0, 0, 0, 1, 1 },
{ "__aligned__",T_AT_ALIGNED, 0, 0, 0, 0, 0, 1, 1 },
{ "aligned", T_AT_ALIGNED, 0, 0, 0, 0, 0, 1, 1 },
{ "__transparent_union__",T_AT_TUNION,0,0, 0, 0, 0, 1, 1 },