| 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 | // C++ modes |
| 92 | LANGSTANDARD(cxx98, "c++98", |
| 93 | CXX, "ISO C++ 1998 with amendments", |
| 94 | LineComment | CPlusPlus | Digraphs) |
| 95 | LANGSTANDARD_ALIAS(cxx98, "c++03") |
| 96 | |
| 97 | LANGSTANDARD(gnucxx98, "gnu++98", |
| 98 | CXX, "ISO C++ 1998 with amendments and GNU extensions", |
| 99 | LineComment | CPlusPlus | Digraphs | GNUMode) |
| 100 | LANGSTANDARD_ALIAS(gnucxx98, "gnu++03") |
| 101 | |
| 102 | LANGSTANDARD(cxx11, "c++11", |
| 103 | CXX, "ISO C++ 2011 with amendments", |
| 104 | LineComment | CPlusPlus | CPlusPlus11 | Digraphs) |
| 105 | LANGSTANDARD_ALIAS_DEPR(cxx11, "c++0x") |
| 106 | |
| 107 | LANGSTANDARD(gnucxx11, "gnu++11", CXX, |
| 108 | "ISO C++ 2011 with amendments and GNU extensions", |
| 109 | LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode) |
| 110 | LANGSTANDARD_ALIAS_DEPR(gnucxx11, "gnu++0x") |
| 111 | |
| 112 | LANGSTANDARD(cxx14, "c++14", |
| 113 | CXX, "ISO C++ 2014 with amendments", |
| 114 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs) |
| 115 | LANGSTANDARD_ALIAS_DEPR(cxx14, "c++1y") |
| 116 | |
| 117 | LANGSTANDARD(gnucxx14, "gnu++14", |
| 118 | CXX, "ISO C++ 2014 with amendments and GNU extensions", |
| 119 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs | |
| 120 | GNUMode) |
| 121 | LANGSTANDARD_ALIAS_DEPR(gnucxx14, "gnu++1y") |
| 122 | |
| 123 | LANGSTANDARD(cxx17, "c++17", |
| 124 | CXX, "ISO C++ 2017 with amendments", |
| 125 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
| 126 | Digraphs | HexFloat) |
| 127 | LANGSTANDARD_ALIAS_DEPR(cxx17, "c++1z") |
| 128 | |
| 129 | LANGSTANDARD(gnucxx17, "gnu++17", |
| 130 | CXX, "ISO C++ 2017 with amendments and GNU extensions", |
| 131 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
| 132 | Digraphs | HexFloat | GNUMode) |
| 133 | LANGSTANDARD_ALIAS_DEPR(gnucxx17, "gnu++1z") |
| 134 | |
| 135 | LANGSTANDARD(cxx2a, "c++2a", |
| 136 | CXX, "Working draft for ISO C++ 2020", |
| 137 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
| 138 | CPlusPlus2a | Digraphs | HexFloat) |
| 139 | |
| 140 | LANGSTANDARD(gnucxx2a, "gnu++2a", |
| 141 | CXX, "Working draft for ISO C++ 2020 with GNU extensions", |
| 142 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | |
| 143 | CPlusPlus2a | Digraphs | HexFloat | GNUMode) |
| 144 | |
| 145 | // OpenCL |
| 146 | LANGSTANDARD(opencl10, "cl1.0", |
| 147 | OpenCL, "OpenCL 1.0", |
| 148 | LineComment | C99 | Digraphs | HexFloat | OpenCL) |
| 149 | LANGSTANDARD_ALIAS_DEPR(opencl10, "cl") |
| 150 | |
| 151 | LANGSTANDARD(opencl11, "cl1.1", |
| 152 | OpenCL, "OpenCL 1.1", |
| 153 | LineComment | C99 | Digraphs | HexFloat | OpenCL) |
| 154 | LANGSTANDARD(opencl12, "cl1.2", |
| 155 | OpenCL, "OpenCL 1.2", |
| 156 | LineComment | C99 | Digraphs | HexFloat | OpenCL) |
| 157 | LANGSTANDARD(opencl20, "cl2.0", |
| 158 | OpenCL, "OpenCL 2.0", |
| 159 | LineComment | C99 | Digraphs | HexFloat | OpenCL) |
| 160 | LANGSTANDARD(openclcpp, "c++", |
| 161 | OpenCL, "OpenCL C++ 1.0", |
| 162 | LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs | OpenCL) |
| 163 | |
| 164 | LANGSTANDARD_ALIAS_DEPR(opencl10, "CL") |
| 165 | LANGSTANDARD_ALIAS_DEPR(opencl11, "CL1.1") |
| 166 | LANGSTANDARD_ALIAS_DEPR(opencl12, "CL1.2") |
| 167 | LANGSTANDARD_ALIAS_DEPR(opencl20, "CL2.0") |
| 168 | |
| 169 | // CUDA |
| 170 | LANGSTANDARD(cuda, "cuda", CUDA, "NVIDIA CUDA(tm)", |
| 171 | LineComment | CPlusPlus | Digraphs) |
| 172 | |
| 173 | // HIP |
| 174 | LANGSTANDARD(hip, "hip", HIP, "HIP", |
| 175 | LineComment | CPlusPlus | Digraphs) |
| 176 | |
| 177 | #undef LANGSTANDARD |
| 178 | #undef LANGSTANDARD_ALIAS |
| 179 | #undef LANGSTANDARD_ALIAS_DEPR |
| 180 | |