clang  10.0.0svn
FrontendOptions.cpp
Go to the documentation of this file.
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 
11 #include "llvm/ADT/StringSwitch.h"
12 
13 using namespace clang;
14 
16  return llvm::StringSwitch<InputKind>(Extension)
17  .Cases("ast", "pcm", InputKind(Language::Unknown, InputKind::Precompiled))
18  .Case("c", Language::C)
19  .Cases("S", "s", Language::Asm)
20  .Case("i", InputKind(Language::C).getPreprocessed())
21  .Case("ii", InputKind(Language::CXX).getPreprocessed())
22  .Case("cui", InputKind(Language::CUDA).getPreprocessed())
23  .Case("m", Language::ObjC)
24  .Case("mi", InputKind(Language::ObjC).getPreprocessed())
25  .Cases("mm", "M", Language::ObjCXX)
26  .Case("mii", InputKind(Language::ObjCXX).getPreprocessed())
27  .Cases("C", "cc", "cp", Language::CXX)
28  .Cases("cpp", "CPP", "c++", "cxx", "hpp", Language::CXX)
29  .Case("cppm", Language::CXX)
30  .Case("iim", InputKind(Language::CXX).getPreprocessed())
31  .Case("cl", Language::OpenCL)
32  .Case("cu", Language::CUDA)
33  .Cases("ll", "bc", Language::LLVM_IR)
34  .Default(Language::Unknown);
35 }
Languages that the frontend can parse and compile.
The kind of a file that we&#39;ve been handed as an input.
Dataflow Directional Tag Classes.
Assembly: we accept this only so that we can preprocess it.
LLVM IR: we accept this so that we can run the optimizer on it, and compile it to assembly or object ...
static InputKind getInputKindForExtension(StringRef Extension)
getInputKindForExtension - Return the appropriate input kind for a file extension.