[Lldb-commits] [lldb] [LLDB][NativePDB] Allow type lookup in namespaces (PR #149876)

via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 23 04:01:42 PDT 2025


================
@@ -2291,6 +2298,8 @@ void SymbolFileNativePDB::BuildParentMap() {
     TypeIndex fwd = full_to_forward[full];
     m_parent_types[fwd] = m_parent_types[full];
   }
+
+  m_type_base_names.Sort();
----------------
Nerixyz wrote:

`m_type_base_names` is a [`UniqueCStringMap`](https://github.com/llvm/llvm-project/blob/d449d3dc13daff388cbf6a7bb910e0511804eb84/lldb/include/lldb/Core/UniqueCStringMap.h) which holds a `vector<(CString, T)>`. To act as a map (i.e. to be able to use binary search), it needs to be sorted. [`Append(element)`](https://github.com/llvm/llvm-project/blob/d449d3dc13daff388cbf6a7bb910e0511804eb84/lldb/include/lldb/Core/UniqueCStringMap.h#L42-L44) only translates to `push_back`. Once we inserted all elements, the map is unsorted, so we have to sort it to be able to look up elements.

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


More information about the lldb-commits mailing list