Module Name:    src
Committed By:   christos
Date:           Mon Mar  4 17:45:16 UTC 2019

Modified Files:
        src/usr.bin/xlint/lint1: cgram.y decl.c lint1.h scan.l

Log Message:
Add __thread/tls_model attribute


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.88 -r1.89 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.103 src/usr.bin/xlint/lint1/cgram.y:1.104
--- src/usr.bin/xlint/lint1/cgram.y:1.103	Mon Mar  4 10:28:18 2019
+++ src/usr.bin/xlint/lint1/cgram.y	Mon Mar  4 12:45:16 2019
@@ -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 @@ anonymize(sym_t *s)
 %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 @@ type_attribute_spec:
 	| 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 

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.69 src/usr.bin/xlint/lint1/decl.c:1.70
--- src/usr.bin/xlint/lint1/decl.c:1.69	Fri Sep  7 11:16:15 2018
+++ src/usr.bin/xlint/lint1/decl.c	Mon Mar  4 12:45:16 2019
@@ -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 @@ addqual(tqual_t q)
 		}
 		dcs->d_const = 1;
 	} else {
+		if (q == THREAD)
+			return;
 		if (q != VOLATILE)
 			LERROR("addqual()");
 		if (dcs->d_volatile) {

Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.30 src/usr.bin/xlint/lint1/lint1.h:1.31
--- src/usr.bin/xlint/lint1/lint1.h:1.30	Tue Dec 27 16:52:35 2016
+++ src/usr.bin/xlint/lint1/lint1.h	Mon Mar  4 12:45:16 2019
@@ -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 @@ typedef	struct strg {
  * qualifiers (only for lex/yacc interface)
  */
 typedef enum {
-	CONST, VOLATILE, RESTRICT
+	CONST, VOLATILE, RESTRICT, THREAD
 } tqual_t;
 
 /*

Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.88 src/usr.bin/xlint/lint1/scan.l:1.89
--- src/usr.bin/xlint/lint1/scan.l:1.88	Mon Mar  4 10:26:18 2019
+++ src/usr.bin/xlint/lint1/scan.l	Mon Mar  4 12:45:16 2019
@@ -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 @@ static	struct	kwtab {
 	{ "__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 @@ static	struct	kwtab {
 	{ "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 },

Reply via email to