LLVM  6.0.0svn
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
 

Public Member Functions

 SmallSet ()=default
 
LLVM_NODISCARD 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. More...
 
std::pair< NoneType, boolinsert (const T &V)
 insert - Insert an element into the set if it isn't already there. More...
 
template<typename IterT >
void insert (IterT I, IterT E)
 
bool erase (const T &V)
 
void clear ()
 

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.

Note that this set does not provide a way to iterate over members in the set.

Definition at line 36 of file SmallSet.h.

Member Typedef Documentation

◆ 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 52 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

◆ clear()

template<typename T, unsigned N, typename C = std::less<T>>
void llvm::SmallSet< T, N, C >::clear ( )
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>>
LLVM_NODISCARD bool llvm::SmallSet< T, N, C >::empty ( ) const
inline

◆ erase()

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

◆ insert() [1/2]

template<typename T, unsigned N, typename C = std::less<T>>
std::pair<NoneType, 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 true if the element is inserted (it was not in the set before). The first value of the returned pair is unused and provided for partial compatibility with the standard library self-associative container concept.

Definition at line 81 of file SmallSet.h.

Referenced by llvm::InnerLoopVectorizer::addMetadata(), llvm::RuntimePointerChecking::CheckingPtrGroup::addPointer(), llvm::VPlan::addVF(), AntiDepEdges(), llvm::ARMBaseInstrInfo::ARMBaseInstrInfo(), AssignProtectedObjSet(), calculateByteProvider(), CheckForLiveRegDef(), CheckForLiveRegDefMasked(), CloneLoop(), CollectSubexprs(), combineShuffleOfScalars(), CompareMBBNumbers(), computeLiveOuts(), llvm::ComputeSpeculationCost(), llvm::ARMBaseInstrInfo::copyPhysReg(), createCast(), llvm::createLanaiDelaySlotFillerPass(), llvm::createSparcDelaySlotFillerPass(), llvm::HexagonFrameLowering::determineCalleeSaves(), determinePointerReadAttrs(), llvm::Instruction::dropUnknownNonDebugMetadata(), llvm::HexagonHazardRecognizer::EmitInstruction(), ExpandBVWithShuffles(), llvm::finalizeBundle(), findConsecutiveLoad(), findDeadCallerSavedReg(), llvm::R600InstrInfo::fitsConstReadLimitations(), llvm::FunctionComparator::functionHash(), llvm::IRTranslator::getAnalysisUsage(), getCopyRewriter(), llvm::sys::getHostCPUName(), getNodeRegMask(), getParentPad(), llvm::slpvectorizer::BoUpSLP::getTreeCost(), getUnconditionalBrDisp(), getZeroLatency(), llvm::LiveVariables::HandleVirtRegDef(), hasOutsideLoopUser(), hasTiedDef(), INITIALIZE_PASS(), llvm::SmallSet< unsigned, 16 >::insert(), InstructionStoresToFI(), instrumentMaskedLoadOrStore(), isHighLatencyCPSR(), isImmValidForOpcode(), IsIncrementNUW(), isLoadConditional(), isOperandKill(), IsSafeAndProfitableToMove(), isVirtualRegisterOperand(), materializeVectorConstant(), mayLoopAccessLocation(), optimizeGlobalsInModule(), phiHasBreakDef(), llvm::PointerMayBeCaptured(), llvm::WebAssemblyInstPrinter::printInst(), ProcessSourceNode(), llvm::programUndefinedIfFullPoison(), propagateSwiftErrorVRegs(), llvm::MachineDominatorTree::recordSplitCriticalEdge(), regOverlapsSet(), shouldInstrumentReadWriteFromAddress(), shouldReorderOperands(), llvm::MachineBasicBlock::SplitCriticalEdge(), TrackDefUses(), TryToMergeLandingPad(), tryToVectorizeHorReductionOrInstOperands(), unique_unsorted(), llvm::UnrollRuntimeLoopRemainder(), UpdatePredRedefs(), llvm::SelectionDAGBuilder::UpdateSplitBlock(), and verifyCTRBranch().

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

◆ 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: