[llvm] 6bcdcb3 - [DWARFLinker] Make synthetic type names deterministic under threading (#209553)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 19 13:58:38 PDT 2026
Author: Jonas Devlieghere
Date: 2026-07-19T15:58:34-05:00
New Revision: 6bcdcb39c57ea926d3082ec3ecae74bf59b4658e
URL: https://github.com/llvm/llvm-project/commit/6bcdcb39c57ea926d3082ec3ecae74bf59b4658e
DIFF: https://github.com/llvm/llvm-project/commit/6bcdcb39c57ea926d3082ec3ecae74bf59b4658e.diff
LOG: [DWARFLinker] Make synthetic type names deterministic under threading (#209553)
Added:
Modified:
llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.cpp
Removed:
################################################################################
diff --git a/llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.cpp b/llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.cpp
index b5be5d498ed3e..c3d8a2489de9a 100644
--- a/llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.cpp
+++ b/llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.cpp
@@ -405,10 +405,13 @@ Error SyntheticTypeNameBuilder::addDIETypeName(
// Check if DIE already has a name.
if (!TypeEntryPtr) {
size_t NameStart = SyntheticName.size();
- if (AssignNameToTypeDescriptor) {
- if (Error Err = addParentName(*UnitEntryPair))
- return Err;
- }
+ // Prepend the parent scope so this name matches the key the type is
+ // stored under in the pool (the getKey() branch below). Otherwise the
+ // same type gets
diff erent names depending on whether it already has a
+ // pool entry, which races under parallel assignment and breaks
+ // deterministic deduplication.
+ if (Error Err = addParentName(*UnitEntryPair))
+ return Err;
addTypePrefix(UnitEntryPair->DieEntry);
if (ChildIndex) {
More information about the llvm-commits
mailing list