clang  6.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 using namespace clang;
13 
15  return llvm::StringSwitch<InputKind>(Extension)
17  .Case("c", InputKind::C)
18  .Cases("S", "s", InputKind::Asm)
19  .Case("i", InputKind(InputKind::C).getPreprocessed())
20  .Case("ii", InputKind(InputKind::CXX).getPreprocessed())
21  .Case("cui", InputKind(InputKind::CUDA).getPreprocessed())
22  .Case("m", InputKind::ObjC)
23  .Case("mi", InputKind(InputKind::ObjC).getPreprocessed())
24  .Cases("mm", "M", InputKind::ObjCXX)
25  .Case("mii", InputKind(InputKind::ObjCXX).getPreprocessed())
26  .Cases("C", "cc", "cp", InputKind::CXX)
27  .Cases("cpp", "CPP", "c++", "cxx", "hpp", InputKind::CXX)
28  .Case("cppm", InputKind::CXX)
29  .Case("iim", InputKind(InputKind::CXX).getPreprocessed())
30  .Case("cl", InputKind::OpenCL)
31  .Case("cu", InputKind::CUDA)
32  .Cases("ll", "bc", InputKind::LLVM_IR)
33  .Default(InputKind::Unknown);
34 }
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.