clang  8.0.0svn
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 
11 #include "llvm/ADT/StringSwitch.h"
12 
13 using namespace clang;
14 
16  return llvm::StringSwitch<InputKind>(Extension)
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 }
Languages that the frontend can parse and compile.
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 ...
The kind of a file that we&#39;ve been handed as an input.
Dataflow Directional Tag Classes.
static InputKind getInputKindForExtension(StringRef Extension)
getInputKindForExtension - Return the appropriate input kind for a file extension.