When debugging a large program like clang and doing "frame variable *this", the ValueObject pretty printer is doing hundreds of scoped FindTypes lookups. The ones that take longest are the ones where the DWARFDeclContext ends in something like ::Iterator which produces many false positives that need to be filtered out *after* extracting the DIEs. This patch demonstrates a way to filter out false positives at the accerator table lookup step.
With this patch lldb clang-10 -o "b EmitFunctionStart" -o r -o "f 2" -o "fr v *this" -b -- ... goes from 5.6s -> 4.83s or wall clock 6.979s -> 5.99s.
There are probably other good heuristics, too, and I should also implement this for DWARF 5 debug_names.
This comment gives the impression that this heuristic only applies to std::vector, maybe reword it to make it clear that this is just an example?