r264163 - clang-cl: Don't warn about /Oy- being unused in 64-bit builds.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 23 08:37:41 PDT 2016


Author: nico
Date: Wed Mar 23 10:37:41 2016
New Revision: 264163

URL: http://llvm.org/viewvc/llvm-project?rev=264163&view=rev
Log:
clang-cl: Don't warn about /Oy- being unused in 64-bit builds.

http://reviews.llvm.org/D18392

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

Modified: cfe/trunk/lib/Driver/MSVCToolChain.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/MSVCToolChain.cpp?rev=264163&r1=264162&r2=264163&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/MSVCToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/MSVCToolChain.cpp Wed Mar 23 10:37:41 2016
@@ -702,6 +702,12 @@ static void TranslateOptArg(Arg *A, llvm
         else
           DAL.AddFlagArg(
               A, Opts.getOption(options::OPT_fno_omit_frame_pointer));
+      } else {
+        // Don't warn about /Oy- in 64-bit builds (where
+        // SupportsForcingFramePointer is false).  The flag having no effect
+        // there is a compiler-internal optimization, and people shouldn't have
+        // to special-case their build files for 64-bit clang-cl.
+        A->claim();
       }
       break;
     }

Modified: cfe/trunk/test/Driver/cl-options.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-options.c?rev=264163&r1=264162&r2=264163&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-options.c (original)
+++ cfe/trunk/test/Driver/cl-options.c Wed Mar 23 10:37:41 2016
@@ -123,13 +123,13 @@
 // PR24003: -momit-leaf-frame-pointer
 // PR24003: -Os
 
-// RUN: %clang_cl --target=i686-pc-win32 /Oy- /O2 -### -- %s 2>&1 | FileCheck -check-prefix=Oy_2 %s
+// RUN: %clang_cl --target=i686-pc-win32 -Werror /Oy- /O2 -### -- %s 2>&1 | FileCheck -check-prefix=Oy_2 %s
 // Oy_2: -momit-leaf-frame-pointer
 // Oy_2: -O2
 
-// RUN: %clang_cl /Zs /Oy -- %s 2>&1
+// RUN: %clang_cl /Zs -Werror /Oy -- %s 2>&1
 
-// RUN: %clang_cl --target=i686-pc-win32 /Oy- -### -- %s 2>&1 | FileCheck -check-prefix=Oy_ %s
+// RUN: %clang_cl --target=i686-pc-win32 -Werror /Oy- -### -- %s 2>&1 | FileCheck -check-prefix=Oy_ %s
 // Oy_: -mdisable-fp-elim
 
 // RUN: %clang_cl /Qvec -### -- %s 2>&1 | FileCheck -check-prefix=Qvec %s




More information about the cfe-commits mailing list