[all-commits] [llvm/llvm-project] a79995: [Driver] Allow warning for unclaimed TargetSpecifi...

Fangrui Song via All-commits all-commits at lists.llvm.org
Fri Jun 16 08:32:39 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a79995ca6004082774a87f7a58ab6be5343364b7
      https://github.com/llvm/llvm-project/commit/a79995ca6004082774a87f7a58ab6be5343364b7
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-06-16 (Fri, 16 Jun 2023)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/Arch/LoongArch.cpp
    M clang/lib/Driver/ToolChains/MinGW.cpp
    M llvm/include/llvm/Option/Arg.h
    M llvm/lib/Option/Arg.cpp

  Log Message:
  -----------
  [Driver] Allow warning for unclaimed TargetSpecific options

For unclaimed target-agnostic options, we can apply clang_ignored_gcc_optimization_f_Group
to accept but warn about them.
```
% clang -c -fexpensive-optimizations a.c
clang: warning: optimization flag '-fexpensive-optimizations' is not supported [-Wignored-optimization-argument]
```

For an unclaimed target-specific option, one target may want to accept but warn
about it. Add `llvm::opt::Arg::IgnoredTargetSpecific` to support this warning
need.

Close https://github.com/llvm/llvm-project/issues/63282

Reviewed By: mstorsjo

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




More information about the All-commits mailing list