[PATCH] D99556: Add support to -Wa,--version in clang
Jian Cai via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 31 16:30:19 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
jcai19 marked an inline comment as done.
Closed by commit rG3cc3c0f8352e: Add support to -Wa,--version in clang (authored by jcai19).
Changed prior to commit:
https://reviews.llvm.org/D99556?vs=334315&id=334558#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99556/new/
https://reviews.llvm.org/D99556
Files:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/as-version.s
Index: clang/test/Driver/as-version.s
===================================================================
--- /dev/null
+++ clang/test/Driver/as-version.s
@@ -0,0 +1,9 @@
+// Test version information.
+
+// RUN: %clang -Wa,--version -c -fintegrated-as %s -o /dev/null \
+// RUN: | FileCheck --check-prefix=IAS %s
+// IAS: clang version
+
+// RUN: %clang -Wa,--version -c -fno-integrated-as %s -o /dev/null \
+// RUN: | FileCheck --check-prefix=GAS %s
+// GAS-NOT: clang
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.334558.patch
Type: text/x-patch
Size: 1056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210331/7f6df384/attachment.bin>
More information about the cfe-commits
mailing list