[Lldb-commits] [PATCH] D133259: [lldb] Don't assume name of libc++ inline namespace in LibCxxUnorderedMap

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 6 16:20:22 PDT 2022


kastiglione added a comment.

Thanks for the report about the `__cc`, I can try to come up with something less fragile.



================
Comment at: lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp:76
+    auto ident_end =
+        name.find_if_not([](char c) { return std::isalnum(c) || c == '_'; });
+    if (ident_end != llvm::StringRef::npos && ident_end >= 1) {
----------------
rupprecht wrote:
> This might be overly generic: every libc++ std inline namespace I've seen is `__[a-zA-Z0-9]+::`, e.g. we should handle `std::__foo::unordered_map` but not `std::foo::unordered_map`. I don't know if we've codified that convention anywhere.
> 
> For comparison, see https://github.com/llvm/llvm-project/blob/839b436c93604e042f74050cf2adadd75f30e898/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp#L580
Happy to require the leading `__`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133259



More information about the lldb-commits mailing list