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 __thread/tls_model attribute



details:   https://anonhg.NetBSD.org/src/rev/e3d4d8425752
branches:  trunk
changeset: 839727:e3d4d8425752
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Mar 04 17:45:16 2019 +0000

description:
Add __thread/tls_model attribute

diffstat:

 usr.bin/xlint/lint1/cgram.y |  6 ++++--
 usr.bin/xlint/lint1/decl.c  |  6 ++++--
 usr.bin/xlint/lint1/lint1.h |  4 ++--
 usr.bin/xlint/lint1/scan.l  |  8 +++++---
 4 files changed, 15 insertions(+), 9 deletions(-)

diffs (119 lines):

diff -r e24d02296e68 -r e3d4d8425752 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Mon Mar 04 17:36:35 2019 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Mon Mar 04 17:45:16 2019 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.103 2019/03/04 15:28:18 christos Exp $ */
+/* $NetBSD: cgram.y,v 1.104 2019/03/04 17:45:16 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.103 2019/03/04 15:28:18 christos Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.104 2019/03/04 17:45:16 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -235,6 +235,7 @@
 %token <y_type>                T_AT_SECTION
 %token <y_type>                T_AT_SENTINEL
 %token <y_type>                T_AT_STRING
+%token <y_type>                T_AT_TLS_MODEL
 %token <y_type>                T_AT_TUNION
 %token <y_type>                T_AT_UNUSED
 %token <y_type>                T_AT_USED
@@ -547,6 +548,7 @@
        | T_AT_ALIAS T_LPARN string T_RPARN
        | T_AT_PCS T_LPARN string T_RPARN
        | T_AT_SECTION T_LPARN string T_RPARN
+       | T_AT_TLS_MODEL T_LPARN string T_RPARN
        | T_AT_ALIGNED 
        | T_AT_CONSTRUCTOR 
        | T_AT_DESTRUCTOR 
diff -r e24d02296e68 -r e3d4d8425752 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Mon Mar 04 17:36:35 2019 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Mon Mar 04 17:45:16 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.69 2018/09/07 15:16:15 christos Exp $ */
+/* $NetBSD: decl.c,v 1.70 2019/03/04 17:45:16 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: decl.c,v 1.69 2018/09/07 15:16:15 christos Exp $");
+__RCSID("$NetBSD: decl.c,v 1.70 2019/03/04 17:45:16 christos Exp $");
 #endif
 
 #include <sys/param.h>
@@ -568,6 +568,8 @@
                }
                dcs->d_const = 1;
        } else {
+               if (q == THREAD)
+                       return;
                if (q != VOLATILE)
                        LERROR("addqual()");
                if (dcs->d_volatile) {
diff -r e24d02296e68 -r e3d4d8425752 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h       Mon Mar 04 17:36:35 2019 +0000
+++ b/usr.bin/xlint/lint1/lint1.h       Mon Mar 04 17:45:16 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.30 2016/12/27 21:52:35 christos Exp $ */
+/* $NetBSD: lint1.h,v 1.31 2019/03/04 17:45:16 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -95,7 +95,7 @@
  * qualifiers (only for lex/yacc interface)
  */
 typedef enum {
-       CONST, VOLATILE, RESTRICT
+       CONST, VOLATILE, RESTRICT, THREAD
 } tqual_t;
 
 /*
diff -r e24d02296e68 -r e3d4d8425752 usr.bin/xlint/lint1/scan.l
--- a/usr.bin/xlint/lint1/scan.l        Mon Mar 04 17:36:35 2019 +0000
+++ b/usr.bin/xlint/lint1/scan.l        Mon Mar 04 17:45:16 2019 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.88 2019/03/04 15:26:18 christos Exp $ */
+/* $NetBSD: scan.l,v 1.89 2019/03/04 17:45:16 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.88 2019/03/04 15:26:18 christos Exp $");
+__RCSID("$NetBSD: scan.l,v 1.89 2019/03/04 17:45:16 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -209,6 +209,7 @@
        { "__int128_t", T_TYPE,         0,      INT128, 0,        0,1,0,0,1 },
        { "__uint128_t",T_TYPE,         0,      UINT128,0,        0,1,0,0,1 },
 #endif
+       { "__thread",   T_QUAL,         0,      0,      THREAD,   0,0,1,0,7 },
        { "_Bool",      T_TYPE,         0,      BOOL,   0,        0,1,0,0,1 },
        { "_Complex",   T_TYPE,         0,      COMPLEX,0,        0,1,0,0,1 },
        { "_Generic",   T_GENERIC,      0,      0,      0,        0,1,0,0,1 },
@@ -284,9 +285,10 @@
        { "string",     T_AT_STRING,    0,      0,      0,        0,0,1,1,5 },
        { "struct",     T_SOU,          0,      STRUCT, 0,        0,0,0,0,1 },
        { "switch",     T_SWITCH,       0,      0,      0,        0,0,0,0,1 },
-       { "symbolrename", T_SYMBOLRENAME, 0,    0,      0,        0,0,0,0,2 },
+       { "symbolrename", T_SYMBOLRENAME,0,     0,      0,        0,0,0,0,2 },
        { "syslog",     T_AT_FORMAT_SYSLOG,0,   0,      0,        0,0,1,1,5 },
        { "transparent_union",T_AT_TUNION,0,    0,      0,        0,0,1,1,5 },
+       { "tls_model",  T_AT_TLS_MODEL, 0,      0,      0,        0,0,1,1,5 },
        { "typedef",    T_SCLASS,       TYPEDEF, 0,     0,        0,0,0,0,1 },
        { "typeof",     T_TYPEOF,       0,      0,      0,        0,0,1,0,7 },
        { "union",      T_SOU,          0,      UNION,  0,        0,0,0,0,1 },



Home | Main Index | Thread Index | Old Index