[all-commits] [llvm/llvm-project] 3eee5a: [COFF] Support -gsplit-dwarf for COFF on Windows

HaohaiWen via All-commits all-commits at lists.llvm.org
Sat Jun 24 20:56:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3eee5aa528abd67bb6d057e25ce1980d0d38c445
      https://github.com/llvm/llvm-project/commit/3eee5aa528abd67bb6d057e25ce1980d0d38c445
  Author: Haohai Wen <haohai.wen at intel.com>
  Date:   2023-06-25 (Sun, 25 Jun 2023)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M clang/test/Driver/split-debug.c
    M llvm/include/llvm/MC/MCWinCOFFObjectWriter.h
    M llvm/lib/MC/MCAsmBackend.cpp
    M llvm/lib/MC/WinCOFFObjectWriter.cpp
    A llvm/test/DebugInfo/COFF/dwarf-headers.ll
    A llvm/test/DebugInfo/COFF/fission-cu.ll
    A llvm/test/DebugInfo/COFF/fission-sections.ll

  Log Message:
  -----------
  [COFF] Support -gsplit-dwarf for COFF on Windows

D152340 has split WinCOFFObjectWriter to WinCOFFWriter. This patch adds
another WinCOFFWriter as DwoWriter to write Dwo sections to dwo file.
Driver options are also updated accordingly to support -gsplit-dwarf in
CL mode.

e.g. $ clang-cl  -c -gdwarf -gsplit-dwarf foo.c

Like what -gsplit-dwarf did in ELF, using this option will create DWARF object
(.dwo) file. DWARF debug info is split between COFF object and DWARF object
file. It can reduce the executable file size especially for large project.

Reviewed By: skan, MaskRay

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




More information about the All-commits mailing list