[clang] 76d9bc7 - Reland "Add support to -Wa,--version in clang""
Jian Cai via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 1 13:48:05 PDT 2021
Author: Jian Cai
Date: 2021-04-01T13:47:56-07:00
New Revision: 76d9bc72784d88f4dd57b9939e52c73739438af5
URL: https://github.com/llvm/llvm-project/commit/76d9bc72784d88f4dd57b9939e52c73739438af5
DIFF: https://github.com/llvm/llvm-project/commit/76d9bc72784d88f4dd57b9939e52c73739438af5.diff
LOG: Reland "Add support to -Wa,--version in clang""
This relands commit 3cc3c0f8352ec33ca2f2636f94cb1d85fc57ac16 with fixed
test cases, which was reverted by commit
bf2479c347c8ca88fefdb144d8bae0a7a4231e2a.
Added:
clang/test/Driver/as-version.s
Modified:
clang/lib/Driver/ToolChains/Clang.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index c9b44aa76b6b..ad5dca30e0f6 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -2552,6 +2552,8 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
// -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;
diff --git a/clang/test/Driver/as-version.s b/clang/test/Driver/as-version.s
new file mode 100644
index 000000000000..e9e66563942f
--- /dev/null
+++ b/clang/test/Driver/as-version.s
@@ -0,0 +1,5 @@
+// Test version information.
+
+// RUN: %clang -Wa,--version -c -fintegrated-as %s -o /dev/null \
+// RUN: | FileCheck --check-prefix=IAS %s
+// IAS: clang version
More information about the cfe-commits
mailing list