[PATCH] D68884: Add support to -Wa,-W in clang
Jian Cai via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 11 13:14:41 PDT 2019
jcai19 created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
jcai19 added a reviewer: bcain.
jcai19 added subscribers: nickdesaulniers, manojgupta, llozano.
jcai19 updated this revision to Diff 224663.
jcai19 added a comment.
Fix typos.
Currently clang does not support -Wa,-W, which suppresses warning
messsages in GNUassebembler. Add this option for gcc compability.
https://bugs.llvm.org/show_bug.cgi?id=43651
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D68884
Files:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/as-w-option.c
Index: clang/test/Driver/as-w-option.c
===================================================================
--- /dev/null
+++ clang/test/Driver/as-w-option.c
@@ -0,0 +1,14 @@
+// RUN: %clang -### %s -c -o tmp.o -fno-integrated-as -Wa,-W 2>&1 | FileCheck -check-prefix=CHECK-NOIAS %s
+// RUN: %clang -### %s -c -o tmp.o -integrated-as -Wa,-W 2>&1 | FileCheck -check-prefix=CHECK-IAS %s
+// RUN: %clang %s -c -o %t.o -integrated-as -Wa,-W 2>&1 | FileCheck -allow-empty --check-prefix=CHECK-AS-NOWARN %s
+// RUN: %clang %s -c -o %t.o -fno-integrated-as -Wa,--no-warn 2>&1 | FileCheck -allow-empty --check-prefix=CHECK-AS-NOWARN %s
+// RUN: not %clang %s -c -o %t.o -integrated-as -Wa,--fatal-warnings 2>&1 | FileCheck --check-prefix=CHECK-AS-FATAL %s
+// RUN: not %clang %s -c -o %t.o -fno-integrated-as -Wa,--fatal-warnings 2>&1 | FileCheck --check-prefix=CHECK-AS-FATAL %s
+
+// CHECK-IAS: "-cc1" {{.*}} "-massembler-no-warn"
+// CHECK-NOIAS: "-W"
+// CHECK-AS-NOWARN-NOT: warning:
+// CHECK-AS-FATAL-NOT: warning:
+// CHECK-AS-FATAL: error
+
+__asm(".warning");
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -2229,7 +2229,7 @@
CmdArgs.push_back("-msave-temp-labels");
} else if (Value == "--fatal-warnings") {
CmdArgs.push_back("-massembler-fatal-warnings");
- } else if (Value == "--no-warn") {
+ } else if (Value == "--no-warn" || Value == "-W") {
CmdArgs.push_back("-massembler-no-warn");
} else if (Value == "--noexecstack") {
UseNoExecStack = true;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68884.224663.patch
Type: text/x-patch
Size: 1667 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191011/8427e732/attachment.bin>
More information about the cfe-commits
mailing list