[all-commits] [llvm/llvm-project] 081afa: [Driver, X86] Ignore -mfpmath= for assembler input

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Aug 28 13:37:47 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 081afa3d04a4bc0d43c62b5b0e5a84f86a8a70ec
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-08-28 (Mon, 28 Aug 2023)

  Changed paths:
    M clang/lib/Driver/ToolChains/Arch/X86.cpp
    M clang/lib/Driver/ToolChains/Arch/X86.h
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    A clang/test/Driver/x86-mfpmath.c

  Log Message:
  [Driver,X86] Ignore -mfpmath= for assembler input

Some options are only claimed in AddX86TargetArgs/etc (called by
For assembler input, `Add*TargetArgs` is not called. If an option is
unclaimed, it either leads to a -Wunused-command-line-argument warning
or an error (if `TargetSpecific` is set)
// clang '-###' --target=x86_64 -mfpmath=sse -c a.s
clang: error: unsupported option '-mfpmath=sse' for target 'x86_64'

For -mfpmath=, it's actually claimed by RenderFloatingPointOptions,
which should be moved to AddARMTargetArgs/AddX86TargetArgs later
(non-AArch32-non-x86 targets give a frontend error).
This change is localized and similar to D153691, for release/17.x

Fix https://github.com/llvm/llvm-project/issues/65023

Reviewed By: thesamesam

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

More information about the All-commits mailing list