clang  6.0.0svn
LangStandards.cpp
Go to the documentation of this file.
1 //===--- LangStandards.cpp - Language Standard Definitions ----------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
11 #include "llvm/ADT/StringSwitch.h"
12 #include "llvm/Support/ErrorHandling.h"
13 using namespace clang;
14 using namespace clang::frontend;
15 
16 #define LANGSTANDARD(id, name, lang, desc, features) \
17 static const LangStandard Lang_##id = { name, desc, features, InputKind::lang };
18 #include "clang/Frontend/LangStandards.def"
19 
21  switch (K) {
22  case lang_unspecified:
23  llvm::report_fatal_error("getLangStandardForKind() on unspecified kind");
24 #define LANGSTANDARD(id, name, lang, desc, features) \
25  case lang_##id: return Lang_##id;
26 #include "clang/Frontend/LangStandards.def"
27  }
28  llvm_unreachable("Invalid language kind!");
29 }
30 
32  Kind K = llvm::StringSwitch<Kind>(Name)
33 #define LANGSTANDARD(id, name, lang, desc, features) \
34  .Case(name, lang_##id)
35 #include "clang/Frontend/LangStandards.def"
36  .Default(lang_unspecified);
37  if (K == lang_unspecified)
38  return nullptr;
39 
40  return &getLangStandardForKind(K);
41 }
42 
43 
LangStandard - Information about the properties of a particular language standard.
Definition: LangStandard.h:42
static const LangStandard & getLangStandardForKind(Kind K)
static const LangStandard * getLangStandardForName(StringRef Name)
Dataflow Directional Tag Classes.
#define LANGSTANDARD(id, name, lang, desc, features)