[llvm-branch-commits] [llvm] 2462eac - [DWARFLinker] Make synthetic type names deterministic under threading (#209553)
Douglas Yung via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jul 22 06:57:34 PDT 2026
Author: Jonas Devlieghere
Date: 2026-07-22T13:57:20Z
New Revision: 2462eac065b11a3283d2247af841f33c4c4be477
URL: https://github.com/llvm/llvm-project/commit/2462eac065b11a3283d2247af841f33c4c4be477
DIFF: https://github.com/llvm/llvm-project/commit/2462eac065b11a3283d2247af841f33c4c4be477.diff
LOG: [DWARFLinker] Make synthetic type names deterministic under threading (#209553)
(cherry picked from commit 6bcdcb39c57ea926d3082ec3ecae74bf59b4658e)
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-branch-commits
mailing list