|
LLVM
10.0.0
|
A vector that has set insertion semantics. More...
#include "llvm/ADT/SetVector.h"
Public Types | |
| using | value_type = T |
| using | key_type = T |
| using | reference = T & |
| using | const_reference = const T & |
| using | set_type = Set |
| using | vector_type = Vector |
| using | iterator = typename vector_type::const_iterator |
| using | const_iterator = typename vector_type::const_iterator |
| using | reverse_iterator = typename vector_type::const_reverse_iterator |
| using | const_reverse_iterator = typename vector_type::const_reverse_iterator |
| using | size_type = typename vector_type::size_type |
Public Member Functions | |
| SetVector ()=default | |
| Construct an empty SetVector. More... | |
| template<typename It > | |
| SetVector (It Start, It End) | |
| Initialize a SetVector with a range of elements. More... | |
| ArrayRef< T > | getArrayRef () const |
| Vector | takeVector () |
| Clear the SetVector and return the underlying vector. More... | |
| bool | empty () const |
| Determine if the SetVector is empty or not. More... | |
| size_type | size () const |
| Determine the number of elements in the SetVector. More... | |
| iterator | begin () |
| Get an iterator to the beginning of the SetVector. More... | |
| const_iterator | begin () const |
| Get a const_iterator to the beginning of the SetVector. More... | |
| iterator | end () |
| Get an iterator to the end of the SetVector. More... | |
| const_iterator | end () const |
| Get a const_iterator to the end of the SetVector. More... | |
| reverse_iterator | rbegin () |
| Get an reverse_iterator to the end of the SetVector. More... | |
| const_reverse_iterator | rbegin () const |
| Get a const_reverse_iterator to the end of the SetVector. More... | |
| reverse_iterator | rend () |
| Get a reverse_iterator to the beginning of the SetVector. More... | |
| const_reverse_iterator | rend () const |
| Get a const_reverse_iterator to the beginning of the SetVector. More... | |
| const T & | front () const |
| Return the first element of the SetVector. More... | |
| const T & | back () const |
| Return the last element of the SetVector. More... | |
| const_reference | operator[] (size_type n) const |
| Index into the SetVector. More... | |
| bool | insert (const value_type &X) |
| Insert a new element into the SetVector. More... | |
| template<typename It > | |
| void | insert (It Start, It End) |
| Insert a range of elements into the SetVector. More... | |
| bool | remove (const value_type &X) |
| Remove an item from the set vector. More... | |
| iterator | erase (iterator I) |
| Erase a single element from the set vector. More... | |
| template<typename UnaryPredicate > | |
| bool | remove_if (UnaryPredicate P) |
| Remove items from the set vector based on a predicate function. More... | |
| size_type | count (const key_type &key) const |
| Count the number of elements of a given key in the SetVector. More... | |
| void | clear () |
| Completely clear the SetVector. More... | |
| void | pop_back () |
| Remove the last element of the SetVector. More... | |
| LLVM_NODISCARD T | pop_back_val () |
| bool | operator== (const SetVector &that) const |
| bool | operator!= (const SetVector &that) const |
| template<class STy > | |
| bool | set_union (const STy &S) |
| Compute This := This u S, return whether 'This' changed. More... | |
| template<class STy > | |
| void | set_subtract (const STy &S) |
| Compute This := This - B TODO: We should be able to use set_subtract from SetOperations.h, but SetVector interface is inconsistent with DenseSet. More... | |
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 40 of file SetVector.h.
| using llvm::SetVector< T, Vector, Set >::const_iterator = typename vector_type::const_iterator |
Definition at line 49 of file SetVector.h.
| using llvm::SetVector< T, Vector, Set >::const_reference = const T& |
Definition at line 45 of file SetVector.h.
| using llvm::SetVector< T, Vector, Set >::const_reverse_iterator = typename vector_type::const_reverse_iterator |
Definition at line 51 of file SetVector.h.
| using llvm::SetVector< T, Vector, Set >::iterator = typename vector_type::const_iterator |
Definition at line 48 of file SetVector.h.
| using llvm::SetVector< T, Vector, Set >::key_type = T |
Definition at line 43 of file SetVector.h.
| using llvm::SetVector< T, Vector, Set >::reference = T& |
Definition at line 44 of file SetVector.h.
| using llvm::SetVector< T, Vector, Set >::reverse_iterator = typename vector_type::const_reverse_iterator |
Definition at line 50 of file SetVector.h.
| using llvm::SetVector< T, Vector, Set >::set_type = Set |
Definition at line 46 of file SetVector.h.
| using llvm::SetVector< T, Vector, Set >::size_type = typename vector_type::size_type |
Definition at line 52 of file SetVector.h.
| using llvm::SetVector< T, Vector, Set >::value_type = T |
Definition at line 42 of file SetVector.h.
| using llvm::SetVector< T, Vector, Set >::vector_type = Vector |
Definition at line 47 of file SetVector.h.
|
default |
Construct an empty SetVector.
|
inline |
Initialize a SetVector with a range of elements.
Definition at line 59 of file SetVector.h.
|
inline |
Return the last element of the SetVector.
Definition at line 128 of file SetVector.h.
Referenced by llvm::LiveRangeEdit::eliminateDeadDefs(), llvm::SetVector< llvm::AbstractAttribute *>::pop_back(), and llvm::SetVector< llvm::AbstractAttribute *>::pop_back_val().
|
inline |
Get an iterator to the beginning of the SetVector.
Definition at line 82 of file SetVector.h.
Referenced by AssignProtectedObjSet(), llvm::NodeSet::begin(), CloneAliasScopeMetadata(), computeLiveOuts(), llvm::SetTheory::expand(), getMemSetPatternValue(), getRegUnits(), INITIALIZE_PASS(), isNopCopy(), llvm::LoopVectorizationCostModel::memoryInstructionCanBeWidened(), pred_L(), llvm::AAEvaluator::run(), llvm::InnerLoopVectorizer::sinkScalarOperands(), and succ_L().
|
inline |
Get a const_iterator to the beginning of the SetVector.
Definition at line 87 of file SetVector.h.
|
inline |
Completely clear the SetVector.
Definition at line 215 of file SetVector.h.
Referenced by llvm::A57ChainingConstraint::apply(), llvm::NodeSet::clear(), llvm::Attributor::run(), and llvm::InnerLoopVectorizer::sinkScalarOperands().
|
inline |
Count the number of elements of a given key in the SetVector.
Definition at line 210 of file SetVector.h.
Referenced by Cleanup(), computeLiveOuts(), computePath(), llvm::NodeSet::count(), definedInCaller(), definedInRegion(), findBestInsertionSet(), llvm::CodeExtractor::findInputsOutputs(), getCommonExitBlock(), getMemSetPatternValue(), isBlockValidForExtraction(), isPromotedResultSafe(), makeVisible(), llvm::LoopVectorizationCostModel::memoryInstructionCanBeWidened(), llvm::NodeSet::NodeSet(), pred_L(), and succ_L().
|
inline |
Determine if the SetVector is empty or not.
Definition at line 72 of file SetVector.h.
Referenced by AssignProtectedObjSet(), llvm::SetVector< llvm::AbstractAttribute *>::back(), Cleanup(), CloneAliasScopeMetadata(), computeLiveOuts(), llvm::LiveRangeEdit::eliminateDeadDefs(), llvm::NodeSet::empty(), enableCallSafepoints(), llvm::rdf::DeadCodeElimination::erase(), llvm::CodeExtractor::extractCodeRegion(), llvm::SetVector< llvm::AbstractAttribute *>::front(), llvm::rdf::DataFlowGraph::getNextShadow(), hoistAndMergeSGPRInits(), isNotExclusivelyConstantDerived(), isPromotedResultSafe(), llvm::SIInstrInfo::moveToVALU(), llvm::operator<<(), llvm::SetVector< llvm::AbstractAttribute *>::pop_back(), llvm::Attributor::run(), and updateOperand().
|
inline |
Get an iterator to the end of the SetVector.
Definition at line 92 of file SetVector.h.
Referenced by AssignProtectedObjSet(), CloneAliasScopeMetadata(), computeLiveOuts(), llvm::NodeSet::end(), llvm::SetTheory::expand(), getMemSetPatternValue(), getRegUnits(), INITIALIZE_PASS(), llvm::LoopVectorizationCostModel::memoryInstructionCanBeWidened(), pred_L(), llvm::AAEvaluator::run(), llvm::InnerLoopVectorizer::sinkScalarOperands(), and succ_L().
|
inline |
Get a const_iterator to the end of the SetVector.
Definition at line 97 of file SetVector.h.
|
inline |
Erase a single element from the set vector.
Definition at line 171 of file SetVector.h.
|
inline |
Return the first element of the SetVector.
Definition at line 122 of file SetVector.h.
Referenced by Cleanup().
|
inline |
Definition at line 63 of file SetVector.h.
Referenced by llvm::CodeExtractor::extractCodeRegion(), and getMinVisibility().
|
inline |
Insert a new element into the SetVector.
Definition at line 141 of file SetVector.h.
Referenced by llvm::MCContext::addGenDwarfSection(), addIntrinsicToSummary(), addVCallToSet(), AssignProtectedObjSet(), buildClonedLoops(), llvm::LiveRangeCalc::calculateValues(), Cleanup(), CloneAliasScopeMetadata(), computeFunctionSummary(), computeKillSet(), llvm::rdf::Liveness::computeLiveIns(), computeLiveOuts(), computeLiveOutSeed(), computePath(), llvm::rdf::Liveness::computePhiInfo(), llvm::createLICMPass(), llvm::HexagonFrameLowering::determineCalleeSaves(), DFS(), enableAllocFrameElim(), enableCallSafepoints(), llvm::LiveRangeEdit::eraseVirtReg(), llvm::HexagonEvaluator::evaluate(), llvm::SetTheory::evaluate(), llvm::CodeExtractor::findAllocas(), llvm::CodeExtractor::findInputsOutputs(), findRefEdges(), llvm::Localizer::getAnalysisUsage(), getMemSetPatternValue(), getMinVisibility(), llvm::rdf::DataFlowGraph::getNextShadow(), getRegUnits(), hoistAndMergeSGPRInits(), INITIALIZE_PASS(), llvm::NodeSet::insert(), insertIfNamed(), isBroadcastShuffle(), llvm::LiveRangeCalc::isJointlyDominated(), isNotExclusivelyConstantDerived(), isPermutation(), isPromotedResultSafe(), llvm::LoopVectorizationCostModel::memoryInstructionCanBeWidened(), llvm::SIInstrInfo::moveToVALU(), llvm::AAEvaluator::run(), llvm::Attributor::run(), and llvm::SetVector< llvm::AbstractAttribute *>::set_union().
|
inline |
Insert a range of elements into the SetVector.
Definition at line 150 of file SetVector.h.
|
inline |
Definition at line 237 of file SetVector.h.
|
inline |
Definition at line 233 of file SetVector.h.
|
inline |
Index into the SetVector.
Definition at line 134 of file SetVector.h.
|
inline |
Remove the last element of the SetVector.
Definition at line 221 of file SetVector.h.
Referenced by llvm::LiveRangeEdit::eliminateDeadDefs(), and llvm::SetVector< llvm::AbstractAttribute *>::pop_back_val().
|
inline |
Definition at line 227 of file SetVector.h.
Referenced by hoistAndMergeSGPRInits(), isNotExclusivelyConstantDerived(), isPromotedResultSafe(), and llvm::SIInstrInfo::moveToVALU().
|
inline |
Get an reverse_iterator to the end of the SetVector.
Definition at line 102 of file SetVector.h.
Referenced by containsNewBackedge().
|
inline |
Get a const_reverse_iterator to the end of the SetVector.
Definition at line 107 of file SetVector.h.
|
inline |
Remove an item from the set vector.
Definition at line 157 of file SetVector.h.
Referenced by Cleanup(), computeFunctionSummary(), llvm::LiveRangeEdit::eraseVirtReg(), and llvm::rdf::DataFlowGraph::getNextShadow().
|
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:
However, SetVector doesn't expose non-const iterators, making any algorithm like remove_if impossible to use.
Definition at line 199 of file SetVector.h.
Referenced by llvm::NodeSet::remove_if(), and tryToVectorizeHorReductionOrInstOperands().
|
inline |
Get a reverse_iterator to the beginning of the SetVector.
Definition at line 112 of file SetVector.h.
Referenced by containsNewBackedge().
|
inline |
Get a const_reverse_iterator to the beginning of the SetVector.
Definition at line 117 of file SetVector.h.
|
inline |
Compute This := This - B TODO: We should be able to use set_subtract from SetOperations.h, but SetVector interface is inconsistent with DenseSet.
Definition at line 260 of file SetVector.h.
Referenced by computeLiveInValues().
|
inline |
Compute This := This u S, return whether 'This' changed.
TODO: We should be able to use set_union from SetOperations.h, but SetVector interface is inconsistent with DenseSet.
Definition at line 245 of file SetVector.h.
Referenced by computeLiveInValues().
|
inline |
Determine the number of elements in the SetVector.
Definition at line 77 of file SetVector.h.
Referenced by llvm::LiveRangeCalc::calculateValues(), computeFunctionSummary(), computeLiveInValues(), llvm::rdf::Liveness::computePhiInfo(), enableAllocFrameElim(), llvm::CodeExtractor::findInputsOutputs(), getMinVisibility(), getOutliningPenalty(), hasProfileData(), INITIALIZE_PASS(), llvm::LiveRangeCalc::isJointlyDominated(), isPermutation(), llvm::LoopVectorizationCostModel::memoryInstructionCanBeWidened(), llvm::NodeSet::NodeSet(), llvm::AAEvaluator::run(), llvm::Attributor::run(), and llvm::NodeSet::size().
|
inline |
Clear the SetVector and return the underlying vector.
Definition at line 66 of file SetVector.h.
Referenced by computeFunctionSummary(), and computeVariableSummary().
1.8.13