LLVM 17.0.0git
Public Types | Public Member Functions | List of all members
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 >:
Inheritance graph
[legend]

Public Types

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

Public Member Functions

 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.
 
template<typename IterT >
void insert (IterT I, IterT E)
 
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 135 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 153 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 152 of file SmallSet.h.

Constructor & Destructor Documentation

◆ SmallSet()

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

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 221 of file SmallSet.h.

References llvm::Vector.

Referenced by INITIALIZE_PASS(), and interpretValues().

◆ clear()

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

◆ contains()

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

◆ count()

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

◆ empty()

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

◆ end()

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

Definition at line 227 of file SmallSet.h.

References llvm::Vector.

Referenced by interpretValues().

◆ 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 205 of file SmallSet.h.

References E, I, and llvm::Vector.

Referenced by llvm::finalizeBundle(), INITIALIZE_PASS(), and IsValueFullyAvailableInBlock().

◆ insert() [1/2]

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 177 of file SmallSet.h.

References I, N, and llvm::Vector.

Referenced by addArgumentAttrs(), addArgumentReturnedAttrs(), llvm::SPIRV::RequirementHandler::addExtension(), llvm::SPIRV::RequirementHandler::addExtensions(), addHints(), addMemoryAttrs(), addNoAliasAttrs(), addNonNullAttrs(), addNoRecurseAttrs(), addNoReturnAttrs(), addWillReturn(), AntiDepEdges(), llvm::AMDGPURegisterBankInfo::applyMappingSBufferLoad(), llvm::OpenMPIRBuilder::applySimd(), llvm::DomTreeUpdater::applyUpdatesPermissive(), llvm::ARMBaseInstrInfo::ARMBaseInstrInfo(), AssignProtectedObjSet(), llvm::CallGraphDOTInfo::CallGraphDOTInfo(), llvm::changeToUnreachable(), CheckForLiveRegDef(), CheckForLiveRegDefMasked(), clobberRegEntries(), llvm::JumpThreadingPass::cloneInstructions(), llvm::AMDGPURegisterBankInfo::collectWaterfallOperands(), combineShuffleOfScalars(), llvm::SMSchedule::computeUnpipelineableNodes(), llvm::ConstantFoldTerminator(), llvm::ARMBaseInstrInfo::copyPhysReg(), deriveAttrsInPostOrder(), despeculateCountZeros(), llvm::Instruction::dropUnknownNonDebugMetadata(), llvm::HexagonRegisterInfo::eliminateFrameIndex(), llvm::HexagonHazardRecognizer::EmitInstruction(), llvm::WebAssemblyAsmPrinter::EmitProducerInfo(), emitSelectPseudo(), llvm::finalizeBundle(), findConsecutiveLoad(), llvm::DWARFDie::findRecursively(), llvm::R600InstrInfo::fitsConstReadLimitations(), llvm::rdf::Liveness::getAllReachingDefs(), llvm::RISCVRegisterInfo::getRegAllocationHints(), llvm::SystemZRegisterInfo::getRegAllocationHints(), llvm::X86RegisterInfo::getRegAllocationHints(), llvm::TargetRegisterInfo::getRegAllocationHints(), llvm::slpvectorizer::BoUpSLP::LookAheadHeuristics::getScoreAtLevelRec(), getUniqueCaseValue(), llvm::MachineInstr::getUsedDebugRegs(), handleNormalInst(), llvm::RISCVInstrInfo::hasAllNBitUsers(), hoistAndMergeSGPRInits(), INITIALIZE_PASS(), llvm::SmallSet< T, N, C >::insert(), llvm::MemorySSAUpdater::insertDef(), interpretValues(), llvm::AMDGPU::isClobberedInFunction(), isLoadCombineCandidate(), IsSafeAndProfitableToMove(), IsValueFullyAvailableInBlock(), liesBetween(), llvm::SelectionDAGBuilder::LowerStatepoint(), lowerStatepointMetaArgs(), mustExecuteUBIfPoisonOnPathTo(), llvm::LoopVectorizationPlanner::plan(), llvm::PointerMayBeCaptured(), llvm::WebAssemblyInstPrinter::printInst(), ProcessSourceNode(), programUndefinedIfUndefOrPoison(), llvm::SwiftErrorValueTracking::propagateVRegs(), llvm::MachineDominatorTree::recordSplitCriticalEdge(), replaceAllUsesWith(), llvm::MachineBasicBlock::SplitCriticalEdge(), TryToSinkInstruction(), unique_unsorted(), verifyCTRBranch(), and llvm::VirtRegAuxInfo::weightCalcHelper().

◆ insert() [2/2]

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 200 of file SmallSet.h.

References E, I, and llvm::SmallSet< T, N, C >::insert().

◆ size()

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

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