From ce2d749ed303a5523b9d948b2a7714f6a9732de5 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 23 Oct 2017 15:54:44 +0000 Subject: [PATCH] clang-cl: Expose --version. This is for consistency with lld-link, see https://reviews.llvm.org/D38972 Also give --version a help text so it shows up in --help / /? output (for both clang-cl and regular clang). llvm-svn: 316335 --- clang/include/clang/Driver/Options.td | 3 ++- clang/test/Driver/cl-options.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 9f61521..819dbff 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -2469,7 +2469,8 @@ def _rtlib : Separate<["--"], "rtlib">, Alias; def _serialize_diags : Separate<["-", "--"], "serialize-diagnostics">, Flags<[DriverOption]>, HelpText<"Serialize compiler diagnostics to a file">; // We give --version different semantics from -version. -def _version : Flag<["--"], "version">, Flags<[CC1Option]>; +def _version : Flag<["--"], "version">, Flags<[CoreOption, CC1Option]>, + HelpText<"Print version information">; def _signed_char : Flag<["--"], "signed-char">, Alias; def _std : Separate<["--"], "std">, Alias; def _stdlib : Separate<["--"], "stdlib">, Alias; diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c index 115b219..2435ba2 100644 --- a/clang/test/Driver/cl-options.c +++ b/clang/test/Driver/cl-options.c @@ -574,6 +574,7 @@ // RUN: -fstandalone-debug \ // RUN: -flimit-debug-info \ // RUN: -flto \ +// RUN: --version \ // RUN: -Werror /Zs -- %s 2>&1 -- 2.7.4