mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 12:56:06 +00:00

This option can be useful for end users who want to know why they ended up with a ton of different variants of the "std" module in their module cache. This problem should go away over time, as we reduce the need for module variants, but it will never go away entirely. llvm-svn: 178148
33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
//===--- FrontendOptions.cpp ----------------------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "clang/Frontend/FrontendOptions.h"
|
|
#include "llvm/ADT/StringSwitch.h"
|
|
using namespace clang;
|
|
|
|
InputKind FrontendOptions::getInputKindForExtension(StringRef Extension) {
|
|
return llvm::StringSwitch<InputKind>(Extension)
|
|
.Cases("ast", "pcm", IK_AST)
|
|
.Case("c", IK_C)
|
|
.Cases("S", "s", IK_Asm)
|
|
.Case("i", IK_PreprocessedC)
|
|
.Case("ii", IK_PreprocessedCXX)
|
|
.Case("m", IK_ObjC)
|
|
.Case("mi", IK_PreprocessedObjC)
|
|
.Cases("mm", "M", IK_ObjCXX)
|
|
.Case("mii", IK_PreprocessedObjCXX)
|
|
.Case("C", IK_CXX)
|
|
.Cases("C", "cc", "cp", IK_CXX)
|
|
.Cases("cpp", "CPP", "c++", "cxx", "hpp", IK_CXX)
|
|
.Case("cl", IK_OpenCL)
|
|
.Case("cu", IK_CUDA)
|
|
.Cases("ll", "bc", IK_LLVM_IR)
|
|
.Default(IK_C);
|
|
}
|