teemperor created this revision. teemperor added reviewers: JDevlieghere, aprantl. Herald added subscribers: lldb-commits, abidh, mgrang. Herald added a project: LLDB. JDevlieghere accepted this revision. This revision is now accepted and ready to land. teemperor planned changes to this revision. teemperor added a comment.
Just realized that this should be `llvm::SetVector` not `UniqueVector` ... Currently `SymbolFileDWARF::TypeSet` is a typedef to a `std::set<Type *>`. In `SymbolFileDWARF::GetTypes` we iterate over a TypeSet variable when finding types so that logic is non-deterministic as it depends on the actual pointer address values. This patch changes the `TypeSet` to a `llvm::UniqueVector` which always iterates in the order in which we inserted the types into the list. Repository: rLLDB LLDB https://reviews.llvm.org/D75481 Files: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -17,6 +17,7 @@ #include <vector> #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/UniqueVector.h" #include "llvm/Support/Threading.h" #include "lldb/Core/UniqueCStringMap.h" @@ -439,7 +440,7 @@ bool FixupAddress(lldb_private::Address &addr); - typedef std::set<lldb_private::Type *> TypeSet; + typedef llvm::UniqueVector<lldb_private::Type *> TypeSet; void GetTypes(const DWARFDIE &die, dw_offset_t min_die_offset, dw_offset_t max_die_offset, uint32_t type_mask, Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -324,10 +324,8 @@ if (add_type) { const bool assert_not_being_parsed = true; Type *type = ResolveTypeUID(die, assert_not_being_parsed); - if (type) { - if (type_set.find(type) == type_set.end()) - type_set.insert(type); - } + if (type) + type_set.insert(type); } }
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -17,6 +17,7 @@ #include <vector> #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/UniqueVector.h" #include "llvm/Support/Threading.h" #include "lldb/Core/UniqueCStringMap.h" @@ -439,7 +440,7 @@ bool FixupAddress(lldb_private::Address &addr); - typedef std::set<lldb_private::Type *> TypeSet; + typedef llvm::UniqueVector<lldb_private::Type *> TypeSet; void GetTypes(const DWARFDIE &die, dw_offset_t min_die_offset, dw_offset_t max_die_offset, uint32_t type_mask, Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -324,10 +324,8 @@ if (add_type) { const bool assert_not_being_parsed = true; Type *type = ResolveTypeUID(die, assert_not_being_parsed); - if (type) { - if (type_set.find(type) == type_set.end()) - type_set.insert(type); - } + if (type) + type_set.insert(type); } }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits