https://github.com/labath approved this pull request.

This looks good. The problem with caching is not related to this patch.

> For now i think I'll probably i'll reset the formatters in the teardown hook, 
> but @jimingham comment on #110767 might be a good follow-up:
> 
> > Since this is just an optimization, we should first prove to ourselves that 
> > failing to put one of these type names in the exact matches really makes 
> > enough difference to bother with a complex solution.  If the gains are some 
> > but not huge, some boneheaded solution like never caching anything where 
> > the from type has a '<' and a '>' is probably sufficient.

However, I don't see how templates are related to this. I think the same thing 
can happen if I have `using MyType = TypeA;` in one binary and `using MyType = 
TypeB;` in another. If I cache the formatter for TypeA as the formatter for 
`MyType` (because that's correct for one binary) and then use that in the other 
binary, things will blow up. Technically, even `TypeA` in one binary need not 
have anything to do with `TypeA` in the second one, but we currently don't have 
a way to say which version of TypeA we are trying to format.

I think my ideal solution would be to have the formatter cache be per-target. I 
like that because it opens the door to having data formatters be registered 
per-target, which then means you don't have to have uber-formatters which know 
how to format every version of some struct.

https://github.com/llvm/llvm-project/pull/147253
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to