[all-commits] [llvm/llvm-project] f97b61: [Driver][MSVC] Support DWARF fission when using LT...

HaohaiWen via All-commits all-commits at lists.llvm.org
Thu Jul 6 07:19:34 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f97b61ed27aa6b0cef21e86e71d683feab32ce34
  Author: Haohai Wen <haohai.wen at intel.com>
  Date:   2023-07-06 (Thu, 06 Jul 2023)

  Changed paths:
    M clang/lib/Driver/ToolChains/MSVC.cpp
    M clang/test/Driver/lto-dwo.c

  Log Message:
  [Driver][MSVC] Support DWARF fission when using LTO on Windows

D154070 has added /dwodir to lld/COFF to tells LTO backend to create dwo
directory and files. This patch makes clang to emit /dwodir to lld when
user specify -gsplit-dwarf with LTO. This behavior is simiar to DWARF
fission with LTO for ELF.

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

Reviewed By: mstorsjo, MaskRay, hans

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

More information about the All-commits mailing list