Skip to content

Commit 7be06db

Browse files
[lldb] Use SmallPtrSet directly instead of SmallSet (NFC) (#154472)
I'm trying to remove the redirection in SmallSet.h: template <typename PointeeType, unsigned N> class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N> {}; to make it clear that we are using SmallPtrSet. There are only handful places that rely on this redirection. This patch replaces SmallSet to SmallPtrSet where the element type is a pointer.
1 parent 8a5b6b3 commit 7be06db

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,10 @@ bool DWARFDebugInfoEntry::GetDIENamesAndRanges(
284284
/// Adds all attributes of the DIE at the top of the \c worklist to the
285285
/// \c attributes list. Specifcations and abstract origins are added
286286
/// to the \c worklist if the referenced DIE has not been seen before.
287-
static bool GetAttributes(llvm::SmallVectorImpl<DWARFDIE> &worklist,
288-
llvm::SmallSet<DWARFDebugInfoEntry const *, 3> &seen,
289-
DWARFAttributes &attributes) {
287+
static bool
288+
GetAttributes(llvm::SmallVectorImpl<DWARFDIE> &worklist,
289+
llvm::SmallPtrSet<DWARFDebugInfoEntry const *, 3> &seen,
290+
DWARFAttributes &attributes) {
290291
assert(!worklist.empty() && "Need at least one DIE to visit.");
291292
assert(seen.size() >= 1 &&
292293
"Need to have seen at least the currently visited entry.");
@@ -366,7 +367,7 @@ DWARFAttributes DWARFDebugInfoEntry::GetAttributes(const DWARFUnit *cu,
366367
// Keep track if DIEs already seen to prevent infinite recursion.
367368
// Value of '3' was picked for the same reason that
368369
// DWARFDie::findRecursively does.
369-
llvm::SmallSet<DWARFDebugInfoEntry const *, 3> seen;
370+
llvm::SmallPtrSet<DWARFDebugInfoEntry const *, 3> seen;
370371
seen.insert(this);
371372

372373
do {

0 commit comments

Comments
 (0)