Coverage Report

Created: 2020-11-24 06:42

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