]> granicus.if.org Git - clang/commitdiff
clang-cl: Don't warn about /Oy- being unused in 64-bit builds.
authorNico Weber <nicolasweber@gmx.de>
Wed, 23 Mar 2016 15:37:41 +0000 (15:37 +0000)
committerNico Weber <nicolasweber@gmx.de>
Wed, 23 Mar 2016 15:37:41 +0000 (15:37 +0000)
http://reviews.llvm.org/D18392

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264163 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/MSVCToolChain.cpp
test/Driver/cl-options.c

index 0834be721e155cd24599c23cbce8bd175760b3ea..e0552903aee0118265bfa08a5ecd55c95ea25cf0 100644 (file)
@@ -702,6 +702,12 @@ static void TranslateOptArg(Arg *A, llvm::opt::DerivedArgList &DAL,
         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;
     }
index 3730ba287ab01615a3efe7c8f7a2edbab733ad16..a3ecfecd6a55df5d3d4fa4ca2b38cfad927e9241 100644 (file)
 // 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