[PATCH] D114651: [clang-cl] Expose -Wall to clang-cl by unaliasing -Wall, keeping /Wall as alias to -Weverything
Sylvain Audi via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 26 10:22:32 PST 2021
saudi created this revision.
saudi added reviewers: rnk, hans.
saudi added a project: clang.
Herald added subscribers: jeroen.dobbelaere, dang.
saudi requested review of this revision.
Herald added a subscriber: cfe-commits.
Currently, for clang-cl, `-Wall` is treated identically as `/Wall` and is aliased to `-Weverything`.
This patch allows to expose `-Wall` to clang-cl while keeping the order of warning arguments, which the `-Xclang` alternative doesn't allow.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D114651
Files:
clang/include/clang/Driver/Options.td
clang/test/Driver/cl-options.c
Index: clang/test/Driver/cl-options.c
===================================================================
--- clang/test/Driver/cl-options.c
+++ clang/test/Driver/cl-options.c
@@ -266,9 +266,11 @@
// RUN: %clang_cl /W3 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s
// RUN: %clang_cl /W4 -### -- %s 2>&1 | FileCheck -check-prefix=W4 %s
// RUN: %clang_cl /Wall -### -- %s 2>&1 | FileCheck -check-prefix=Weverything %s
+// RUN: %clang_cl -Wall -### -- %s 2>&1 | FileCheck -check-prefix=Wall %s
// W1: -Wall
// W4: -WCL4
// Weverything: -Weverything
+// Wall: -Wall
// RUN: %clang_cl /WX -### -- %s 2>&1 | FileCheck -check-prefix=WX %s
// WX: -Werror
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -6152,7 +6152,8 @@
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 and -Wextra">, Alias<WCL4>;
-def _SLASH_Wall : CLFlag<"Wall">, HelpText<"Enable -Weverything">,
+def _SLASH_Wall : Option<["/"], "Wall", KIND_FLAG>, Group<cl_Group>,
+ Flags<[CLOption, NoXarchOption]>, HelpText<"Enable -Weverything">,
Alias<W_Joined>, AliasArgs<["everything"]>;
def _SLASH_WX : CLFlag<"WX">, HelpText<"Treat warnings as errors">,
Alias<W_Joined>, AliasArgs<["error"]>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114651.390088.patch
Type: text/x-patch
Size: 1466 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211126/00cae542/attachment-0001.bin>
More information about the cfe-commits
mailing list