From b357d6f6ad15d3e9a3f36d26cf2dd6bf099019b2 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 23 Mar 2016 15:37:41 +0000 Subject: [PATCH] clang-cl: Don't warn about /Oy- being unused in 64-bit builds. 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 | 6 ++++++ test/Driver/cl-options.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/Driver/MSVCToolChain.cpp b/lib/Driver/MSVCToolChain.cpp index 0834be721e..e0552903ae 100644 --- a/lib/Driver/MSVCToolChain.cpp +++ b/lib/Driver/MSVCToolChain.cpp @@ -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; } diff --git a/test/Driver/cl-options.c b/test/Driver/cl-options.c index 3730ba287a..a3ecfecd6a 100644 --- a/test/Driver/cl-options.c +++ b/test/Driver/cl-options.c @@ -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 -- 2.40.0