Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/lib/Frontend/FrontendOptions.cpp
Line
Count
Source
1
//===- FrontendOptions.cpp ------------------------------------------------===//
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/FrontendOptions.h"
10
#include "llvm/ADT/StringSwitch.h"
11
12
using namespace clang;
13
14
18.3k
InputKind FrontendOptions::getInputKindForExtension(StringRef Extension) {
15
18.3k
  return llvm::StringSwitch<InputKind>(Extension)
16
18.3k
    .Cases("ast", "pcm", InputKind(InputKind::Unknown, InputKind::Precompiled))
17
18.3k
    .Case("c", InputKind::C)
18
18.3k
    .Cases("S", "s", InputKind::Asm)
19
18.3k
    .Case("i", InputKind(InputKind::C).getPreprocessed())
20
18.3k
    .Case("ii", InputKind(InputKind::CXX).getPreprocessed())
21
18.3k
    .Case("cui", InputKind(InputKind::CUDA).getPreprocessed())
22
18.3k
    .Case("m", InputKind::ObjC)
23
18.3k
    .Case("mi", InputKind(InputKind::ObjC).getPreprocessed())
24
18.3k
    .Cases("mm", "M", InputKind::ObjCXX)
25
18.3k
    .Case("mii", InputKind(InputKind::ObjCXX).getPreprocessed())
26
18.3k
    .Cases("C", "cc", "cp", InputKind::CXX)
27
18.3k
    .Cases("cpp", "CPP", "c++", "cxx", "hpp", InputKind::CXX)
28
18.3k
    .Case("cppm", InputKind::CXX)
29
18.3k
    .Case("iim", InputKind(InputKind::CXX).getPreprocessed())
30
18.3k
    .Case("cl", InputKind::OpenCL)
31
18.3k
    .Case("cu", InputKind::CUDA)
32
18.3k
    .Cases("ll", "bc", InputKind::LLVM_IR)
33
18.3k
    .Default(InputKind::Unknown);
34
18.3k
}