[Lldb-commits] [PATCH] D66398: 2/2: Fix `TestDataFormatterStdList` regression

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 19 08:21:02 PDT 2019

labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

I very much support getting rid of shared pointers, and for this is I am inclined to accept this. However, I don't think it was ever really intended to use the sorting order of the regex text as a disambiguating criterion for data formatters, and I don't think we should make a feature of it now -- it's just too weird and I doubt anybody will expect that.

Since it seems that there is a need for disambiguation (libc++ can be configured to have any name for the inline namespace, so there's no way to make its regex not match the libstdc++ one), I think we should just use the registration order to disambiguate. Then we just need to make sure the libstdc++ formatter is registered before the libc++ one, which should be both easy to achieve and understandable.

Since you've recently touched this code, how hard do you think it would be to exchange the std::map in FormattersContainer for a std::vector? Would you be willing to give that a try?




More information about the lldb-commits mailing list