[PATCH] D152785: [COFF] Support -gsplit-dwarf for COFF on Windows

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 20 23:54:49 PDT 2023


MaskRay added inline comments.


================
Comment at: clang/test/Driver/split-debug.c:55
 // RUN: %clang -### -c -target x86_64 -gsplit-dwarf=single -g -o %tfoo.o %s 2>&1 | FileCheck %s --check-prefix=SINGLE_WITH_FILENAME
+// RUN: %clang_cl -### -c --target x86_64-unknown-windows-msvc -gsplit-dwarf=single -g -o %tfoo.o %s 2>&1 | FileCheck %s --check-prefix=SINGLE_WITH_FILENAME
 
----------------



================
Comment at: clang/test/Driver/split-debug.c:19
 // RUN: %clang -### -c -target amdgcn-amd-amdhsa -gsplit-dwarf -g %s 2>&1 | FileCheck %s --check-prefix=SPLIT
+// RUN: %clang_cl -### -c -target x86_64-unknown-windows-msvc -gsplit-dwarf -g %s 2>&1 | FileCheck %s --check-prefix=SPLIT
 
----------------
MaskRay wrote:
> Use `--target=` for new tests. `-target ` has been deprecated since Clang 3.x
You can use `-gno-split-dwarf -gsplit-dwarf` to test `CoreOption` on `-gno-split-dwarf`.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:1895
+      if (RelocatedSection != Obj.section_end() && Name.contains(".dwo")) {
+        // Each section in COFF can directly contain relocations.
+        if (isa<COFFObjectFile>(&Obj) && Section.relocations().empty())
----------------
skan wrote:
> The comment is confusing according to line 1900. Could you refine it?
I'll change this to `ends_with(".dwo")` separately.

`check-llvm check-clang` passes even if I remove `if (isa<COFFObjectFile>(&Obj) && Section.relocations().empty()) continue`. What does it do?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152785/new/

https://reviews.llvm.org/D152785



More information about the cfe-commits mailing list