[Lldb-commits] [lldb] b6b3fcd - [lldb] Don't iterate over a std::set<Type*> in SymbolFileDWARF::GetTypes to make it deterministic

Davide Italiano via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 2 15:47:14 PST 2020



> On Mar 2, 2020, at 15:44, Raphael “Teemperor” Isemann <teemperor at gmail.com> wrote:
> 
> I was just grepping for unordered data structures (e.g. ’std::set<‘) that use pointers/pointer-like objects (e.g. CompilerType with its operator<) and then reading the related code. Not sure if there is a good way to detect this stuff automatically. I guess we could have had a Clang plugin that creates a warning when code iterates over an unordered data structure that has a pointer-like type as a key (probably would cause a bunch of false-positives but if someone ran this on his own machine from time to time that would be enough I think).


I don’t think there’s a great way to detect this automatically, but I’m happy to hear because I was bitten by the problem several times.
I guess my question was more motivated by the curiosity than anything else. Good work.

—
D


More information about the lldb-commits mailing list