LLVM 22.0.0git
llvm::SmallSet< T, N, C > Class Template Reference

SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less than N). More...

#include "llvm/ADT/SmallSet.h"

Inheritance diagram for llvm::SmallSet< T, N, C >:
[legend]

Public Types

using key_type = T
using size_type = size_t
using value_type = T
using const_iterator = SmallSetIterator<T, N, C>

Public Member Functions

 SmallSet ()=default
 SmallSet (const SmallSet &)=default
 SmallSet (SmallSet &&)=default
template<typename IterT>
 SmallSet (IterT Begin, IterT End)
template<typename Range>
 SmallSet (llvm::from_range_t, Range &&R)
 SmallSet (std::initializer_list< T > L)
SmallSetoperator= (const SmallSet &)=default
SmallSetoperator= (SmallSet &&)=default
bool empty () const
size_type size () const
size_type count (const T &V) const
 count - Return 1 if the element is in the set, 0 otherwise.
std::pair< const_iterator, boolinsert (const T &V)
 insert - Insert an element into the set if it isn't already there.
std::pair< const_iterator, boolinsert (T &&V)
template<typename IterT>
void insert (IterT I, IterT E)
template<typename Range>
void insert_range (Range &&R)
bool erase (const T &V)
void clear ()
const_iterator begin () const
const_iterator end () const
bool contains (const T &V) const
 Check if the SmallSet contains the given element.

Detailed Description

template<typename T, unsigned N, typename C = std::less<T>>
class llvm::SmallSet< T, N, C >

SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less than N).

In this case, the set can be maintained with no mallocs. If the set gets large, we expand to using an std::set to maintain reasonable lookup times.

Definition at line 133 of file SmallSet.h.

Member Typedef Documentation

◆ const_iterator

template<typename T, unsigned N, typename C = std::less<T>>
using llvm::SmallSet< T, N, C >::const_iterator = SmallSetIterator<T, N, C>

Definition at line 149 of file SmallSet.h.

◆ key_type

template<typename T, unsigned N, typename C = std::less<T>>
using llvm::SmallSet< T, N, C >::key_type = T

Definition at line 146 of file SmallSet.h.

◆ size_type

template<typename T, unsigned N, typename C = std::less<T>>
using llvm::SmallSet< T, N, C >::size_type = size_t

Definition at line 147 of file SmallSet.h.

◆ value_type

template<typename T, unsigned N, typename C = std::less<T>>
using llvm::SmallSet< T, N, C >::value_type = T

Definition at line 148 of file SmallSet.h.

Constructor & Destructor Documentation

◆ SmallSet() [1/6]

template<typename T, unsigned N, typename C = std::less<T>>
llvm::SmallSet< T, N, C >::SmallSet ( )
default

◆ SmallSet() [2/6]

template<typename T, unsigned N, typename C = std::less<T>>
llvm::SmallSet< T, N, C >::SmallSet ( const SmallSet< T, N, C > & )
default

◆ SmallSet() [3/6]

template<typename T, unsigned N, typename C = std::less<T>>
llvm::SmallSet< T, N, C >::SmallSet ( SmallSet< T, N, C > && )
default

◆ SmallSet() [4/6]

template<typename T, unsigned N, typename C = std::less<T>>
template<typename IterT>
llvm::SmallSet< T, N, C >::SmallSet ( IterT Begin,
IterT End )
inline

Definition at line 155 of file SmallSet.h.

◆ SmallSet() [5/6]

template<typename T, unsigned N, typename C = std::less<T>>
template<typename Range>
llvm::SmallSet< T, N, C >::SmallSet ( llvm::from_range_t ,
Range && R )
inline

Definition at line 160 of file SmallSet.h.

◆ SmallSet() [6/6]

template<typename T, unsigned N, typename C = std::less<T>>
llvm::SmallSet< T, N, C >::SmallSet ( std::initializer_list< T > L)
inline

Definition at line 163 of file SmallSet.h.

Member Function Documentation

◆ begin()

template<typename T, unsigned N, typename C = std::less<T>>
const_iterator llvm::SmallSet< T, N, C >::begin ( ) const
inline

Definition at line 213 of file SmallSet.h.

◆ clear()

template<typename T, unsigned N, typename C = std::less<T>>
void llvm::SmallSet< T, N, C >::clear ( )
inline

Definition at line 208 of file SmallSet.h.

Referenced by isProfitable().

◆ contains()

template<typename T, unsigned N, typename C = std::less<T>>
bool llvm::SmallSet< T, N, C >::contains ( const T & V) const
inline

◆ count()

◆ empty()

template<typename T, unsigned N, typename C = std::less<T>>
bool llvm::SmallSet< T, N, C >::empty ( ) const
inlinenodiscard

◆ end()

template<typename T, unsigned N, typename C = std::less<T>>
const_iterator llvm::SmallSet< T, N, C >::end ( ) const
inline

Definition at line 219 of file SmallSet.h.

◆ erase()

template<typename T, unsigned N, typename C = std::less<T>>
bool llvm::SmallSet< T, N, C >::erase ( const T & V)
inline

Definition at line 197 of file SmallSet.h.

Referenced by llvm::finalizeBundle(), and getGatherLanePattern().

◆ insert() [1/3]

template<typename T, unsigned N, typename C = std::less<T>>
std::pair< const_iterator, bool > llvm::SmallSet< T, N, C >::insert ( const T & V)
inline

insert - Insert an element into the set if it isn't already there.

Returns a pair. The first value of it is an iterator to the inserted element or the existing element in the set. The second value is true if the element is inserted (it was not in the set before).

Definition at line 181 of file SmallSet.h.

Referenced by llvm::AAPointerInfo::OffsetInfo::addToAll(), llvm::GCNDownwardRPTracker::advanceBeforeNext(), AntiDepEdges(), llvm::AMDGPURegisterBankInfo::applyMappingSBufferLoad(), llvm::GenericDomTreeUpdater< DerivedT, DomTreeT, PostDomTreeT >::applyUpdatesPermissive(), AssignProtectedObjSet(), CheckForLiveRegDef(), CheckForLiveRegDef(), CheckForLiveRegDefMasked(), clobberRegEntries(), llvm::JumpThreadingPass::cloneInstructions(), collectPrivatizingConstructs(), llvm::AMDGPURegisterBankInfo::collectWaterfallOperands(), combineShuffleOfScalars(), llvm::PPCInstrInfo::convertToImmediateForm(), llvm::ARMBaseInstrInfo::copyPhysReg(), llvm::Instruction::dropUnknownNonDebugMetadata(), llvm::HexagonRegisterInfo::eliminateFrameIndex(), llvm::WebAssemblyAsmPrinter::EmitProducerInfo(), emitSelectPseudo(), emitSelectPseudo(), llvm::finalizeBundle(), llvm::DWARFDie::findRecursively(), llvm::R600InstrInfo::fitsConstReadLimitations(), gatherPossiblyVectorizableLoads(), llvm::rdf::Liveness::getAllReachingDefs(), llvm::RISCVRegisterInfo::getRegAllocationHints(), llvm::SystemZRegisterInfo::getRegAllocationHints(), llvm::TargetRegisterInfo::getRegAllocationHints(), llvm::X86RegisterInfo::getRegAllocationHints(), llvm::slpvectorizer::BoUpSLP::LookAheadHeuristics::getScoreAtLevelRec(), getUniqueCaseValue(), handleNormalInst(), hasAllNBitUsers(), hasAllNBitUsers(), llvm::WindowScheduler::initialize(), llvm::SmallSet< Register, 16 >::insert(), llvm::SmallSet< Register, 16 >::insert_range(), llvm::MemorySSAUpdater::insertDef(), isProfitable(), IsSafeAndProfitableToMove(), isSignExtendedW(), isSignExtendedW(), llvm::slpvectorizer::BoUpSLP::isStridedLoad(), LowerAVXCONCAT_VECTORS(), llvm::SelectionDAGBuilder::LowerStatepoint(), lowerStatepointMetaArgs(), llvm::ShuffleBlockStrategy::mutate(), ProcessSourceNode(), simplifySwitchOfCmpIntrinsic(), llvm::SmallSet< Register, 16 >::SmallSet(), llvm::SmallSet< Register, 16 >::SmallSet(), llvm::MachineBasicBlock::SplitCriticalEdge(), llvm::InstCombinerImpl::tryToSinkInstructionDbgVariableRecords(), and llvm::DWARFCFIAnalysis::update().

◆ insert() [2/3]

template<typename T, unsigned N, typename C = std::less<T>>
template<typename IterT>
void llvm::SmallSet< T, N, C >::insert ( IterT I,
IterT E )
inline

Definition at line 188 of file SmallSet.h.

◆ insert() [3/3]

template<typename T, unsigned N, typename C = std::less<T>>
std::pair< const_iterator, bool > llvm::SmallSet< T, N, C >::insert ( T && V)
inline

Definition at line 183 of file SmallSet.h.

◆ insert_range()

template<typename T, unsigned N, typename C = std::less<T>>
template<typename Range>
void llvm::SmallSet< T, N, C >::insert_range ( Range && R)
inline

Definition at line 193 of file SmallSet.h.

Referenced by interpretValues().

◆ operator=() [1/2]

template<typename T, unsigned N, typename C = std::less<T>>
SmallSet & llvm::SmallSet< T, N, C >::operator= ( const SmallSet< T, N, C > & )
default

◆ operator=() [2/2]

template<typename T, unsigned N, typename C = std::less<T>>
SmallSet & llvm::SmallSet< T, N, C >::operator= ( SmallSet< T, N, C > && )
default

◆ size()


The documentation for this class was generated from the following file: