1 | //===-- LangStandards.def - Language Standard Data --------------*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #ifndef LANGSTANDARD |
10 | #error "LANGSTANDARD must be defined before including this file" |
11 | #endif |
12 | |
13 | /// LANGSTANDARD(IDENT, NAME, LANG, DESC, FEATURES) |
14 | /// |
15 | /// \param IDENT - The name of the standard as a C++ identifier. |
16 | /// \param NAME - The name of the standard. |
17 | /// \param LANG - The Language for which this is a standard. |
18 | /// \param DESC - A short description of the standard. |
19 | /// \param FEATURES - The standard features as flags, these are enums from the |
20 | /// clang::frontend namespace, which is assumed to be available. |
21 | |
22 | /// LANGSTANDARD_ALIAS(IDENT, ALIAS) |
23 | /// \param IDENT - The name of the standard as a C++ identifier. |
24 | /// \param ALIAS - The alias of the standard. |
25 | |
26 | /// LANGSTANDARD_ALIAS_DEPR(IDENT, ALIAS) |
27 | /// Same as LANGSTANDARD_ALIAS, but for a deprecated alias. |
28 | |
29 | #ifndef LANGSTANDARD_ALIAS |
30 | #define LANGSTANDARD_ALIAS(IDENT, ALIAS) |
31 | #endif |
32 | |
33 | #ifndef LANGSTANDARD_ALIAS_DEPR |
34 | #define LANGSTANDARD_ALIAS_DEPR(IDENT, ALIAS) LANGSTANDARD_ALIAS(IDENT, ALIAS) |
35 | #endif |
36 | |
37 | // C89-ish modes. |
38 | LANGSTANDARD(c89, "c89" , |
39 | C, "ISO C 1990" , 0) |
40 | LANGSTANDARD_ALIAS(c89, "c90" ) |
41 | LANGSTANDARD_ALIAS(c89, "iso9899:1990" ) |
42 | |
43 | LANGSTANDARD(c94, "iso9899:199409" , |
44 | C, "ISO C 1990 with amendment 1" , |
45 | Digraphs) |
46 | |
47 | LANGSTANDARD(gnu89, "gnu89" , |
48 | C, "ISO C 1990 with GNU extensions" , |
49 | LineComment | Digraphs | GNUMode) |
50 | LANGSTANDARD_ALIAS(gnu89, "gnu90" ) |
51 | |
52 | // C99-ish modes |
53 | LANGSTANDARD(c99, "c99" , |
54 | C, "ISO C 1999" , |
55 | LineComment | C99 | Digraphs | HexFloat) |
56 | LANGSTANDARD_ALIAS(c99, "iso9899:1999" ) |
57 | LANGSTANDARD_ALIAS_DEPR(c99, "c9x" ) |
58 | LANGSTANDARD_ALIAS_DEPR(c99, "iso9899:199x" ) |
59 | |
60 | LANGSTANDARD(gnu99, "gnu99" , |
61 | C, "ISO C 1999 with GNU extensions" , |
62 | LineComment | C99 | Digraphs | GNUMode | HexFloat) |
63 | LANGSTANDARD_ALIAS_DEPR(gnu99, "gnu9x" ) |
64 | |
65 | // C11 modes |
66 | LANGSTANDARD(c11, "c11" , |
67 | C, "ISO C 2011" , |
68 | LineComment | C99 | C11 | Digraphs | HexFloat) |
69 | LANGSTANDARD_ALIAS(c11, "iso9899:2011" ) |
70 | LANGSTANDARD_ALIAS_DEPR(c11, "c1x" ) |
71 | LANGSTANDARD_ALIAS_DEPR(c11, "iso9899:201x" ) |
72 | |
73 | LANGSTANDARD(gnu11, "gnu11" , |
74 | C, "ISO C 2011 with GNU extensions" , |
75 | LineComment | C99 | C11 | Digraphs | GNUMode | HexFloat) |
76 | LANGSTANDARD_ALIAS_DEPR(gnu11, "gnu1x" ) |
77 | |
78 | // C17 modes |
79 | LANGSTANDARD(c17, "c17" , |
80 | C, "ISO C 2017" , |
81 | LineComment | C99 | C11 | C17 | Digraphs | HexFloat) |
82 | LANGSTANDARD_ALIAS(c17, "iso9899:2017" ) |
83 | LANGSTANDARD_ALIAS(c17, "c18" ) |
84 | LANGSTANDARD_ALIAS(c17, "iso9899:2018" ) |
85 | LANGSTANDARD(gnu17, "gnu17" , |
86 | C, "ISO C 2017 with GNU extensions" , |
87 | LineComment | C99 | C11 | C17 | Digraphs | GNUMode | HexFloat) |
88 | LANGSTANDARD_ALIAS(gnu17, "gnu18" ) |
89 | |
90 | // C23 modes |
91 | LANGSTANDARD(c23, "c23" , |
92 | C, "Working Draft for ISO C23" , |
93 | LineComment | C99 | C11 | C17 | C23 | Digraphs | HexFloat) |
94 | LANGSTANDARD_ALIAS_DEPR(c23, "c2x" ) |
95 | LANGSTANDARD(gnu23, "gnu23" , |
96 | C, "Working Draft for ISO C23 with GNU extensions" , |
97 | LineComment | C99 | C11 | C17 | C23 | Digraphs | GNUMode | HexFloat) |
98 | LANGSTANDARD_ALIAS_DEPR(gnu23, "gnu2x" ) |
99 | // FIXME: Add the alias for iso9899:202* once we know the year ISO publishes |
100 | // the document (expected to be 2024). |
101 | |
102 | // C++ modes |
103 | LANGSTANDARD(cxx98, "c++98" , |
104 | CXX, "ISO C++ 1998 with amendments" , |
105 | LineComment | CPlusPlus | Digraphs) |
106 | LANGSTANDARD_ALIAS(cxx98, "c++03" ) |
107 | |
108 | LANGSTANDARD(gnucxx98, "gnu++98" , |
109 | CXX, "ISO C++ 1998 with amendments and GNU extensions" , |
110 | LineComment | CPlusPlus | Digraphs | GNUMode) |
111 | LANGSTANDARD_ALIAS(gnucxx98, "gnu++03" ) |
112 | |
113 | LANGSTANDARD(cxx11, "c++11" , |
114 | CXX, "ISO C++ 2011 with amendments" , |
115 | LineComment | CPlusPlus | CPlusPlus11 | Digraphs) |
116 | LANGSTANDARD_ALIAS_DEPR(cxx11, "c++0x" ) |
117 | |
118 | LANGSTANDARD(gnucxx11, "gnu++11" , CXX, |
119 | "ISO C++ 2011 with amendments and GNU extensions" , |
120 | LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode) |
121 | LANGSTANDARD_ALIAS_DEPR(gnucxx11, "gnu++0x" ) |
122 | |
123 | LANGSTANDARD(cxx14, "c++14" , |
124 | CXX, "ISO C++ 2014 with amendments" , |
125 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs) |
126 | LANGSTANDARD_ALIAS_DEPR(cxx14, "c++1y" ) |
127 | |
128 | LANGSTANDARD(gnucxx14, "gnu++14" , |
129 | CXX, "ISO C++ 2014 with amendments and GNU extensions" , |
130 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs | |
131 | GNUMode) |
132 | LANGSTANDARD_ALIAS_DEPR(gnucxx14, "gnu++1y" ) |
133 | |
134 | LANGSTANDARD(cxx17, "c++17" , |
135 | CXX, "ISO C++ 2017 with amendments" , |
136 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
137 | Digraphs | HexFloat) |
138 | LANGSTANDARD_ALIAS_DEPR(cxx17, "c++1z" ) |
139 | |
140 | LANGSTANDARD(gnucxx17, "gnu++17" , |
141 | CXX, "ISO C++ 2017 with amendments and GNU extensions" , |
142 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
143 | Digraphs | HexFloat | GNUMode) |
144 | LANGSTANDARD_ALIAS_DEPR(gnucxx17, "gnu++1z" ) |
145 | |
146 | LANGSTANDARD(cxx20, "c++20" , |
147 | CXX, "ISO C++ 2020 DIS" , |
148 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
149 | CPlusPlus20 | Digraphs | HexFloat) |
150 | LANGSTANDARD_ALIAS_DEPR(cxx20, "c++2a" ) |
151 | |
152 | LANGSTANDARD(gnucxx20, "gnu++20" , |
153 | CXX, "ISO C++ 2020 DIS with GNU extensions" , |
154 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
155 | CPlusPlus20 | Digraphs | HexFloat | GNUMode) |
156 | LANGSTANDARD_ALIAS_DEPR(gnucxx20, "gnu++2a" ) |
157 | |
158 | LANGSTANDARD(cxx23, "c++23" , |
159 | CXX, "ISO C++ 2023 DIS" , |
160 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
161 | CPlusPlus20 | CPlusPlus23 | Digraphs | HexFloat) |
162 | LANGSTANDARD_ALIAS_DEPR(cxx23, "c++2b" ) |
163 | |
164 | LANGSTANDARD(gnucxx23, "gnu++23" , |
165 | CXX, "ISO C++ 2023 DIS with GNU extensions" , |
166 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
167 | CPlusPlus20 | CPlusPlus23 | Digraphs | HexFloat | GNUMode) |
168 | LANGSTANDARD_ALIAS_DEPR(gnucxx23, "gnu++2b" ) |
169 | |
170 | LANGSTANDARD(cxx26, "c++2c" , |
171 | CXX, "Working draft for C++2c" , |
172 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
173 | CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | Digraphs | HexFloat) |
174 | LANGSTANDARD_ALIAS(cxx26, "c++26" ) |
175 | |
176 | LANGSTANDARD(gnucxx26, "gnu++2c" , |
177 | CXX, "Working draft for C++2c with GNU extensions" , |
178 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
179 | CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | Digraphs | HexFloat | GNUMode) |
180 | LANGSTANDARD_ALIAS(gnucxx26, "gnu++26" ) |
181 | |
182 | // OpenCL |
183 | LANGSTANDARD(opencl10, "cl1.0" , |
184 | OpenCL, "OpenCL 1.0" , |
185 | LineComment | C99 | Digraphs | HexFloat | OpenCL) |
186 | LANGSTANDARD_ALIAS_DEPR(opencl10, "cl" ) |
187 | |
188 | LANGSTANDARD(opencl11, "cl1.1" , |
189 | OpenCL, "OpenCL 1.1" , |
190 | LineComment | C99 | Digraphs | HexFloat | OpenCL) |
191 | LANGSTANDARD(opencl12, "cl1.2" , |
192 | OpenCL, "OpenCL 1.2" , |
193 | LineComment | C99 | Digraphs | HexFloat | OpenCL) |
194 | LANGSTANDARD(opencl20, "cl2.0" , |
195 | OpenCL, "OpenCL 2.0" , |
196 | LineComment | C99 | Digraphs | HexFloat | OpenCL) |
197 | LANGSTANDARD(opencl30, "cl3.0" , |
198 | OpenCL, "OpenCL 3.0" , |
199 | LineComment | C99 | Digraphs | HexFloat | OpenCL) |
200 | |
201 | LANGSTANDARD(openclcpp10, "clc++1.0" , |
202 | OpenCL, "C++ for OpenCL 1.0" , |
203 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
204 | Digraphs | HexFloat | OpenCL) |
205 | LANGSTANDARD_ALIAS(openclcpp10, "clc++" ) |
206 | |
207 | LANGSTANDARD(openclcpp2021, "clc++2021" , |
208 | OpenCL, "C++ for OpenCL 2021" , |
209 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
210 | Digraphs | HexFloat | OpenCL) |
211 | |
212 | LANGSTANDARD_ALIAS_DEPR(opencl10, "CL" ) |
213 | LANGSTANDARD_ALIAS_DEPR(opencl11, "CL1.1" ) |
214 | LANGSTANDARD_ALIAS_DEPR(opencl12, "CL1.2" ) |
215 | LANGSTANDARD_ALIAS_DEPR(opencl20, "CL2.0" ) |
216 | LANGSTANDARD_ALIAS_DEPR(opencl30, "CL3.0" ) |
217 | LANGSTANDARD_ALIAS_DEPR(openclcpp10, "CLC++" ) |
218 | LANGSTANDARD_ALIAS_DEPR(openclcpp10, "CLC++1.0" ) |
219 | LANGSTANDARD_ALIAS_DEPR(openclcpp2021, "CLC++2021" ) |
220 | |
221 | // HLSL |
222 | LANGSTANDARD(hlsl, "hlsl" , |
223 | HLSL, "High Level Shader Language" , |
224 | LineComment | HLSL | CPlusPlus ) |
225 | |
226 | LANGSTANDARD(hlsl2015, "hlsl2015" , |
227 | HLSL, "High Level Shader Language 2015" , |
228 | LineComment | HLSL | CPlusPlus ) |
229 | |
230 | LANGSTANDARD(hlsl2016, "hlsl2016" , |
231 | HLSL, "High Level Shader Language 2016" , |
232 | LineComment | HLSL | CPlusPlus ) |
233 | |
234 | LANGSTANDARD(hlsl2017, "hlsl2017" , |
235 | HLSL, "High Level Shader Language 2017" , |
236 | LineComment | HLSL | CPlusPlus ) |
237 | |
238 | LANGSTANDARD(hlsl2018, "hlsl2018" , |
239 | HLSL, "High Level Shader Language 2018" , |
240 | LineComment | HLSL | CPlusPlus ) |
241 | |
242 | LANGSTANDARD(hlsl2021, "hlsl2021" , |
243 | HLSL, "High Level Shader Language 2021" , |
244 | LineComment | HLSL | CPlusPlus ) |
245 | |
246 | LANGSTANDARD(hlsl202x, "hlsl202x" , |
247 | HLSL, "High Level Shader Language 202x" , |
248 | LineComment | HLSL | CPlusPlus | CPlusPlus11) |
249 | |
250 | |
251 | #undef LANGSTANDARD |
252 | #undef LANGSTANDARD_ALIAS |
253 | #undef LANGSTANDARD_ALIAS_DEPR |
254 | |