Coverage Report

Created: 2020-04-07 08:45

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