clang  9.0.0
LangStandards.cpp
Go to the documentation of this file.
1 //===--- LangStandards.cpp - Language Standard Definitions ----------------===//
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 
10 #include "llvm/ADT/StringSwitch.h"
11 #include "llvm/Support/ErrorHandling.h"
12 using namespace clang;
13 using namespace clang::frontend;
14 
15 #define LANGSTANDARD(id, name, lang, desc, features) \
16 static const LangStandard Lang_##id = { name, desc, features, InputKind::lang };
17 #include "clang/Frontend/LangStandards.def"
18 
20  switch (K) {
21  case lang_unspecified:
22  llvm::report_fatal_error("getLangStandardForKind() on unspecified kind");
23 #define LANGSTANDARD(id, name, lang, desc, features) \
24  case lang_##id: return Lang_##id;
25 #include "clang/Frontend/LangStandards.def"
26  }
27  llvm_unreachable("Invalid language kind!");
28 }
29 
31  Kind K = llvm::StringSwitch<Kind>(Name)
32 #define LANGSTANDARD(id, name, lang, desc, features) \
33  .Case(name, lang_##id)
34 #include "clang/Frontend/LangStandards.def"
35  .Default(lang_unspecified);
36  if (K == lang_unspecified)
37  return nullptr;
38 
39  return &getLangStandardForKind(K);
40 }
41 
42 
LangStandard - Information about the properties of a particular language standard.
Definition: LangStandard.h:42
RangeSelector name(std::string ID)
Given a node with a "name", (like NamedDecl, DeclRefExpr or CxxCtorInitializer) selects the name&#39;s to...
static const LangStandard & getLangStandardForKind(Kind K)
static const LangStandard * getLangStandardForName(StringRef Name)
Dataflow Directional Tag Classes.
#define LANGSTANDARD(id, name, lang, desc, features)