Coverage Report

Created: 2022-07-16 07:03

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