[Lldb-commits] [lldb] [lldb] Replace SmallSet with SmallPtrSet (NFC) (PR #154366)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Aug 19 08:45:42 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
This patch replaces SmallSet<T *, N> with SmallPtrSet<T *, N>. Note
that SmallSet.h "redirects" SmallSet to SmallPtrSet for pointer
element types:
template <typename PointeeType, unsigned N>
class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N> {};
We only have 10 instances that rely on this "redirection". Since the
redirection doesn't improve readability, this patch replaces SmallSet
with SmallPtrSet for pointer element types.
I'm planning to remove the redirection eventually.
---
Full diff: https://github.com/llvm/llvm-project/pull/154366.diff
1 Files Affected:
- (modified) lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp (+1-1)
``````````diff
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
index a9345c79bd2bb..1bfa17f08a3b9 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
@@ -44,7 +44,7 @@ class ElaboratingDIEIterator
// Container sizes are optimized for the case of following DW_AT_specification
// and DW_AT_abstract_origin just once.
llvm::SmallVector<DWARFDIE, 2> m_worklist;
- llvm::SmallSet<DWARFDebugInfoEntry *, 3> m_seen;
+ llvm::SmallPtrSet<DWARFDebugInfoEntry *, 3> m_seen;
void Next() {
assert(!m_worklist.empty() && "Incrementing end iterator?");
``````````
</details>
https://github.com/llvm/llvm-project/pull/154366
More information about the lldb-commits
mailing list