[all-commits] [llvm/llvm-project] 46beea: [MC] Remove SectionKind from MCSection (#96067)

aengelke via All-commits all-commits at lists.llvm.org
Thu Jun 20 01:53:11 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 46beeaa3940ef8380ee99b9f666cd27b884f63e4
      https://github.com/llvm/llvm-project/commit/46beeaa3940ef8380ee99b9f666cd27b884f63e4
  Author: aengelke <engelke at in.tum.de>
  Date:   2024-06-20 (Thu, 20 Jun 2024)

  Changed paths:
    M llvm/include/llvm/MC/MCContext.h
    M llvm/include/llvm/MC/MCSection.h
    M llvm/include/llvm/MC/MCSectionCOFF.h
    M llvm/include/llvm/MC/MCSectionDXContainer.h
    M llvm/include/llvm/MC/MCSectionELF.h
    M llvm/include/llvm/MC/MCSectionGOFF.h
    M llvm/include/llvm/MC/MCSectionSPIRV.h
    M llvm/include/llvm/MC/MCSectionWasm.h
    M llvm/include/llvm/MC/MCSectionXCOFF.h
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    M llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
    M llvm/lib/MC/MCContext.cpp
    M llvm/lib/MC/MCObjectFileInfo.cpp
    M llvm/lib/MC/MCParser/COFFAsmParser.cpp
    M llvm/lib/MC/MCParser/COFFMasmParser.cpp
    M llvm/lib/MC/MCSection.cpp
    M llvm/lib/MC/MCSectionCOFF.cpp
    M llvm/lib/MC/MCSectionMachO.cpp
    M llvm/lib/MC/MCStreamer.cpp
    M llvm/lib/MC/WasmObjectWriter.cpp
    M llvm/lib/MC/WinCOFFObjectWriter.cpp
    M llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
    M llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXTargetStreamer.cpp
    M llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
    M llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp
    M llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp

  Log Message:
  -----------
  [MC] Remove SectionKind from MCSection (#96067)

There are only three actual uses of the section kind in MCSection:
isText(), XCOFF, and WebAssembly. Store isText() in the MCSection, and
store other info in the actual section variants where required.

ELF and COFF flags also encode all relevant information, so for these
two section variants, remove the SectionKind parameter entirely.

This allows to remove the string switch (which is unnecessary and
inaccurate) from createELFSectionImpl. This was introduced in
[D133456](https://reviews.llvm.org/D133456), but apparently, it was
never hit for non-writable sections anyway and the resulting kind was
never used.



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