]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/clang/include/clang/Frontend/LangStandards.def
MFC r355940:
[FreeBSD/FreeBSD.git] / contrib / llvm-project / clang / include / clang / Frontend / LangStandards.def
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 InputKind::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 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",
40              ImplicitInt)
41 LANGSTANDARD_ALIAS(c89, "c90")
42 LANGSTANDARD_ALIAS(c89, "iso9899:1990")
43
44 LANGSTANDARD(c94, "iso9899:199409",
45              C, "ISO C 1990 with amendment 1",
46              Digraphs | ImplicitInt)
47
48 LANGSTANDARD(gnu89, "gnu89",
49              C, "ISO C 1990 with GNU extensions",
50              LineComment | Digraphs | GNUMode | ImplicitInt)
51 LANGSTANDARD_ALIAS(gnu89, "gnu90")
52
53 // C99-ish modes
54 LANGSTANDARD(c99, "c99",
55              C, "ISO C 1999",
56              LineComment | C99 | Digraphs | HexFloat)
57 LANGSTANDARD_ALIAS(c99, "iso9899:1999")
58 LANGSTANDARD_ALIAS_DEPR(c99, "c9x")
59 LANGSTANDARD_ALIAS_DEPR(c99, "iso9899:199x")
60
61 LANGSTANDARD(gnu99, "gnu99",
62              C, "ISO C 1999 with GNU extensions",
63              LineComment | C99 | Digraphs | GNUMode | HexFloat)
64 LANGSTANDARD_ALIAS_DEPR(gnu99, "gnu9x")
65
66 // C11 modes
67 LANGSTANDARD(c11, "c11",
68              C, "ISO C 2011",
69              LineComment | C99 | C11 | Digraphs | HexFloat)
70 LANGSTANDARD_ALIAS(c11, "iso9899:2011")
71 LANGSTANDARD_ALIAS_DEPR(c11, "c1x")
72 LANGSTANDARD_ALIAS_DEPR(c11, "iso9899:201x")
73
74 LANGSTANDARD(gnu11, "gnu11",
75              C, "ISO C 2011 with GNU extensions",
76              LineComment | C99 | C11 | Digraphs | GNUMode | HexFloat)
77 LANGSTANDARD_ALIAS_DEPR(gnu11, "gnu1x")
78
79 // C17 modes
80 LANGSTANDARD(c17, "c17",
81              C, "ISO C 2017",
82              LineComment | C99 | C11 | C17 | Digraphs | HexFloat)
83 LANGSTANDARD_ALIAS(c17, "iso9899:2017")
84 LANGSTANDARD_ALIAS(c17, "c18")
85 LANGSTANDARD_ALIAS(c17, "iso9899:2018")
86 LANGSTANDARD(gnu17, "gnu17",
87              C, "ISO C 2017 with GNU extensions",
88              LineComment | C99 | C11 | C17 | Digraphs | GNUMode | HexFloat)
89 LANGSTANDARD_ALIAS(gnu17, "gnu18")
90
91 // C2x modes
92 LANGSTANDARD(c2x, "c2x",
93              C, "Working Draft for ISO C2x",
94              LineComment | C99 | C11 | C17 | C2x | Digraphs | HexFloat)
95 LANGSTANDARD(gnu2x, "gnu2x",
96              C, "Working Draft for ISO C2x with GNU extensions",
97              LineComment | C99 | C11 | C17 | C2x | Digraphs | GNUMode | HexFloat)
98
99 // C++ modes
100 LANGSTANDARD(cxx98, "c++98",
101              CXX, "ISO C++ 1998 with amendments",
102              LineComment | CPlusPlus | Digraphs)
103 LANGSTANDARD_ALIAS(cxx98, "c++03")
104
105 LANGSTANDARD(gnucxx98, "gnu++98",
106              CXX, "ISO C++ 1998 with amendments and GNU extensions",
107              LineComment | CPlusPlus | Digraphs | GNUMode)
108 LANGSTANDARD_ALIAS(gnucxx98, "gnu++03")
109
110 LANGSTANDARD(cxx11, "c++11",
111              CXX, "ISO C++ 2011 with amendments",
112              LineComment | CPlusPlus | CPlusPlus11 | Digraphs)
113 LANGSTANDARD_ALIAS_DEPR(cxx11, "c++0x")
114
115 LANGSTANDARD(gnucxx11, "gnu++11", CXX,
116              "ISO C++ 2011 with amendments and GNU extensions",
117              LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode)
118 LANGSTANDARD_ALIAS_DEPR(gnucxx11, "gnu++0x")
119
120 LANGSTANDARD(cxx14, "c++14",
121              CXX, "ISO C++ 2014 with amendments",
122              LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs)
123 LANGSTANDARD_ALIAS_DEPR(cxx14, "c++1y")
124
125 LANGSTANDARD(gnucxx14, "gnu++14",
126              CXX, "ISO C++ 2014 with amendments and GNU extensions",
127              LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs |
128              GNUMode)
129 LANGSTANDARD_ALIAS_DEPR(gnucxx14, "gnu++1y")
130
131 LANGSTANDARD(cxx17, "c++17",
132              CXX, "ISO C++ 2017 with amendments",
133              LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
134              Digraphs | HexFloat)
135 LANGSTANDARD_ALIAS_DEPR(cxx17, "c++1z")
136
137 LANGSTANDARD(gnucxx17, "gnu++17",
138              CXX, "ISO C++ 2017 with amendments and GNU extensions",
139              LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
140              Digraphs | HexFloat | GNUMode)
141 LANGSTANDARD_ALIAS_DEPR(gnucxx17, "gnu++1z")
142
143 LANGSTANDARD(cxx2a, "c++2a",
144              CXX, "Working draft for ISO C++ 2020",
145              LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
146              CPlusPlus2a | Digraphs | HexFloat)
147
148 LANGSTANDARD(gnucxx2a, "gnu++2a",
149              CXX, "Working draft for ISO C++ 2020 with GNU extensions",
150              LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
151              CPlusPlus2a | Digraphs | HexFloat | GNUMode)
152
153 // OpenCL
154 LANGSTANDARD(opencl10, "cl1.0",
155              OpenCL, "OpenCL 1.0",
156              LineComment | C99 | Digraphs | HexFloat | OpenCL)
157 LANGSTANDARD_ALIAS_DEPR(opencl10, "cl")
158
159 LANGSTANDARD(opencl11, "cl1.1",
160              OpenCL, "OpenCL 1.1",
161              LineComment | C99 | Digraphs | HexFloat | OpenCL)
162 LANGSTANDARD(opencl12, "cl1.2",
163              OpenCL, "OpenCL 1.2",
164              LineComment | C99 | Digraphs | HexFloat | OpenCL)
165 LANGSTANDARD(opencl20, "cl2.0",
166              OpenCL, "OpenCL 2.0",
167              LineComment | C99 | Digraphs | HexFloat | OpenCL)
168 LANGSTANDARD(openclcpp, "clc++",
169              OpenCL, "C++ for OpenCL",
170              LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
171              Digraphs | HexFloat | OpenCL)
172
173 LANGSTANDARD_ALIAS_DEPR(opencl10, "CL")
174 LANGSTANDARD_ALIAS_DEPR(opencl11, "CL1.1")
175 LANGSTANDARD_ALIAS_DEPR(opencl12, "CL1.2")
176 LANGSTANDARD_ALIAS_DEPR(opencl20, "CL2.0")
177 LANGSTANDARD_ALIAS_DEPR(openclcpp, "CLC++")
178
179 // CUDA
180 LANGSTANDARD(cuda, "cuda", CUDA, "NVIDIA CUDA(tm)",
181              LineComment | CPlusPlus | Digraphs)
182
183 // HIP
184 LANGSTANDARD(hip, "hip", HIP, "HIP",
185              LineComment | CPlusPlus | Digraphs)
186
187 #undef LANGSTANDARD
188 #undef LANGSTANDARD_ALIAS
189 #undef LANGSTANDARD_ALIAS_DEPR