r253678 - Revert r253582: "clang-cl: Make /W4 imply -Wall -Wextra (PR25563)"
Hans Wennborg via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 20 08:51:56 PST 2015
Author: hans
Date: Fri Nov 20 10:51:56 2015
New Revision: 253678
URL: http://llvm.org/viewvc/llvm-project?rev=253678&view=rev
Log:
Revert r253582: "clang-cl: Make /W4 imply -Wall -Wextra (PR25563)"
The patch expanded the flag *at the end*, breaking invocations like:
clang-cl /W4 -Wno-unused-parameter
Reverting for now.
Modified:
cfe/trunk/docs/UsersManual.rst
cfe/trunk/include/clang/Driver/CLCompatOptions.td
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/cl-options.c
Modified: cfe/trunk/docs/UsersManual.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/UsersManual.rst?rev=253678&r1=253677&r2=253678&view=diff
==============================================================================
--- cfe/trunk/docs/UsersManual.rst (original)
+++ cfe/trunk/docs/UsersManual.rst Fri Nov 20 10:51:56 2015
@@ -2173,7 +2173,7 @@ Execute ``clang-cl /?`` to see a list of
/W1 Enable -Wall
/W2 Enable -Wall
/W3 Enable -Wall
- /W4 Enable -Wall and -Wextra
+ /W4 Enable -Wall
/Wall Enable -Wall
/WX- Do not treat warnings as errors
/WX Treat warnings as errors
Modified: cfe/trunk/include/clang/Driver/CLCompatOptions.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CLCompatOptions.td?rev=253678&r1=253677&r2=253678&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CLCompatOptions.td (original)
+++ cfe/trunk/include/clang/Driver/CLCompatOptions.td Fri Nov 20 10:51:56 2015
@@ -115,12 +115,12 @@ def _SLASH_showIncludes : CLFlag<"showIn
Alias<show_includes>;
def _SLASH_U : CLJoinedOrSeparate<"U">, HelpText<"Undefine macro">,
MetaVarName<"<macro>">, Alias<U>;
-def _SLASH_W0 : CLFlag<"W0">, HelpText<"Disable all warnings">;
-def _SLASH_W1 : CLFlag<"W1">, HelpText<"Enable -Wall">;
-def _SLASH_W2 : CLFlag<"W2">, HelpText<"Enable -Wall">;
-def _SLASH_W3 : CLFlag<"W3">, HelpText<"Enable -Wall">;
-def _SLASH_W4 : CLFlag<"W4">, HelpText<"Enable -Wall and -Wextra">;
-def _SLASH_Wall : CLFlag<"Wall">, HelpText<"Enable -Wall">;
+def _SLASH_W0 : CLFlag<"W0">, HelpText<"Disable all warnings">, Alias<w>;
+def _SLASH_W1 : CLFlag<"W1">, HelpText<"Enable -Wall">, Alias<Wall>;
+def _SLASH_W2 : CLFlag<"W2">, HelpText<"Enable -Wall">, Alias<Wall>;
+def _SLASH_W3 : CLFlag<"W3">, HelpText<"Enable -Wall">, Alias<Wall>;
+def _SLASH_W4 : CLFlag<"W4">, HelpText<"Enable -Wall">, Alias<Wall>;
+def _SLASH_Wall : CLFlag<"Wall">, HelpText<"Enable -Wall">, Alias<Wall>;
def _SLASH_WX : CLFlag<"WX">, HelpText<"Treat warnings as errors">,
Alias<W_Joined>, AliasArgs<["error"]>;
def _SLASH_WX_ : CLFlag<"WX-">, HelpText<"Do not treat warnings as errors">,
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=253678&r1=253677&r2=253678&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Nov 20 10:51:56 2015
@@ -5684,26 +5684,6 @@ void Clang::AddClangCLArgs(const ArgList
else
CmdArgs.push_back("msvc");
}
-
- if (Arg *A =
- Args.getLastArg(options::OPT__SLASH_W0, options::OPT__SLASH_W1,
- options::OPT__SLASH_W2, options::OPT__SLASH_W3,
- options::OPT__SLASH_W4, options::OPT__SLASH_Wall)) {
- switch (A->getOption().getID()) {
- case options::OPT__SLASH_W0:
- CmdArgs.push_back("-w");
- break;
- case options::OPT__SLASH_W4:
- CmdArgs.push_back("-Wextra");
- // Fallthrough.
- case options::OPT__SLASH_W1:
- case options::OPT__SLASH_W2:
- case options::OPT__SLASH_W3:
- case options::OPT__SLASH_Wall:
- CmdArgs.push_back("-Wall");
- break;
- }
- }
}
visualstudio::Compiler *Clang::getCLFallback() const {
Modified: cfe/trunk/test/Driver/cl-options.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-options.c?rev=253678&r1=253677&r2=253678&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-options.c (original)
+++ cfe/trunk/test/Driver/cl-options.c Fri Nov 20 10:51:56 2015
@@ -173,15 +173,10 @@
// RUN: %clang_cl /W1 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
// RUN: %clang_cl /W2 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
// RUN: %clang_cl /W3 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
+// RUN: %clang_cl /W4 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
// RUN: %clang_cl /Wall -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
// W1: -Wall
-// RUN: %clang_cl /W4 -### -- %s 2>&1 | FileCheck -check-prefix=W4 %s
-// W4: -Wextra
-// W4: -Wall
-// RUN: %clang_cl /W4 /W1 -### -- %s 2>&1 | FileCheck -check-prefix=W4W1 %s
-// W4W1-NOT: -Wextra
-
// RUN: %clang_cl /WX -### -- %s 2>&1 | FileCheck -check-prefix=WX %s
// WX: -Werror
More information about the cfe-commits
mailing list