10#include "clang/Config/config.h"
11#include "llvm/ADT/StringSwitch.h"
12#include "llvm/Support/ErrorHandling.h"
13#include "llvm/TargetParser/Triple.h"
18 case Language::Unknown:
22 case Language::LLVM_IR:
32 case Language::ObjCXX:
33 return "Objective-C++";
34 case Language::OpenCL:
36 case Language::OpenCLCXX:
40 case Language::RenderScript:
41 return "RenderScript";
48 llvm_unreachable(
"unhandled language kind");
51#define LANGSTANDARD(id, name, lang, desc, features) \
52 static const LangStandard Lang_##id = {name, desc, features, Language::lang};
53#include "clang/Basic/LangStandards.def"
58 llvm::report_fatal_error(
"getLangStandardForKind() on unspecified kind");
59#define LANGSTANDARD(id, name, lang, desc, features) \
60 case lang_##id: return Lang_##id;
61#include "clang/Basic/LangStandards.def"
63 llvm_unreachable(
"Invalid language kind!");
67 return llvm::StringSwitch<Kind>(Name)
68#define LANGSTANDARD(id, name, lang, desc, features) .Case(name, lang_##id)
69#define LANGSTANDARD_ALIAS(id, alias) .Case(alias, lang_##id)
70#include "clang/Basic/LangStandards.def"
75 return llvm::StringSwitch<LangStandard::Kind>(Name)
76 .Case(
"2016", LangStandard::lang_hlsl2016)
77 .Case(
"2017", LangStandard::lang_hlsl2017)
78 .Case(
"2018", LangStandard::lang_hlsl2018)
79 .Case(
"2021", LangStandard::lang_hlsl2021)
80 .Case(
"202x", LangStandard::lang_hlsl202x)
93 const llvm::Triple &
T) {
98 llvm_unreachable(
"Invalid input kind!");
100 return LangStandard::lang_opencl12;
102 return LangStandard::lang_openclcpp10;
107 return LangStandard::lang_gnu99;
108 return LangStandard::lang_gnu17;
110 return LangStandard::lang_gnu11;
115 return LangStandard::lang_gnucxx17;
117 return LangStandard::lang_c99;
119 return LangStandard::lang_hlsl2021;
121 llvm_unreachable(
"unhandled Language kind!");
The JSON file list parser is used to communicate input to InstallAPI.
LangStandard::Kind getDefaultLanguageStandard(clang::Language Lang, const llvm::Triple &T)
Language
The language for the input, used to select and validate the language standard and possible actions.
@ C
Languages that the frontend can parse and compile.
@ CIR
LLVM IR & CIR: we accept these so that we can run the optimizer on them, and compile them to assembly...
@ Asm
Assembly: we accept this only so that we can preprocess it.
StringRef languageToString(Language L)
const FunctionProtoType * T
LangStandard - Information about the properties of a particular language standard.
static const LangStandard * getLangStandardForName(StringRef Name)
static Kind getHLSLLangKind(StringRef Name)
static const LangStandard & getLangStandardForKind(Kind K)
static Kind getLangKind(StringRef Name)