Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/lib/Frontend/LangStandards.cpp
Line
Count
Source (jump to first uncovered line)
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
9
#include "clang/Frontend/LangStandard.h"
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
19
58.4k
const LangStandard &LangStandard::getLangStandardForKind(Kind K) {
20
58.4k
  switch (K) {
21
58.4k
  case lang_unspecified:
22
0
    llvm::report_fatal_error("getLangStandardForKind() on unspecified kind");
23
58.4k
#define LANGSTANDARD(id, name, lang, desc, features) \
24
58.4k
    case lang_##id: return Lang_##id;
25
58.4k
#include 
"clang/Frontend/LangStandards.def"116
26
58.4k
  }
27
58.4k
  
llvm_unreachable0
("Invalid language kind!");
28
58.4k
}
29
30
0
const LangStandard *LangStandard::getLangStandardForName(StringRef Name) {
31
0
  Kind K = llvm::StringSwitch<Kind>(Name)
32
0
#define LANGSTANDARD(id, name, lang, desc, features) \
33
0
    .Case(name, lang_##id)
34
0
#include "clang/Frontend/LangStandards.def"
35
0
    .Default(lang_unspecified);
36
0
  if (K == lang_unspecified)
37
0
    return nullptr;
38
0
39
0
  return &getLangStandardForKind(K);
40
0
}
41
42