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

In D66398#1640840 <https://reviews.llvm.org/D66398#1640840>, @jankratochvil 
wrote:

> It just makes now the regexes unambiguous.


I think this is fine too, but I would also only consider it a stop-gap, because 
these kinds of regular are horrid.

What was the problem with the dispatching solution? If it is hard to 
programatically access the inline namespace name (though I expect you should at 
least be able to to something like `type.GetName().startswith("std::__cxx11")`, 
then we can dispatch based on some other property. The presence of some member 
variable for instance? This would technically be even more correct as it would 
also work in the case when someone sadistically configures libc++ to use the 
`__cxx11` namespace. And since the formatters need have knowledge of the member 
variables then I think dispatching based on them is fair game too...



================
Comment at: lldb/include/lldb/DataFormatters/FormattersContainer.h:299-316
+    MapIterator found = end;
     for (pos = m_format_map.map().begin(); pos != end; pos++) {
       lldb::RegularExpressionSP regex = pos->first;
       if (regex->Execute(key_str)) {
-        value = pos->second;
-        return true;
+        if (found != end) {
+          llvm::errs() << "Two regexes (\"" << found->first->GetText()
+                       << "\" and \"" << regex->GetText()
----------------
Let's make a separate patch for this. I think it would be better to print this 
error through proper channels, but that might require some plumbing.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66398/new/

https://reviews.llvm.org/D66398



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to