From 03e8e60e367d0d225f9aff869ee3d6a3e2aee9f2 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 26 Aug 2016 00:41:59 +0000 Subject: [PATCH] Sort list of driver-known file extensions. It was previously approximately ordered by length then alphabetically; apply that order consistently. llvm-svn: 279799 --- clang/lib/Driver/Types.cpp | 50 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/clang/lib/Driver/Types.cpp b/clang/lib/Driver/Types.cpp index f8e1e40..e6072de 100644 --- a/clang/lib/Driver/Types.cpp +++ b/clang/lib/Driver/Types.cpp @@ -156,55 +156,55 @@ bool types::isCuda(ID Id) { types::ID types::lookupTypeForExtension(const char *Ext) { return llvm::StringSwitch(Ext) .Case("c", TY_C) + .Case("C", TY_CXX) + .Case("F", TY_Fortran) + .Case("f", TY_PP_Fortran) + .Case("h", TY_CHeader) + .Case("H", TY_CXXHeader) .Case("i", TY_PP_C) .Case("m", TY_ObjC) .Case("M", TY_ObjCXX) - .Case("h", TY_CHeader) - .Case("C", TY_CXX) - .Case("H", TY_CXXHeader) - .Case("f", TY_PP_Fortran) - .Case("F", TY_Fortran) - .Case("s", TY_PP_Asm) - .Case("asm", TY_PP_Asm) - .Case("S", TY_Asm) .Case("o", TY_Object) - .Case("obj", TY_Object) - .Case("lib", TY_Object) - .Case("ii", TY_PP_CXX) - .Case("mi", TY_PP_ObjC) - .Case("mm", TY_ObjCXX) + .Case("S", TY_Asm) + .Case("s", TY_PP_Asm) .Case("bc", TY_LLVM_BC) .Case("cc", TY_CXX) .Case("CC", TY_CXX) .Case("cl", TY_CL) .Case("cp", TY_CXX) .Case("cu", TY_CUDA) - .Case("cui", TY_PP_CUDA) .Case("hh", TY_CXXHeader) + .Case("ii", TY_PP_CXX) .Case("ll", TY_LLVM_IR) - .Case("hpp", TY_CXXHeader) - .Case("ads", TY_Ada) + .Case("mi", TY_PP_ObjC) + .Case("mm", TY_ObjCXX) + .Case("rs", TY_RenderScript) .Case("adb", TY_Ada) + .Case("ads", TY_Ada) + .Case("asm", TY_PP_Asm) .Case("ast", TY_AST) + .Case("cpp", TY_CXX) + .Case("CPP", TY_CXX) .Case("c++", TY_CXX) .Case("C++", TY_CXX) + .Case("cui", TY_PP_CUDA) .Case("cxx", TY_CXX) - .Case("cpp", TY_CXX) - .Case("CPP", TY_CXX) .Case("CXX", TY_CXX) + .Case("F90", TY_Fortran) + .Case("f90", TY_PP_Fortran) + .Case("F95", TY_Fortran) + .Case("f95", TY_PP_Fortran) .Case("for", TY_PP_Fortran) .Case("FOR", TY_PP_Fortran) .Case("fpp", TY_Fortran) .Case("FPP", TY_Fortran) - .Case("f90", TY_PP_Fortran) - .Case("f95", TY_PP_Fortran) - .Case("F90", TY_Fortran) - .Case("F95", TY_Fortran) + .Case("gch", TY_PCH) + .Case("hpp", TY_CXXHeader) + .Case("lib", TY_Object) .Case("mii", TY_PP_ObjCXX) - .Case("pcm", TY_ModuleFile) + .Case("obj", TY_Object) .Case("pch", TY_PCH) - .Case("gch", TY_PCH) - .Case("rs", TY_RenderScript) + .Case("pcm", TY_ModuleFile) .Default(TY_INVALID); } -- 2.7.4