r283258 - clang-cl: Make /Fo apply also when using -flto

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


Author: hans
Date: Tue Oct  4 16:01:04 2016
New Revision: 283258

URL: http://llvm.org/viewvc/llvm-project?rev=283258&view=rev
Log:
clang-cl: Make /Fo apply also when using -flto

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

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=283258&r1=283257&r2=283258&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Tue Oct  4 16:01:04 2016
@@ -2807,7 +2807,7 @@ const char *Driver::GetNamedOutputPath(C
   // Determine what the derived output name should be.
   const char *NamedOutput;
 
-  if (JA.getType() == types::TY_Object &&
+  if ((JA.getType() == types::TY_Object || JA.getType() == types::TY_LTO_BC) &&
       C.getArgs().hasArg(options::OPT__SLASH_Fo, options::OPT__SLASH_o)) {
     // The /Fo or /o flag decides the object filename.
     StringRef Val =

Modified: cfe/trunk/test/Driver/cl-outputs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-outputs.c?rev=283258&r1=283257&r2=283258&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-outputs.c (original)
+++ cfe/trunk/test/Driver/cl-outputs.c Tue Oct  4 16:01:04 2016
@@ -9,6 +9,7 @@
 // FoEMPTY:  "-o" "cl-outputs.obj"
 
 // RUN: %clang_cl /Foa -### -- %s 2>&1 | FileCheck -check-prefix=FoNAME %s
+// RUN: %clang_cl /Foa -flto -### -- %s 2>&1 | FileCheck -check-prefix=FoNAME %s
 // FoNAME:  "-o" "a.obj"
 
 // RUN: %clang_cl /Foa.ext /Fob.ext -### -- %s 2>&1 | FileCheck -check-prefix=FoNAMEEXT %s




More information about the cfe-commits mailing list