[all-commits] [llvm/llvm-project] f77f50: [DWARFLinker] Preserve module forward decls in par...
Jonas Devlieghere via All-commits
all-commits at lists.llvm.org
Tue Jun 2 13:02:24 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f77f5088145b008f17799487e07a92c66e749567
https://github.com/llvm/llvm-project/commit/f77f5088145b008f17799487e07a92c66e749567
Author: Jonas Devlieghere <jonas at devlieghere.com>
Date: 2026-06-02 (Tue, 02 Jun 2026)
Changed paths:
M llvm/lib/DWARFLinker/Parallel/DependencyTracker.cpp
A llvm/test/tools/dsymutil/Inputs/drop-module-fwd-decl/debug-map.map
A llvm/test/tools/dsymutil/Inputs/drop-module-fwd-decl/input.ll
A llvm/test/tools/dsymutil/Inputs/keep-module-fwd-decl-template/debug-map.map
A llvm/test/tools/dsymutil/Inputs/keep-module-fwd-decl-template/input.ll
A llvm/test/tools/dsymutil/X86/drop-module-fwd-decl.test
A llvm/test/tools/dsymutil/X86/keep-module-fwd-decl-template.test
M llvm/test/tools/dsymutil/X86/submodules.m
Log Message:
-----------
[DWARFLinker] Preserve module forward decls in parallel linker (#198828)
The parallel linker was dropping forward-declared types nested under
DW_TAG_module skeleton CUs (clang -gmodules input). The classic linker
keeps them when no definition exists and replaces them with the
canonical definition when one does. collectRootsToKeep's default branch
silently fell through, so the forward decl never made it to the
worklist.
Route these through the type pool with MarkTypeEntryRec. Recursive
marking keeps children of templated forward decls (e.g.
DW_TAG_template_type_parameter under Foo<T> [decl]) intact, matching the
classic linker. The existing decl-vs-def race resolution in
allocateTypeDie and getFinalDie handles both ends without new
synchronization.
- No definition anywhere. DeclarationDie is allocated and emitted.
- Definition in some other CU. allocateTypeDie sets Die via the body's
spinlock. At emission, getFinalDie returns Die over DeclarationDie. Both
clone orderings yield the same output.
For non-ODR languages getFinalPlacementForEntry forces PlainDwarf, so
the forward decl stays in place under its module instead of moving to
the artificial type unit.
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