[all-commits] [llvm/llvm-project] 1b4159: [MC][AArch64][ARM][X86] Push target-dependent asse...

Jessica Clarke via All-commits all-commits at lists.llvm.org
Sun May 18 12:10:04 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1b41599cf8972abbf0d2ee7595dba78a4b158af0
      https://github.com/llvm/llvm-project/commit/1b41599cf8972abbf0d2ee7595dba78a4b158af0
  Author: Jessica Clarke <jrtc27 at jrtc27.com>
  Date:   2025-05-18 (Sun, 18 May 2025)

  Changed paths:
    M llvm/include/llvm/MC/MCAsmBackend.h
    M llvm/include/llvm/MC/MCAsmInfo.h
    M llvm/include/llvm/MC/MCDirectives.h
    M llvm/include/llvm/MC/MCELFStreamer.h
    M llvm/include/llvm/MC/MCStreamer.h
    M llvm/include/llvm/MC/MCWasmStreamer.h
    M llvm/include/llvm/MC/MCWinCOFFStreamer.h
    M llvm/lib/MC/MCAsmInfo.cpp
    M llvm/lib/MC/MCAsmStreamer.cpp
    M llvm/lib/MC/MCELFStreamer.cpp
    M llvm/lib/MC/MCMachOStreamer.cpp
    M llvm/lib/MC/MCNullStreamer.cpp
    M llvm/lib/MC/MCParser/DarwinAsmParser.cpp
    M llvm/lib/MC/MCStreamer.cpp
    M llvm/lib/MC/MCWasmStreamer.cpp
    M llvm/lib/MC/MCWinCOFFStreamer.cpp
    M llvm/lib/Object/RecordStreamer.h
    M llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
    M llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
    M llvm/lib/Target/ARM/ARMAsmPrinter.cpp
    M llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
    M llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
    M llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h
    M llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendDarwin.h
    M llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendELF.h
    M llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendWinCOFF.h
    M llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
    M llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
    M llvm/lib/Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp
    M llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
    M llvm/lib/Target/X86/MCTargetDesc/X86TargetStreamer.h
    M llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFTargetStreamer.cpp
    M llvm/lib/Target/X86/X86AsmPrinter.cpp
    M llvm/test/CodeGen/ARM/ldrd.ll
    M llvm/test/CodeGen/ARM/thumb-function-section-reloc.ll
    M llvm/test/CodeGen/Thumb/thumb-shrink-wrapping.ll
    M llvm/test/DebugInfo/ARM/header.ll
    M llvm/utils/UpdateTestChecks/asm.py

  Log Message:
  -----------
  [MC][AArch64][ARM][X86] Push target-dependent assembler flags into targets (#139844)

The .syntax unified directive and .codeX/.code X directives are, other
than some simple common printing code, exclusively implemented in the
targets themselves. Thus, remove the corresponding MCAF_* flags and
reimplement the directives solely within the targets. This avoids
exposing all targets to all other targets' flags.

Since MCAF_SubsectionsViaSymbols is all that remains, convert it to its
own function like other directives, simplifying its implementation.

Note that, on X86, we now always need a target streamer when parsing
assembly, as it's now used for directives that aren't COFF-specific. It
still does not however need to do anything when producing a non-COFF
object file, so this commit does not introduce any new target streamers.

There is some churn in test output, and corresponding UTC regex changes,
due to comments no longer being flushed by these various directives (and
EmitEOL is not exposed outside MCAsmStreamer.cpp so we couldn't do so
even if we wanted to), but that was a bit odd to be doing anyway.

This is motivated by Morello LLVM, which adds yet another assembler flag
to distinguish A64 and C64 instruction sets, but did not update every
switch and so emits warnings during the build. Rather than fix those
warnings it seems better to instead make the problem not exist in the
first place via this change.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list