Michael137 wrote: > 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.
Yup agreed, it's unrelated to templates. Re. Jim's comment, I meant the part about checking whether caching typedefs at all is a good idea. But making the cache per-target as you suggest seems like a good solution. 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