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:
46 llvm_unreachable(
"unhandled language kind");
49#define LANGSTANDARD(id, name, lang, desc, features) \
50 static const LangStandard Lang_##id = {name, desc, features, Language::lang};
51#include "clang/Basic/LangStandards.def"
56 llvm::report_fatal_error(
"getLangStandardForKind() on unspecified kind");
57#define LANGSTANDARD(id, name, lang, desc, features) \
58 case lang_##id: return Lang_##id;
59#include "clang/Basic/LangStandards.def"
61 llvm_unreachable(
"Invalid language kind!");
65 return llvm::StringSwitch<Kind>(Name)
66#define LANGSTANDARD(id, name, lang, desc, features) .Case(name, lang_##id)
67#define LANGSTANDARD_ALIAS(id, alias) .Case(alias, lang_##id)
68#include "clang/Basic/LangStandards.def"
73 return llvm::StringSwitch<LangStandard::Kind>(Name)
74 .Case(
"2016", LangStandard::lang_hlsl2016)
75 .Case(
"2017", LangStandard::lang_hlsl2017)
76 .Case(
"2018", LangStandard::lang_hlsl2018)
77 .Case(
"2021", LangStandard::lang_hlsl2021)
78 .Case(
"202x", LangStandard::lang_hlsl202x)
79 .Case(
"202y", LangStandard::lang_hlsl202y)
92 const llvm::Triple &
T) {
97 llvm_unreachable(
"Invalid input kind!");
99 return LangStandard::lang_opencl12;
101 return LangStandard::lang_openclcpp10;
106 return LangStandard::lang_gnu99;
107 return LangStandard::lang_gnu17;
109 return LangStandard::lang_gnu11;
114 return LangStandard::lang_gnucxx17;
116 return LangStandard::lang_hlsl202x;
118 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)