[PATCH] D99556: Add support to -Wa,--version in clang
Jian Cai via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 29 18:05:37 PDT 2021
jcai19 created this revision.
jcai19 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Clang currently only supports -Wa,--version when -no-integrated-as is
used. This adds support to -Wa,--version with -integrated-as.
Link:
https://github.com/ClangBuiltLinux/linux/issues/1320
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D99556
Files:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/as-options.s
Index: clang/test/Driver/as-options.s
===================================================================
--- clang/test/Driver/as-options.s
+++ clang/test/Driver/as-options.s
@@ -34,6 +34,15 @@
// RUN: -Ifoo_dir -### 2>&1 \
// RUN: | FileCheck %s
+
+// Test version information.
+
+// RUN: %clang -Wa,--version -c -integrated-as %s -o /dev/null 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+
+// RUN: %clang -Wa,--version -c -no-integrated-as %s -o /dev/null 2>&1 \
+// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s
+
// CHECK: "-I" "foo_dir"
// Test that assembler options don't cause warnings when there's no assembler
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -2549,6 +2549,8 @@
// -fdebug-compilation-dir (without '=') here.
CmdArgs.push_back("-fdebug-compilation-dir");
CmdArgs.push_back(Value.data());
+ } else if (Value == "--version") {
+ D.PrintVersion(C, llvm::outs());
} else {
D.Diag(diag::err_drv_unsupported_option_argument)
<< A->getOption().getName() << Value;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99556.334027.patch
Type: text/x-patch
Size: 1254 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210330/edb2cd3c/attachment.bin>
More information about the cfe-commits
mailing list