Page MenuHomePhabricator

[lldb] Make CompleteTagDeclsScope completion order deterministic
ClosedPublic

Authored by teemperor on Jan 10 2020, 2:00 AM.

Details

Summary

We iterate over m_decls_to_complete to complete declarations. As
m_decls_to_complete is a set the iteration order can be non-deterministic.
The order is currently only non-deterministic when we have
a large set of decls that need to be completed (i.e. more than 32 decls,
as otherwise the SmallPtrSet is just a linear-searched list).

This doesn't really fix any specific bug or has any really observable
change in behavior as the order in which we import should not influence
any semantics. However the order we create decls/types is now always
deterministic which should make debugging easier.

Diff Detail

Event Timeline

teemperor created this revision.Jan 10 2020, 2:00 AM
teemperor set the repository for this revision to rLLDB LLDB.Jan 10 2020, 2:00 AM
teemperor edited the summary of this revision. (Show Details)Jan 10 2020, 2:00 AM
shafik accepted this revision.Jan 10 2020, 10:57 AM

This is a good change, we do see bugs that are sometimes not totally deterministic so this should hopefully reduce those.

This revision is now accepted and ready to land.Jan 10 2020, 10:57 AM
davide accepted this revision.Jan 10 2020, 11:05 AM
davide added a subscriber: davide.

LGTM

This revision was automatically updated to reflect the committed changes.