r283257 - clang-cl: Use the .obj file extension also in LTO mode

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 4 14:01:02 PDT 2016


Author: hans
Date: Tue Oct  4 16:01:02 2016
New Revision: 283257

URL: http://llvm.org/viewvc/llvm-project?rev=283257&view=rev
Log:
clang-cl: Use the .obj file extension also in LTO mode

Modified:
    cfe/trunk/lib/Driver/Types.cpp
    cfe/trunk/test/Driver/cl-outputs.c

Modified: cfe/trunk/lib/Driver/Types.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Types.cpp?rev=283257&r1=283256&r2=283257&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Types.cpp (original)
+++ cfe/trunk/lib/Driver/Types.cpp Tue Oct  4 16:01:02 2016
@@ -53,12 +53,19 @@ types::ID types::getPrecompiledType(ID I
 }
 
 const char *types::getTypeTempSuffix(ID Id, bool CLMode) {
-  if (Id == TY_Object && CLMode)
-    return "obj";
-  if (Id == TY_Image && CLMode)
-    return "exe";
-  if (Id == TY_PP_Asm && CLMode)
-    return "asm";
+  if (CLMode) {
+    switch (Id) {
+    case TY_Object:
+    case TY_LTO_BC:
+      return "obj";
+    case TY_Image:
+      return "exe";
+    case TY_PP_Asm:
+      return "asm";
+    default:
+      break;
+    }
+  }
   return getInfo(Id).TempSuffix;
 }
 

Modified: cfe/trunk/test/Driver/cl-outputs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-outputs.c?rev=283257&r1=283256&r2=283257&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-outputs.c (original)
+++ cfe/trunk/test/Driver/cl-outputs.c Tue Oct  4 16:01:02 2016
@@ -2,6 +2,7 @@
 // command-line option, e.g. on Mac where %s is commonly under /Users.
 
 // RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=DEFAULT %s
+// RUN: %clang_cl /c -flto -### -- %s 2>&1 | FileCheck -check-prefix=DEFAULT %s
 // DEFAULT: "-o" "cl-outputs.obj"
 
 // RUN: %clang_cl /Fo -### -- %s 2>&1 | FileCheck -check-prefix=FoEMPTY %s




More information about the cfe-commits mailing list