[Lldb-commits] [lldb] [lldb] Better matching of types in anonymous namespaces (PR #102111)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 7 04:17:17 PDT 2024


================
@@ -788,7 +808,10 @@ Type::GetTypeScopeAndBasename(llvm::StringRef name) {
     switch (pos.value()) {
     case ':':
       if (prev_is_colon && template_depth == 0) {
-        result.scope.push_back(name.slice(name_begin, pos.index() - 1));
+        llvm::StringRef scope_name = name.slice(name_begin, pos.index() - 1);
----------------
labath wrote:

> Do I understand correctly that we could've kept this as-is, but would then have to check for the (anonymous namespace) string in the ContextMatches function?

That's correct, except that we would need to check for this string and still also the empty string (as that's how it comes out of DWARF). I figured its best to standardize this as early as possible (and an empty string seems like a less language-specific version).

https://github.com/llvm/llvm-project/pull/102111


More information about the lldb-commits mailing list