Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 Add _Alignas()



details:   https://anonhg.NetBSD.org/src/rev/5bfb2de439c0
branches:  trunk
changeset: 953906:5bfb2de439c0
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Mar 23 20:57:40 2021 +0000

description:
Add _Alignas()

diffstat:

 usr.bin/xlint/lint1/cgram.y |  14 +++++++++++---
 usr.bin/xlint/lint1/lex.c   |   5 +++--
 2 files changed, 14 insertions(+), 5 deletions(-)

diffs (82 lines):

diff -r d5a0f264f643 -r 5bfb2de439c0 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Tue Mar 23 20:57:10 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Tue Mar 23 20:57:40 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.198 2021/03/23 18:40:50 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.199 2021/03/23 20:57:40 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.198 2021/03/23 18:40:50 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.199 2021/03/23 20:57:40 christos Exp $");
 #endif
 
 #include <limits.h>
@@ -123,7 +123,7 @@
 }
 %}
 
-%expect 134
+%expect 165
 
 %union {
        val_t   *y_val;
@@ -149,6 +149,7 @@
 %token                 T_BUILTIN_OFFSETOF
 %token                 T_TYPEOF
 %token                 T_EXTENSION
+%token                 T_ALIGNAS
 %token                 T_ALIGNOF
 %token                 T_ASTERISK
 %token <y_op>          T_MULTIPLICATIVE
@@ -605,12 +606,19 @@
        | type_attribute_spec_list T_COMMA type_attribute_spec
        ;
 
+align_as:
+         typespec
+       | constant_expr
+       ;
+
 type_attribute:
          T_ATTRIBUTE T_LPAREN T_LPAREN {
            attron = true;
          } type_attribute_spec_list {
            attron = false;
          } T_RPAREN T_RPAREN
+       | T_ALIGNAS T_LPAREN align_as T_RPAREN {
+         }
        | T_PACKED {
                addpacked();
          }
diff -r d5a0f264f643 -r 5bfb2de439c0 usr.bin/xlint/lint1/lex.c
--- a/usr.bin/xlint/lint1/lex.c Tue Mar 23 20:57:10 2021 +0000
+++ b/usr.bin/xlint/lint1/lex.c Tue Mar 23 20:57:40 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.15 2021/03/21 14:49:21 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.16 2021/03/23 20:57:40 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: lex.c,v 1.15 2021/03/21 14:49:21 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.16 2021/03/23 20:57:40 christos Exp $");
 #endif
 
 #include <ctype.h>
@@ -135,6 +135,7 @@
        kwdef_type(     "__uint128_t",  UINT128,                0,1,0,0,1),
 #endif
        kwdef_tqual(    "__thread",     THREAD,                 0,0,1,0,1),
+       kwdef_token(    "_Alignas",     T_ALIGNAS,              0,0,0,0,1),
        kwdef_token(    "_Alignof",     T_ALIGNOF,              0,0,0,0,1),
        kwdef_type(     "_Bool",        BOOL,                   0,1,0,0,1),
        kwdef_type(     "_Complex",     COMPLEX,                0,1,0,0,1),



Home | Main Index | Thread Index | Old Index