blob: bd916386056b5ce86058fb4488f31372bddd3c96 [file] [log] [blame]
Daniel Dunbarfbe2faf2009-11-13 02:06:12 +00001//===--- 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"
12using namespace clang;
13
14FrontendOptions::InputKind
15FrontendOptions::getInputKindForExtension(llvm::StringRef Extension) {
16 return llvm::StringSwitch<InputKind>(Extension)
17 .Case("ast", IK_AST)
18 .Case("c", IK_C)
19 .Cases("S", "s", IK_Asm)
20 .Case("i", IK_PreprocessedC)
21 .Case("ii", IK_PreprocessedCXX)
22 .Case("m", IK_ObjC)
23 .Case("mi", IK_PreprocessedObjC)
24 .Cases("mm", "M", IK_ObjCXX)
25 .Case("mii", IK_PreprocessedObjCXX)
26 .Case("C", IK_CXX)
27 .Cases("C", "cc", "cp", IK_CXX)
Nuno Lopes2059d992009-11-17 15:36:35 +000028 .Cases("cpp", "CPP", "c++", "cxx", "hpp", IK_CXX)
Daniel Dunbarfbe2faf2009-11-13 02:06:12 +000029 .Case("cl", IK_OpenCL)
30 .Default(IK_C);
31}