[PATCH] D154070: [Driver][lld/COFF] Support DWARF fission when using LTO on Windows

Haohai, Wen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 29 05:20:37 PDT 2023


HaohaiWen created this revision.
Herald added subscribers: ormris, steven_wu, hiraditya, inglorion.
Herald added a project: All.
HaohaiWen requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.

This patch added /dwodir to lld/COFF which is equivalent to lld/ELF
option -plugin-opt=dwo_dir=. This option tells LTO backend to create
dwo directory and files and all dwo files will be in it. Otherwise all
dwarf sections will be embeded into image even if -gsplit-dwarf is
specified when using LTO.
For Driver, when user specify -gsplit-dwarf and LTO, /dwodir will be
automatically added.

A simple use case:
$clang-cl -c -flto -gdwarf main.c -o main.o
$clang-cl -c -flto -gdwarf a.c -o a.o
$clang-cl -flto -fuse-ld=lld -gdwarf -gsplit-dwarf main.o a.o

This'll generate a dwo file: main.exe_dwo/0.dwo


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154070

Files:
  clang/lib/Driver/ToolChains/MSVC.cpp
  clang/test/Driver/lto-dwo.c
  lld/COFF/Config.h
  lld/COFF/Driver.cpp
  lld/COFF/LTO.cpp
  lld/COFF/Options.td
  lld/test/COFF/lto-debug-fission.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154070.535737.patch
Type: text/x-patch
Size: 5521 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230629/b4343945/attachment.bin>


More information about the cfe-commits mailing list