LLVM API Documentation
A vector that has set insertion semantics. More...
#include <SetVector.h>
Classes | |
class | TestAndEraseFromSet |
A wrapper predicate designed for use with std::remove_if. | |
Public Types | |
typedef T | value_type |
typedef T | key_type |
typedef T & | reference |
typedef const T & | const_reference |
typedef Set | set_type |
typedef Vector | vector_type |
typedef vector_type::const_iterator | iterator |
typedef vector_type::const_iterator | const_iterator |
typedef vector_type::size_type | size_type |
Public Member Functions | |
SetVector () | |
Construct an empty SetVector. | |
template<typename It > | |
SetVector (It Start, It End) | |
Initialize a SetVector with a range of elements. | |
bool | empty () const |
Determine if the SetVector is empty or not. | |
size_type | size () const |
Determine the number of elements in the SetVector. | |
iterator | begin () |
Get an iterator to the beginning of the SetVector. | |
const_iterator | begin () const |
Get a const_iterator to the beginning of the SetVector. | |
iterator | end () |
Get an iterator to the end of the SetVector. | |
const_iterator | end () const |
Get a const_iterator to the end of the SetVector. | |
const T & | back () const |
Return the last element of the SetVector. | |
const_reference | operator[] (size_type n) const |
Index into the SetVector. | |
bool | insert (const value_type &X) |
Insert a new element into the SetVector. | |
template<typename It > | |
void | insert (It Start, It End) |
Insert a range of elements into the SetVector. | |
bool | remove (const value_type &X) |
Remove an item from the set vector. | |
template<typename UnaryPredicate > | |
bool | remove_if (UnaryPredicate P) |
Remove items from the set vector based on a predicate function. | |
size_type | count (const key_type &key) const |
Count the number of elements of a given key in the SetVector. | |
void | clear () |
Completely clear the SetVector. | |
void | pop_back () |
Remove the last element of the SetVector. | |
T LLVM_ATTRIBUTE_UNUSED_RESULT | pop_back_val () |
bool | operator== (const SetVector &that) const |
bool | operator!= (const SetVector &that) const |
A vector that has set insertion semantics.
This adapter class provides a way to keep a set of things that also has the property of a deterministic iteration order. The order of iteration is the order of insertion.
Definition at line 37 of file SetVector.h.
typedef vector_type::const_iterator llvm::SetVector< T, Vector, Set >::const_iterator |
Definition at line 46 of file SetVector.h.
typedef const T& llvm::SetVector< T, Vector, Set >::const_reference |
Definition at line 42 of file SetVector.h.
typedef vector_type::const_iterator llvm::SetVector< T, Vector, Set >::iterator |
Definition at line 45 of file SetVector.h.
typedef T llvm::SetVector< T, Vector, Set >::key_type |
Definition at line 40 of file SetVector.h.
typedef T& llvm::SetVector< T, Vector, Set >::reference |
Definition at line 41 of file SetVector.h.
typedef Set llvm::SetVector< T, Vector, Set >::set_type |
Definition at line 43 of file SetVector.h.
typedef vector_type::size_type llvm::SetVector< T, Vector, Set >::size_type |
Definition at line 47 of file SetVector.h.
typedef T llvm::SetVector< T, Vector, Set >::value_type |
Definition at line 39 of file SetVector.h.
typedef Vector llvm::SetVector< T, Vector, Set >::vector_type |
Definition at line 44 of file SetVector.h.
llvm::SetVector< T, Vector, Set >::SetVector | ( | ) | [inline] |
Construct an empty SetVector.
Definition at line 50 of file SetVector.h.
llvm::SetVector< T, Vector, Set >::SetVector | ( | It | Start, |
It | End | ||
) | [inline] |
Initialize a SetVector with a range of elements.
Definition at line 54 of file SetVector.h.
const T& llvm::SetVector< T, Vector, Set >::back | ( | ) | const [inline] |
Return the last element of the SetVector.
Definition at line 89 of file SetVector.h.
Referenced by llvm::LiveRangeEdit::eliminateDeadDefs(), llvm::SetVector< Type * >::pop_back(), and llvm::SetVector< Type * >::pop_back_val().
iterator llvm::SetVector< T, Vector, Set >::begin | ( | ) | [inline] |
Get an iterator to the beginning of the SetVector.
Definition at line 69 of file SetVector.h.
Referenced by AssignProtectedObjSet(), buildExtractionBlockSet(), CloneAliasScopeMetadata(), llvm::SetTheory::expand(), llvm::CodeExtractor::extractCodeRegion(), llvm::CodeExtractor::findInputsOutputs(), llvm::FindUsedTypes::print(), and VerifyPHIs().
const_iterator llvm::SetVector< T, Vector, Set >::begin | ( | ) | const [inline] |
Get a const_iterator to the beginning of the SetVector.
Definition at line 74 of file SetVector.h.
void llvm::SetVector< T, Vector, Set >::clear | ( | ) | [inline] |
Completely clear the SetVector.
Definition at line 161 of file SetVector.h.
Referenced by buildExtractionBlockSet(), and llvm::FindUsedTypes::runOnModule().
size_type llvm::SetVector< T, Vector, Set >::count | ( | const key_type & | key | ) | const [inline] |
Count the number of elements of a given key in the SetVector.
Definition at line 156 of file SetVector.h.
Referenced by buildExtractionBlockSet(), definedInCaller(), definedInRegion(), and llvm::CodeExtractor::extractCodeRegion().
bool llvm::SetVector< T, Vector, Set >::empty | ( | ) | const [inline] |
Determine if the SetVector is empty or not.
Definition at line 59 of file SetVector.h.
Referenced by llvm::SetVector< Type * >::back(), CloneAliasScopeMetadata(), llvm::LiveRangeEdit::eliminateDeadDefs(), llvm::CodeExtractor::isEligible(), llvm::SetVector< Type * >::pop_back(), llvm::AssemblyWriter::printModule(), and tryToMakeAllocaBePromotable().
iterator llvm::SetVector< T, Vector, Set >::end | ( | ) | [inline] |
Get an iterator to the end of the SetVector.
Definition at line 79 of file SetVector.h.
Referenced by AssignProtectedObjSet(), buildExtractionBlockSet(), CloneAliasScopeMetadata(), llvm::SetTheory::expand(), llvm::CodeExtractor::extractCodeRegion(), llvm::CodeExtractor::findInputsOutputs(), and llvm::FindUsedTypes::print().
const_iterator llvm::SetVector< T, Vector, Set >::end | ( | ) | const [inline] |
Get a const_iterator to the end of the SetVector.
Definition at line 84 of file SetVector.h.
bool llvm::SetVector< T, Vector, Set >::insert | ( | const value_type & | X | ) | [inline] |
Insert a new element into the SetVector.
Definition at line 102 of file SetVector.h.
Referenced by buildExtractionBlockSet(), CloneAliasScopeMetadata(), llvm::ARMAsmPrinter::EmitStartOfAsmFile(), llvm::SetTheory::evaluate(), llvm::CodeExtractor::findInputsOutputs(), llvm::SetVector< Type * >::SetVector(), and tryToMakeAllocaBePromotable().
void llvm::SetVector< T, Vector, Set >::insert | ( | It | Start, |
It | End | ||
) | [inline] |
Insert a range of elements into the SetVector.
Definition at line 111 of file SetVector.h.
bool llvm::SetVector< T, Vector, Set >::operator!= | ( | const SetVector< T, Vector, Set > & | that | ) | const [inline] |
Definition at line 183 of file SetVector.h.
bool llvm::SetVector< T, Vector, Set >::operator== | ( | const SetVector< T, Vector, Set > & | that | ) | const [inline] |
Definition at line 179 of file SetVector.h.
const_reference llvm::SetVector< T, Vector, Set >::operator[] | ( | size_type | n | ) | const [inline] |
Index into the SetVector.
Definition at line 95 of file SetVector.h.
void llvm::SetVector< T, Vector, Set >::pop_back | ( | ) | [inline] |
Remove the last element of the SetVector.
Definition at line 167 of file SetVector.h.
Referenced by llvm::LiveRangeEdit::eliminateDeadDefs(), and llvm::SetVector< Type * >::pop_back_val().
T LLVM_ATTRIBUTE_UNUSED_RESULT llvm::SetVector< T, Vector, Set >::pop_back_val | ( | ) | [inline] |
Definition at line 173 of file SetVector.h.
bool llvm::SetVector< T, Vector, Set >::remove | ( | const value_type & | X | ) | [inline] |
Remove an item from the set vector.
Definition at line 118 of file SetVector.h.
bool llvm::SetVector< T, Vector, Set >::remove_if | ( | UnaryPredicate | P | ) | [inline] |
Remove items from the set vector based on a predicate function.
This is intended to be equivalent to the following code, if we could write it:
V.erase(std::remove_if(V.begin(), V.end(), P), V.end());
However, SetVector doesn't expose non-const iterators, making any algorithm like remove_if impossible to use.
Definition at line 143 of file SetVector.h.
Referenced by llvm::SetVector< Type * >::remove_if().
size_type llvm::SetVector< T, Vector, Set >::size | ( | ) | const [inline] |
Determine the number of elements in the SetVector.
Definition at line 64 of file SetVector.h.
Referenced by llvm::ARMAsmPrinter::EmitStartOfAsmFile(), and tryToMakeAllocaBePromotable().