Coverage Report

Created: 2021-06-15 06:44

/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
25.7k
InputKind FrontendOptions::getInputKindForExtension(StringRef Extension) {
16
25.7k
  return llvm::StringSwitch<InputKind>(Extension)
17
25.7k
      .Cases("ast", "pcm", InputKind(Language::Unknown, InputKind::Precompiled))
18
25.7k
      .Case("c", Language::C)
19
25.7k
      .Cases("S", "s", Language::Asm)
20
25.7k
      .Case("i", InputKind(Language::C).getPreprocessed())
21
25.7k
      .Case("ii", InputKind(Language::CXX).getPreprocessed())
22
25.7k
      .Case("cui", InputKind(Language::CUDA).getPreprocessed())
23
25.7k
      .Case("m", Language::ObjC)
24
25.7k
      .Case("mi", InputKind(Language::ObjC).getPreprocessed())
25
25.7k
      .Cases("mm", "M", Language::ObjCXX)
26
25.7k
      .Case("mii", InputKind(Language::ObjCXX).getPreprocessed())
27
25.7k
      .Cases("C", "cc", "cp", Language::CXX)
28
25.7k
      .Cases("cpp", "CPP", "c++", "cxx", "hpp", "hxx", Language::CXX)
29
25.7k
      .Case("cppm", Language::CXX)
30
25.7k
      .Case("iim", InputKind(Language::CXX).getPreprocessed())
31
25.7k
      .Case("cl", Language::OpenCL)
32
25.7k
      .Case("clcpp", Language::OpenCLCXX)
33
25.7k
      .Cases("cu", "cuh", Language::CUDA)
34
25.7k
      .Case("hip", Language::HIP)
35
25.7k
      .Cases("ll", "bc", Language::LLVM_IR)
36
25.7k
      .Default(Language::Unknown);
37
25.7k
}