[all-commits] [llvm/llvm-project] fd6d6a: MC: Refactor FT_Align fragments when linker relaxa...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Jul 20 00:56:16 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd6d6a7c8d4e2fb196bd3707dc4022a236089d9a
      https://github.com/llvm/llvm-project/commit/fd6d6a7c8d4e2fb196bd3707dc4022a236089d9a
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-07-20 (Sun, 20 Jul 2025)

  Changed paths:
    M llvm/include/llvm/MC/MCAsmBackend.h
    M llvm/lib/MC/MCAssembler.cpp
    M llvm/lib/MC/MCExpr.cpp
    M llvm/lib/MC/MCFragment.cpp
    M llvm/lib/MC/MCObjectStreamer.cpp
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.h
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h
    M llvm/test/MC/RISCV/Relocations/mc-dump.s

  Log Message:
  -----------
  MC: Refactor FT_Align fragments when linker relaxation is enabled

Previously, two MCAsmBackend hooks were used, with
shouldInsertFixupForCodeAlign calling getWriter().recordRelocation
directly, bypassing generic code.

This patch:

* Introduces MCAsmBackend::relaxAlign to replace the two hooks.
* Tracks padding size using VarContentEnd (content is ignored).
* Move setLinkerRelaxable from MCObjectStreamer::emitCodeAlignment to the backends.

Pull Request: https://github.com/llvm/llvm-project/pull/149465



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