[lldb] Don't iterate over a std::set<Type*> in SymbolFileDWARF::GetTypes to make...
authorRaphael Isemann <teemperor@gmail.com>
Mon, 2 Mar 2020 22:45:53 +0000 (14:45 -0800)
committerRaphael Isemann <teemperor@gmail.com>
Mon, 2 Mar 2020 23:03:45 +0000 (15:03 -0800)
commitb6b3fcdcb8cdfb887e26d27bee03b997d2d65888
tree18fd157bca5bdd017e3099bb33f8fea250806059
parent5565820e6e413d13d210c28850fc31ecfbb64202
[lldb] Don't iterate over a std::set<Type*> in SymbolFileDWARF::GetTypes to make it deterministic

Summary:
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.

Reviewers: JDevlieghere, aprantl

Reviewed By: JDevlieghere

Subscribers: mgrang, abidh, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D75481
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h