Mercurial > hg > CbC > CbC_gcc
annotate gcc/builtin-attrs.def @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
rev | line source |
---|---|
131 | 1 /* Copyright (C) 2001-2018 Free Software Foundation, Inc. |
0 | 2 Contributed by Joseph Myers <jsm28@cam.ac.uk>. |
3 | |
4 This file is part of GCC. | |
5 | |
6 GCC is free software; you can redistribute it and/or modify it under | |
7 the terms of the GNU General Public License as published by the Free | |
8 Software Foundation; either version 3, or (at your option) any later | |
9 version. | |
10 | |
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
17 along with GCC; see the file COPYING3. If not see | |
18 <http://www.gnu.org/licenses/>. */ | |
19 | |
20 /* This header provides a declarative way of describing the attributes | |
111 | 21 that are applied to some built-in functions by default. Attributes |
22 that are meant to be used by user-defined functions but aren't used | |
23 by any built-ins, or attributes that apply to types or variables | |
24 but not to functions need not and should not be defined here. | |
0 | 25 |
26 Before including this header, you must define the following macros. | |
27 In each case where there is an ENUM, it is an identifier used to | |
28 reference the tree in subsequent definitions. | |
29 | |
30 DEF_ATTR_NULL_TREE (ENUM) | |
31 | |
32 Constructs a NULL_TREE. | |
33 | |
34 DEF_ATTR_INT (ENUM, VALUE) | |
35 | |
36 Constructs an INTEGER_CST with value VALUE (an integer representable | |
37 in HOST_WIDE_INT). | |
38 | |
39 DEF_ATTR_IDENT (ENUM, STRING) | |
40 | |
41 Constructs an IDENTIFIER_NODE for STRING. | |
42 | |
43 DEF_ATTR_TREE_LIST (ENUM, PURPOSE, VALUE, CHAIN) | |
44 | |
45 Constructs a TREE_LIST with given PURPOSE, VALUE and CHAIN (given | |
46 as previous ENUM names). */ | |
47 | |
48 DEF_ATTR_NULL_TREE (ATTR_NULL) | |
49 | |
50 /* Construct a tree for a given integer and a list containing it. */ | |
51 #define DEF_ATTR_FOR_INT(VALUE) \ | |
52 DEF_ATTR_INT (ATTR_##VALUE, VALUE) \ | |
53 DEF_ATTR_TREE_LIST (ATTR_LIST_##VALUE, ATTR_NULL, \ | |
54 ATTR_##VALUE, ATTR_NULL) | |
55 DEF_ATTR_FOR_INT (0) | |
56 DEF_ATTR_FOR_INT (1) | |
57 DEF_ATTR_FOR_INT (2) | |
58 DEF_ATTR_FOR_INT (3) | |
59 DEF_ATTR_FOR_INT (4) | |
60 DEF_ATTR_FOR_INT (5) | |
61 DEF_ATTR_FOR_INT (6) | |
62 #undef DEF_ATTR_FOR_INT | |
63 | |
111 | 64 /* Construct a tree for a given string and a list containing it. */ |
65 #define DEF_ATTR_FOR_STRING(ENUM, VALUE) \ | |
66 DEF_ATTR_STRING (ATTR_##ENUM, VALUE) \ | |
67 DEF_ATTR_TREE_LIST (ATTR_LIST_##ENUM, ATTR_NULL, \ | |
68 ATTR_##ENUM, ATTR_NULL) | |
69 DEF_ATTR_FOR_STRING (STR1, "1") | |
70 #undef DEF_ATTR_FOR_STRING | |
71 | |
0 | 72 /* Construct a tree for a list of two integers. */ |
73 #define DEF_LIST_INT_INT(VALUE1, VALUE2) \ | |
74 DEF_ATTR_TREE_LIST (ATTR_LIST_##VALUE1##_##VALUE2, ATTR_NULL, \ | |
75 ATTR_##VALUE1, ATTR_LIST_##VALUE2) | |
76 DEF_LIST_INT_INT (1,0) | |
77 DEF_LIST_INT_INT (1,2) | |
111 | 78 DEF_LIST_INT_INT (1,3) |
79 DEF_LIST_INT_INT (1,4) | |
80 DEF_LIST_INT_INT (1,5) | |
0 | 81 DEF_LIST_INT_INT (2,0) |
82 DEF_LIST_INT_INT (2,3) | |
83 DEF_LIST_INT_INT (3,0) | |
84 DEF_LIST_INT_INT (3,4) | |
85 DEF_LIST_INT_INT (4,0) | |
86 DEF_LIST_INT_INT (4,5) | |
87 DEF_LIST_INT_INT (5,0) | |
88 DEF_LIST_INT_INT (5,6) | |
89 #undef DEF_LIST_INT_INT | |
90 | |
111 | 91 /* Construct trees for identifiers used in built-in function attributes. |
92 The construction contributes to startup costs so only attributes that | |
93 are used to define built-ins should be defined here. */ | |
94 DEF_ATTR_IDENT (ATTR_ALLOC_SIZE, "alloc_size") | |
95 DEF_ATTR_IDENT (ATTR_COLD, "cold") | |
0 | 96 DEF_ATTR_IDENT (ATTR_CONST, "const") |
97 DEF_ATTR_IDENT (ATTR_FORMAT, "format") | |
98 DEF_ATTR_IDENT (ATTR_FORMAT_ARG, "format_arg") | |
99 DEF_ATTR_IDENT (ATTR_MALLOC, "malloc") | |
100 DEF_ATTR_IDENT (ATTR_NONNULL, "nonnull") | |
101 DEF_ATTR_IDENT (ATTR_NORETURN, "noreturn") | |
102 DEF_ATTR_IDENT (ATTR_NOTHROW, "nothrow") | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
103 DEF_ATTR_IDENT (ATTR_LEAF, "leaf") |
111 | 104 DEF_ATTR_IDENT (ATTR_FNSPEC, "fn spec") |
0 | 105 DEF_ATTR_IDENT (ATTR_PRINTF, "printf") |
106 DEF_ATTR_IDENT (ATTR_ASM_FPRINTF, "asm_fprintf") | |
107 DEF_ATTR_IDENT (ATTR_GCC_DIAG, "gcc_diag") | |
108 DEF_ATTR_IDENT (ATTR_GCC_CDIAG, "gcc_cdiag") | |
109 DEF_ATTR_IDENT (ATTR_GCC_CXXDIAG, "gcc_cxxdiag") | |
110 DEF_ATTR_IDENT (ATTR_PURE, "pure") | |
111 DEF_ATTR_IDENT (ATTR_NOVOPS, "no vops") | |
112 DEF_ATTR_IDENT (ATTR_SCANF, "scanf") | |
113 DEF_ATTR_IDENT (ATTR_SENTINEL, "sentinel") | |
114 DEF_ATTR_IDENT (ATTR_STRFMON, "strfmon") | |
115 DEF_ATTR_IDENT (ATTR_STRFTIME, "strftime") | |
116 DEF_ATTR_IDENT (ATTR_TYPEGENERIC, "type generic") | |
111 | 117 DEF_ATTR_IDENT (ATTR_TM_REGPARM, "*tm regparm") |
118 DEF_ATTR_IDENT (ATTR_TM_TMPURE, "transaction_pure") | |
119 DEF_ATTR_IDENT (ATTR_RETURNS_TWICE, "returns_twice") | |
120 DEF_ATTR_IDENT (ATTR_RETURNS_NONNULL, "returns_nonnull") | |
0 | 121 |
122 DEF_ATTR_TREE_LIST (ATTR_NOVOPS_LIST, ATTR_NOVOPS, ATTR_NULL, ATTR_NULL) | |
123 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
124 DEF_ATTR_TREE_LIST (ATTR_NOVOPS_LEAF_LIST, ATTR_LEAF, ATTR_NULL, ATTR_NOVOPS_LIST) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
125 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
126 DEF_ATTR_TREE_LIST (ATTR_LEAF_LIST, ATTR_LEAF, ATTR_NULL, ATTR_NULL) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
127 |
0 | 128 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_LIST, ATTR_NOTHROW, ATTR_NULL, ATTR_NULL) |
129 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
130 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_LEAF_LIST, ATTR_LEAF, ATTR_NULL, ATTR_NOTHROW_LIST) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
131 |
131 | 132 DEF_ATTR_TREE_LIST (ATTR_NOVOPS_NOTHROW_LEAF_LIST, ATTR_NOVOPS, \ |
133 ATTR_NULL, ATTR_NOTHROW_LEAF_LIST) | |
0 | 134 DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_LIST, ATTR_CONST, \ |
135 ATTR_NULL, ATTR_NOTHROW_LIST) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
136 DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_LEAF_LIST, ATTR_CONST, \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
137 ATTR_NULL, ATTR_NOTHROW_LEAF_LIST) |
0 | 138 DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_LIST, ATTR_PURE, \ |
139 ATTR_NULL, ATTR_NOTHROW_LIST) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
140 DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_LEAF_LIST, ATTR_PURE, \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
141 ATTR_NULL, ATTR_NOTHROW_LEAF_LIST) |
0 | 142 DEF_ATTR_TREE_LIST (ATTR_NORETURN_NOTHROW_LIST, ATTR_NORETURN, \ |
143 ATTR_NULL, ATTR_NOTHROW_LIST) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
144 DEF_ATTR_TREE_LIST (ATTR_NORETURN_NOTHROW_LEAF_LIST, ATTR_NORETURN,\ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
145 ATTR_NULL, ATTR_NOTHROW_LEAF_LIST) |
111 | 146 DEF_ATTR_TREE_LIST (ATTR_NORETURN_NOTHROW_LEAF_COLD_LIST, ATTR_COLD,\ |
147 ATTR_NULL, ATTR_NORETURN_NOTHROW_LEAF_LIST) | |
148 DEF_ATTR_TREE_LIST (ATTR_RT_NOTHROW_LEAF_LIST, ATTR_RETURNS_TWICE,\ | |
149 ATTR_NULL, ATTR_NOTHROW_LEAF_LIST) | |
150 DEF_ATTR_TREE_LIST (ATTR_COLD_NOTHROW_LEAF_LIST, ATTR_COLD,\ | |
151 ATTR_NULL, ATTR_NOTHROW_LEAF_LIST) | |
152 DEF_ATTR_TREE_LIST (ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST, ATTR_COLD,\ | |
153 ATTR_NULL, ATTR_NORETURN_NOTHROW_LEAF_LIST) | |
154 DEF_ATTR_TREE_LIST (ATTR_CONST_NORETURN_NOTHROW_LEAF_LIST, ATTR_CONST,\ | |
155 ATTR_NULL, ATTR_NORETURN_NOTHROW_LEAF_LIST) | |
156 DEF_ATTR_TREE_LIST (ATTR_CONST_NORETURN_NOTHROW_LEAF_COLD_LIST, ATTR_COLD,\ | |
157 ATTR_NULL, ATTR_CONST_NORETURN_NOTHROW_LEAF_LIST) | |
0 | 158 DEF_ATTR_TREE_LIST (ATTR_MALLOC_NOTHROW_LIST, ATTR_MALLOC, \ |
159 ATTR_NULL, ATTR_NOTHROW_LIST) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
160 DEF_ATTR_TREE_LIST (ATTR_MALLOC_NOTHROW_LEAF_LIST, ATTR_MALLOC, \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
161 ATTR_NULL, ATTR_NOTHROW_LEAF_LIST) |
0 | 162 DEF_ATTR_TREE_LIST (ATTR_SENTINEL_NOTHROW_LIST, ATTR_SENTINEL, \ |
163 ATTR_NULL, ATTR_NOTHROW_LIST) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
164 DEF_ATTR_TREE_LIST (ATTR_SENTINEL_NOTHROW_LEAF_LIST, ATTR_SENTINEL, \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
165 ATTR_NULL, ATTR_NOTHROW_LEAF_LIST) |
111 | 166 DEF_ATTR_TREE_LIST (ATTR_COLD_CONST_NORETURN_NOTHROW_LEAF_LIST, ATTR_CONST,\ |
167 ATTR_NULL, ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST) | |
168 | |
169 /* Allocation functions like malloc and realloc whose first argument | |
170 with _SIZE_1, or second argument with _SIZE_2, specifies the size | |
171 of the allocated object. */ | |
172 DEF_ATTR_TREE_LIST (ATTR_MALLOC_SIZE_1_NOTHROW_LIST, ATTR_ALLOC_SIZE, \ | |
173 ATTR_LIST_1, ATTR_MALLOC_NOTHROW_LIST) | |
174 DEF_ATTR_TREE_LIST (ATTR_ALLOC_SIZE_2_NOTHROW_LIST, ATTR_ALLOC_SIZE, \ | |
175 ATTR_LIST_2, ATTR_MALLOC_NOTHROW_LIST) | |
176 DEF_ATTR_TREE_LIST (ATTR_MALLOC_SIZE_1_NOTHROW_LEAF_LIST, ATTR_ALLOC_SIZE, \ | |
177 ATTR_LIST_1, ATTR_MALLOC_NOTHROW_LEAF_LIST) | |
178 /* Alloca is just like malloc except that it never returns null. */ | |
179 DEF_ATTR_TREE_LIST (ATTR_ALLOCA_SIZE_1_NOTHROW_LEAF_LIST, ATTR_RETURNS_NONNULL, | |
180 ATTR_NULL, ATTR_MALLOC_SIZE_1_NOTHROW_LEAF_LIST) | |
181 | |
182 /* Allocation functions like calloc the product of whose first two arguments | |
183 specifies the size of the allocated object. */ | |
184 DEF_ATTR_TREE_LIST (ATTR_MALLOC_SIZE_1_2_NOTHROW_LEAF_LIST, ATTR_ALLOC_SIZE, \ | |
185 ATTR_LIST_1_2, ATTR_MALLOC_NOTHROW_LEAF_LIST) | |
186 | |
187 /* Allocation functions like realloc whose second argument specifies | |
188 the size of the allocated object. */ | |
189 DEF_ATTR_TREE_LIST (ATTR_ALLOC_SIZE_2_NOTHROW_LEAF_LIST, ATTR_ALLOC_SIZE, \ | |
190 ATTR_LIST_2, ATTR_NOTHROW_LEAF_LIST) | |
0 | 191 |
192 /* Functions whose pointer parameter(s) are all nonnull. */ | |
193 DEF_ATTR_TREE_LIST (ATTR_NONNULL_LIST, ATTR_NONNULL, ATTR_NULL, ATTR_NULL) | |
194 /* Functions whose first parameter is a nonnull pointer. */ | |
195 DEF_ATTR_TREE_LIST (ATTR_NONNULL_1, ATTR_NONNULL, ATTR_LIST_1, ATTR_NULL) | |
196 /* Functions whose second parameter is a nonnull pointer. */ | |
197 DEF_ATTR_TREE_LIST (ATTR_NONNULL_2, ATTR_NONNULL, ATTR_LIST_2, ATTR_NULL) | |
198 /* Functions whose third parameter is a nonnull pointer. */ | |
199 DEF_ATTR_TREE_LIST (ATTR_NONNULL_3, ATTR_NONNULL, ATTR_LIST_3, ATTR_NULL) | |
200 /* Nothrow functions with the sentinel(1) attribute. */ | |
201 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_SENTINEL_1, ATTR_SENTINEL, ATTR_LIST_1, \ | |
202 ATTR_NOTHROW_LIST) | |
203 /* Nothrow functions whose pointer parameter(s) are all nonnull. */ | |
204 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL, ATTR_NONNULL, ATTR_NULL, \ | |
205 ATTR_NOTHROW_LIST) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
206 /* Nothrow leaf functions whose pointer parameter(s) are all nonnull. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
207 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_LEAF, ATTR_NONNULL, ATTR_NULL, \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
208 ATTR_NOTHROW_LEAF_LIST) |
111 | 209 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_LEAF_LIST, ATTR_LEAF, ATTR_NULL, ATTR_NOTHROW_NONNULL_LEAF) |
0 | 210 /* Nothrow functions whose first parameter is a nonnull pointer. */ |
211 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_1, ATTR_NONNULL, ATTR_LIST_1, \ | |
212 ATTR_NOTHROW_LIST) | |
213 /* Nothrow functions whose second parameter is a nonnull pointer. */ | |
214 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_2, ATTR_NONNULL, ATTR_LIST_2, \ | |
215 ATTR_NOTHROW_LIST) | |
216 /* Nothrow functions whose third parameter is a nonnull pointer. */ | |
217 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_3, ATTR_NONNULL, ATTR_LIST_3, \ | |
218 ATTR_NOTHROW_LIST) | |
219 /* Nothrow functions whose fourth parameter is a nonnull pointer. */ | |
220 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_4, ATTR_NONNULL, ATTR_LIST_4, \ | |
221 ATTR_NOTHROW_LIST) | |
222 /* Nothrow functions whose fifth parameter is a nonnull pointer. */ | |
223 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_5, ATTR_NONNULL, ATTR_LIST_5, \ | |
224 ATTR_NOTHROW_LIST) | |
111 | 225 |
226 /* Same as ATTR_NONNULL_1. */ | |
227 DEF_ATTR_TREE_LIST (ATTR_NONNULL_1_1, ATTR_NONNULL, ATTR_LIST_1, ATTR_NULL) | |
228 /* Functions like {v,}fprintf whose first and second parameters are | |
229 nonnull pointers. As cancellation points the functions are not | |
230 nothrow. */ | |
231 DEF_ATTR_TREE_LIST (ATTR_NONNULL_1_2, ATTR_NONNULL, ATTR_LIST_1_2, ATTR_NULL) | |
232 /* The following don't have {v,}fprintf forms. They exist only to | |
233 make it possible to declare {v,}{f,s}printf attributes using | |
234 the same macro. */ | |
235 DEF_ATTR_TREE_LIST (ATTR_NONNULL_1_3, ATTR_NONNULL, ATTR_LIST_1_3, ATTR_NULL) | |
236 DEF_ATTR_TREE_LIST (ATTR_NONNULL_1_4, ATTR_NONNULL, ATTR_LIST_1_4, ATTR_NULL) | |
237 DEF_ATTR_TREE_LIST (ATTR_NONNULL_1_5, ATTR_NONNULL, ATTR_LIST_1_5, ATTR_NULL) | |
238 | |
239 /* Same as ATTR_NOTHROW_NONNULL_1. */ | |
240 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_1_1, ATTR_NONNULL, ATTR_LIST_1, | |
241 ATTR_NOTHROW_LIST) | |
242 /* Nothrow functions like {v,}sprintf whose first and second parameters | |
243 are nonnull pointers. */ | |
244 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_1_2, ATTR_NONNULL, ATTR_LIST_1_2, \ | |
245 ATTR_NOTHROW_LIST) | |
246 /* Nothrow functions like {v,}snprintf whose first and third parameters | |
247 are nonnull pointers. */ | |
248 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_1_3, ATTR_NONNULL, ATTR_LIST_1_3, \ | |
249 ATTR_NOTHROW_LIST) | |
250 /* Nothrow functions like {v,}sprintf_chk whose first and fourth parameters | |
251 are nonnull pointers. */ | |
252 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_1_4, ATTR_NONNULL, ATTR_LIST_1_4, \ | |
253 ATTR_NOTHROW_LIST) | |
254 /* Nothrow functions like {v,}snprintf_chk whose first and fifth parameters | |
255 are nonnull pointers. */ | |
256 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_1_5, ATTR_NONNULL, ATTR_LIST_1_5, \ | |
257 ATTR_NOTHROW_LIST) | |
258 | |
259 /* Nothrow leaf functions which are type-generic. */ | |
260 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_TYPEGENERIC_LEAF, ATTR_TYPEGENERIC, ATTR_NULL, \ | |
261 ATTR_NOTHROW_LEAF_LIST) | |
262 /* Nothrow nonnull leaf functions that are type-generic. */ | |
263 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_TYPEGENERIC_LEAF, | |
264 ATTR_TYPEGENERIC, ATTR_NULL, | |
265 ATTR_NOTHROW_NONNULL_LEAF) | |
0 | 266 /* Nothrow const functions whose pointer parameter(s) are all nonnull. */ |
267 DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_NONNULL, ATTR_CONST, ATTR_NULL, \ | |
268 ATTR_NOTHROW_NONNULL) | |
111 | 269 /* Nothrow leaf functions whose pointer parameter(s) are all nonnull, |
270 and which return their first argument. */ | |
271 DEF_ATTR_TREE_LIST (ATTR_RET1_NOTHROW_NONNULL_LEAF, ATTR_FNSPEC, ATTR_LIST_STR1, \ | |
272 ATTR_NOTHROW_NONNULL_LEAF) | |
273 /* Nothrow leaf functions whose pointer parameter(s) are all nonnull, | |
274 and return value is also nonnull. */ | |
275 DEF_ATTR_TREE_LIST (ATTR_RETNONNULL_NOTHROW_LEAF, ATTR_RETURNS_NONNULL, ATTR_NULL, \ | |
276 ATTR_NOTHROW_NONNULL_LEAF) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
277 /* Nothrow const leaf functions whose pointer parameter(s) are all nonnull. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
278 DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_NONNULL_LEAF, ATTR_CONST, ATTR_NULL, \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
279 ATTR_NOTHROW_NONNULL_LEAF) |
0 | 280 /* Nothrow const functions which are type-generic. */ |
281 DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_TYPEGENERIC, ATTR_TYPEGENERIC, ATTR_NULL, \ | |
282 ATTR_CONST_NOTHROW_LIST) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
283 /* Nothrow const leaf functions which are type-generic. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
284 DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF, ATTR_TYPEGENERIC, ATTR_NULL, \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
285 ATTR_CONST_NOTHROW_LEAF_LIST) |
0 | 286 /* Nothrow pure functions whose pointer parameter(s) are all nonnull. */ |
287 DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_NONNULL, ATTR_PURE, ATTR_NULL, \ | |
288 ATTR_NOTHROW_NONNULL) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
289 /* Nothrow pure leaf functions whose pointer parameter(s) are all nonnull. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
290 DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_NONNULL_LEAF, ATTR_PURE, ATTR_NULL, \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
291 ATTR_NOTHROW_NONNULL_LEAF) |
0 | 292 /* Nothrow malloc functions whose pointer parameter(s) are all nonnull. */ |
293 DEF_ATTR_TREE_LIST (ATTR_MALLOC_NOTHROW_NONNULL, ATTR_MALLOC, ATTR_NULL, \ | |
294 ATTR_NOTHROW_NONNULL) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
295 /* Nothrow malloc leaf functions whose pointer parameter(s) are all nonnull. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
296 DEF_ATTR_TREE_LIST (ATTR_MALLOC_NOTHROW_NONNULL_LEAF, ATTR_MALLOC, ATTR_NULL, \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
297 ATTR_NOTHROW_NONNULL_LEAF) |
0 | 298 |
111 | 299 /* Construct a tree for the format attribute (and implicitly nonnull). */ |
0 | 300 #define DEF_FORMAT_ATTRIBUTE(TYPE, FA, VALUES) \ |
301 DEF_ATTR_TREE_LIST (ATTR_##TYPE##_##VALUES, ATTR_NULL, \ | |
302 ATTR_##TYPE, ATTR_LIST_##VALUES) \ | |
303 DEF_ATTR_TREE_LIST (ATTR_FORMAT_##TYPE##_##VALUES, ATTR_FORMAT, \ | |
304 ATTR_##TYPE##_##VALUES, ATTR_NONNULL_##FA) | |
111 | 305 |
306 /* Construct a tree for the format and nothrow attributes (format | |
307 implies nonnull). */ | |
0 | 308 #define DEF_FORMAT_ATTRIBUTE_NOTHROW(TYPE, FA, VALUES) \ |
309 DEF_ATTR_TREE_LIST (ATTR_##TYPE##_##VALUES, ATTR_NULL, \ | |
310 ATTR_##TYPE, ATTR_LIST_##VALUES) \ | |
311 DEF_ATTR_TREE_LIST (ATTR_FORMAT_##TYPE##_NOTHROW_##VALUES, ATTR_FORMAT,\ | |
312 ATTR_##TYPE##_##VALUES, ATTR_NOTHROW_NONNULL_##FA) | |
111 | 313 |
314 /* Construct one tree for the format attribute and another for the format | |
315 and nothrow attributes (in both cases format implies nonnull). */ | |
0 | 316 #define DEF_FORMAT_ATTRIBUTE_BOTH(TYPE, FA, VALUES) \ |
317 DEF_ATTR_TREE_LIST (ATTR_##TYPE##_##VALUES, ATTR_NULL, \ | |
318 ATTR_##TYPE, ATTR_LIST_##VALUES) \ | |
319 DEF_ATTR_TREE_LIST (ATTR_FORMAT_##TYPE##_##VALUES, ATTR_FORMAT, \ | |
320 ATTR_##TYPE##_##VALUES, ATTR_NONNULL_##FA) \ | |
321 DEF_ATTR_TREE_LIST (ATTR_FORMAT_##TYPE##_NOTHROW_##VALUES, ATTR_FORMAT,\ | |
322 ATTR_##TYPE##_##VALUES, ATTR_NOTHROW_NONNULL_##FA) | |
111 | 323 |
324 /* Construct a pair of trees for the nonnull attribute for the first | |
325 argument, plus format printf attribute (format implies nonnull): | |
326 the first ordinary and the second nothrow. */ | |
327 #define DEF_FORMAT_ATTRIBUTE_NONNULL(TYPE, FA, VALUES) \ | |
328 DEF_ATTR_TREE_LIST (ATTR_NONNULL_1_FORMAT_##TYPE##_##VALUES, \ | |
329 ATTR_FORMAT, ATTR_##TYPE##_##VALUES, \ | |
330 ATTR_NONNULL_1_##FA) \ | |
331 DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_1_FORMAT_##TYPE##_##VALUES, \ | |
332 ATTR_FORMAT, ATTR_##TYPE##_##VALUES, \ | |
333 ATTR_NOTHROW_NONNULL_1_##FA) | |
334 | |
0 | 335 DEF_FORMAT_ATTRIBUTE(PRINTF,1,1_0) |
336 DEF_FORMAT_ATTRIBUTE(PRINTF,1,1_2) | |
337 DEF_FORMAT_ATTRIBUTE_BOTH(PRINTF,2,2_0) | |
338 DEF_FORMAT_ATTRIBUTE_BOTH(PRINTF,2,2_3) | |
339 DEF_FORMAT_ATTRIBUTE_BOTH(PRINTF,3,3_0) | |
340 DEF_FORMAT_ATTRIBUTE_BOTH(PRINTF,3,3_4) | |
341 DEF_FORMAT_ATTRIBUTE_NOTHROW(PRINTF,4,4_0) | |
342 DEF_FORMAT_ATTRIBUTE_NOTHROW(PRINTF,4,4_5) | |
343 DEF_FORMAT_ATTRIBUTE_NOTHROW(PRINTF,5,5_0) | |
344 DEF_FORMAT_ATTRIBUTE_NOTHROW(PRINTF,5,5_6) | |
111 | 345 |
346 /* Attributes for fprintf(f, f, va). */ | |
347 DEF_FORMAT_ATTRIBUTE_NONNULL(PRINTF,1,1_2) | |
348 /* Attributes for v{f,s}printf(d, f, va). vsprintf is nothrow, vfprintf | |
349 is not. */ | |
350 DEF_FORMAT_ATTRIBUTE_NONNULL(PRINTF,2,2_0) | |
351 /* Attributes for {f,s}printf(d, f, ...). sprintf is nothrow, fprintf | |
352 is not. */ | |
353 DEF_FORMAT_ATTRIBUTE_NONNULL(PRINTF,2,2_3) | |
354 /* Attributes for vprintf_chk. */ | |
355 DEF_FORMAT_ATTRIBUTE_NONNULL(PRINTF,3,3_0) | |
356 /* Attributes for printf_chk. */ | |
357 DEF_FORMAT_ATTRIBUTE_NONNULL(PRINTF,3,3_4) | |
358 /* Attributes for v{f,s}printf_chk(d, t, bos, f, va). vsprintf_chk is | |
359 nothrow, vfprintf_chk is not. */ | |
360 DEF_FORMAT_ATTRIBUTE_NONNULL(PRINTF,4,4_0) | |
361 /* Attributes for {f,s}printf_chk(d, t, bos, f, ...). sprintf_chk is | |
362 nothrow, fprintf_chk is not. */ | |
363 DEF_FORMAT_ATTRIBUTE_NONNULL(PRINTF,4,4_5) | |
364 | |
0 | 365 DEF_FORMAT_ATTRIBUTE(SCANF,1,1_0) |
366 DEF_FORMAT_ATTRIBUTE(SCANF,1,1_2) | |
367 DEF_FORMAT_ATTRIBUTE_BOTH(SCANF,2,2_0) | |
368 DEF_FORMAT_ATTRIBUTE_BOTH(SCANF,2,2_3) | |
369 DEF_FORMAT_ATTRIBUTE_NOTHROW(STRFTIME,3,3_0) | |
370 DEF_FORMAT_ATTRIBUTE_NOTHROW(STRFMON,3,3_4) | |
371 #undef DEF_FORMAT_ATTRIBUTE | |
372 #undef DEF_FORMAT_ATTRIBUTE_NOTHROW | |
373 #undef DEF_FORMAT_ATTRIBUTE_BOTH | |
374 | |
111 | 375 /* Transactional memory variants of the above. */ |
376 | |
377 DEF_ATTR_TREE_LIST (ATTR_TM_NOTHROW_LIST, | |
378 ATTR_TM_REGPARM, ATTR_NULL, ATTR_NOTHROW_LIST) | |
379 DEF_ATTR_TREE_LIST (ATTR_TM_TMPURE_NOTHROW_LIST, | |
380 ATTR_TM_TMPURE, ATTR_NULL, ATTR_TM_NOTHROW_LIST) | |
381 DEF_ATTR_TREE_LIST (ATTR_TM_PURE_TMPURE_NOTHROW_LIST, | |
382 ATTR_PURE, ATTR_NULL, ATTR_TM_TMPURE_NOTHROW_LIST) | |
383 DEF_ATTR_TREE_LIST (ATTR_TM_NORETURN_NOTHROW_LIST, | |
384 ATTR_TM_REGPARM, ATTR_NULL, ATTR_NORETURN_NOTHROW_LIST) | |
385 DEF_ATTR_TREE_LIST (ATTR_TM_CONST_NOTHROW_LIST, | |
386 ATTR_TM_REGPARM, ATTR_NULL, ATTR_CONST_NOTHROW_LIST) | |
387 DEF_ATTR_TREE_LIST (ATTR_TM_NOTHROW_RT_LIST, | |
388 ATTR_RETURNS_TWICE, ATTR_NULL, ATTR_TM_NOTHROW_LIST) | |
389 | |
390 /* Same attributes used for BUILT_IN_MALLOC except with TM_PURE thrown in. */ | |
391 DEF_ATTR_TREE_LIST (ATTR_TMPURE_MALLOC_NOTHROW_LIST, | |
392 ATTR_TM_TMPURE, ATTR_NULL, ATTR_MALLOC_NOTHROW_LIST) | |
393 /* Same attributes used for BUILT_IN_FREE except with TM_PURE thrown in. */ | |
394 DEF_ATTR_TREE_LIST (ATTR_TMPURE_NOTHROW_LIST, | |
395 ATTR_TM_TMPURE, ATTR_NULL, ATTR_NOTHROW_LIST) | |
396 | |
397 DEF_ATTR_TREE_LIST (ATTR_TMPURE_NOTHROW_LEAF_LIST, | |
398 ATTR_TM_TMPURE, ATTR_NULL, ATTR_NOTHROW_LEAF_LIST) | |
399 DEF_ATTR_TREE_LIST (ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST, | |
400 ATTR_TM_TMPURE, ATTR_NULL, ATTR_NORETURN_NOTHROW_LEAF_LIST) | |
401 DEF_ATTR_TREE_LIST (ATTR_TMPURE_NORETURN_NOTHROW_LEAF_COLD_LIST, | |
402 ATTR_COLD, ATTR_NULL, | |
403 ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST) | |
404 | |
0 | 405 /* Construct a tree for a format_arg attribute. */ |
406 #define DEF_FORMAT_ARG_ATTRIBUTE(FA) \ | |
407 DEF_ATTR_TREE_LIST (ATTR_FORMAT_ARG_##FA, ATTR_FORMAT_ARG, \ | |
408 ATTR_LIST_##FA, ATTR_NOTHROW_NONNULL_##FA) | |
409 DEF_FORMAT_ARG_ATTRIBUTE(1) | |
410 DEF_FORMAT_ARG_ATTRIBUTE(2) | |
411 #undef DEF_FORMAT_ARG_ATTRIBUTE | |
412 |