Skip to content

Conversation

ZequanWu
Copy link
Contributor

@ZequanWu ZequanWu commented Sep 2, 2025

#153160 created those function maps and uses default sort comparator which is not deterministic when there are multiple entries with same name because llvm::sort is unstable sort.

This fixes it by comparing the id value when tie happens and sort m_type_base_names deterministically as well.

@ZequanWu ZequanWu requested a review from Nerixyz September 2, 2025 20:45
Copy link
Contributor

@Nerixyz Nerixyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for noticing!

The type-name map uses the same map type and doesn't specify a comparator either. That could also use one to make FindType deterministic, I suppose.

@ZequanWu
Copy link
Contributor Author

ZequanWu commented Sep 2, 2025

The type-name map uses the same map type and doesn't specify a comparator either. That could also use one to make FindType deterministic, I suppose.

I updated to sort it deterministically as well.

@ZequanWu ZequanWu changed the title [lldb][NativePDB] Sort function name maps deterministically. [lldb][NativePDB] Sort function name and type basename maps deterministically. Sep 2, 2025
@ZequanWu ZequanWu enabled auto-merge (squash) September 2, 2025 21:18
@ZequanWu ZequanWu merged commit 2fc0e2c into llvm:main Sep 2, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants