jgorbe added a comment.
This is the first step towards something like this big diff:
https://reviews.llvm.org/differential/diff/457740/. It's a pretty simple patch,
but I would like some feedback about whether you think it's going in the right
direction or I should do something else instead.
Here's some more context for that diff linked above. There is, as you could
expect, some amount of plumbing so that at callback matching time we have
around pointers to the script interpreter, the type of the value, etc, and we
can call the callback. But the biggest problem I've found is that there's some
logic that is duplicated for each one of {exact, regex} AND for each kind of
formatter (summaries, synthetic child providers...). An example of this is
`TypeCategoryImpl::AnyMatches`. Adding a new matching strategy ({exact, regex,
callback}) makes the combinatorial problem even worse. So a big chunk of that
patch is moving stuff around to try to minimize this problem.
The main refactoring is replacing the existing `FormatterContainerPair` (that
has two members that contain exact match formatters and regex formatters,
respectively) with a `TieredFormatterContainer` which has an array of
containers in priority order. The idea is to sink as much of duplicated logic
as possible around `TypeCategoryImpl` (for example, `GetFormatAtIndex`,
`GetSummaryAtIndex`, `GetFilterAtIndex`...) into this
`TieredFormatterContainer` to reuse the implementation.
I hope this helps understand the general idea a bit better.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133240/new/
https://reviews.llvm.org/D133240
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits