[all-commits] [llvm/llvm-project] 8d9d27: [Driver] Add -Xclang= as an alias for -Xclang

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Aug 8 19:05:39 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8d9d27db475943954fce00db47f8c9daf4dae600
      https://github.com/llvm/llvm-project/commit/8d9d27db475943954fce00db47f8c9daf4dae600
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-08-08 (Mon, 08 Aug 2022)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/test/Driver/disable-llvm.c

  Log Message:
  -----------
  [Driver] Add -Xclang= as an alias for -Xclang

Driver options taking a value typically use `=` as the separator, instead of a
space. Unfortunately many older driver options do not stick with the rule, but I
find -Xclang used a lot and will be convenient if -Xclang= exists.

For build systems using a string array instead of a string to indicate compiler options,
`["-Xclang=-foo"]` is more convenient than `["-Xclang", "-foo"]`.
If a tool wants to filter out -Xclang=-foo, it is trivial for the `=` form, but
complex for the space separated form.

Reviewed By: jhuber6

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




More information about the All-commits mailing list