clang 8.0.0

FrontendOptions.cpp
Go to the documentation of this file.
1 //===- FrontendOptions.cpp ------------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "clang/Frontend/FrontendOptions.h"
11 #include "llvm/ADT/StringSwitch.h"
12
13 using namespace clang;
14
15 InputKind FrontendOptions::getInputKindForExtension(StringRef Extension) {
16 return llvm::StringSwitch<InputKind>(Extension)
17 .Cases("ast", "pcm", InputKind(InputKind::Unknown, InputKind::Precompiled))
18 .Case("c", InputKind::C)
19 .Cases("S", "s", InputKind::Asm)
20 .Case("i", InputKind(InputKind::C).getPreprocessed())
21 .Case("ii", InputKind(InputKind::CXX).getPreprocessed())
22 .Case("cui", InputKind(InputKind::CUDA).getPreprocessed())
23 .Case("m", InputKind::ObjC)
24 .Case("mi", InputKind(InputKind::ObjC).getPreprocessed())
25 .Cases("mm", "M", InputKind::ObjCXX)
26 .Case("mii", InputKind(InputKind::ObjCXX).getPreprocessed())
27 .Cases("C", "cc", "cp", InputKind::CXX)
28 .Cases("cpp", "CPP", "c++", "cxx", "hpp", InputKind::CXX)
29 .Case("cppm", InputKind::CXX)
30 .Case("iim", InputKind(InputKind::CXX).getPreprocessed())
31 .Case("cl", InputKind::OpenCL)
32 .Case("cu", InputKind::CUDA)
33 .Cases("ll", "bc", InputKind::LLVM_IR)
34 .Default(InputKind::Unknown);
35 }
clang::InputKind::CXX
Definition: FrontendOptions.h:158
clang::InputKind::C
Languages that the frontend can parse and compile.
Definition: FrontendOptions.h:157
FrontendOptions.h
clang::InputKind::Unknown
Definition: FrontendOptions.h:147
clang::InputKind::Asm
Assembly: we accept this only so that we can preprocess it.
Definition: FrontendOptions.h:150
clang::InputKind::LLVM_IR
LLVM IR: we accept this so that we can run the optimizer on it, and compile it to assembly or object ...
Definition: FrontendOptions.h:154
clang::InputKind
The kind of a file that we&#39;ve been handed as an input.
Definition: FrontendOptions.h:137
clang::InputKind::Precompiled
Definition: FrontendOptions.h:172
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::InputKind::ObjC
Definition: FrontendOptions.h:159
clang::InputKind::OpenCL
Definition: FrontendOptions.h:161
clang::InputKind::ObjCXX
Definition: FrontendOptions.h:160
clang::InputKind::CUDA
Definition: FrontendOptions.h:162
clang::FrontendOptions::getInputKindForExtension
static InputKind getInputKindForExtension(StringRef Extension)
getInputKindForExtension - Return the appropriate input kind for a file extension.
Definition: FrontendOptions.cpp:15