[all-commits] [llvm/llvm-project] 46cd31: [Driver] Revert D139717 and add -Xparser/-Xcompile...

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Dec 22 12:51:32 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 46cd3127fe54ab51f813492017c5acdbeb1baf26
      https://github.com/llvm/llvm-project/commit/46cd3127fe54ab51f813492017c5acdbeb1baf26
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-12-22 (Thu, 22 Dec 2022)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    A clang/test/Driver/warn-Xparser.c
    R clang/test/Misc/warn-not-error-Xfoo.c

  Log Message:
  -----------
  [Driver] Revert D139717 and add -Xparser/-Xcompiler instead

Some macOS projects use -Xparser even if it leads to a
-Wunused-command-line-argument warning. It doesn't justify adding a broad Joined
`-X` (IgnoredGCCCompat) as GCC doesn't really support these arbitrary `-X`
options.

Note: `-Xcompiler foo` is a GNU libtool option, not a driver option.
It is misused by some ChromeOS packages (but not by Gentoo).
Keep it for a while.

It seems that GCC < 4.6 reports g++: unrecognized option '-Xfoo' but exit with 0.
GCC >= 4.6 reports g++: error: unrecognized option '-Xfoo' and exits with 1.
It never supports -Xcompiler or -Xparser, so `IgnoredGCCCompat` is not justified.

Differential Revision: https://reviews.llvm.org/D140224




More information about the All-commits mailing list