[clang][driver] Disable non-functional --version option for clang -cc1
authorEmil Kieri <j.emil.kieri@gmail.com>
Fri, 25 Mar 2022 15:33:25 +0000 (16:33 +0100)
committerEmil Kieri <j.emil.kieri@gmail.com>
Fri, 25 Mar 2022 18:04:27 +0000 (19:04 +0100)
commit35b89bc24ca58d5b3a87578f69936afb26ef3b69
treeb003b85859e5c45130345381633a2d0ab4a5e446
parentb97f26083bd04ccbdd63b0c726e047496e5b847a
[clang][driver] Disable non-functional --version option for clang -cc1

This patch removes --version as a clang -cc1 option.
  clang --version
and
  clang --cc1 -version
remain valid. This behaviour is consistent with clang -cc1as.

Previously, clang -cc1 accepted both --version and -version, but
only -version was acted upon. The call
  clang -cc1 --version
stalled without any message: --version was an accepted option but
triggered no action, and the driver waited for standard input.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D122344
clang/include/clang/Driver/Options.td
clang/test/Frontend/unknown-arg.c