LLVM  mainline
Public Types | Public Member Functions
llvm::iplist< NodeTy, Traits > Class Template Reference

iplist - The subset of list functionality that can safely be used on nodes of polymorphic types, i.e. More...

#include <ilist.h>

Inheritance diagram for llvm::iplist< NodeTy, Traits >:
Inheritance graph
[legend]
Collaboration diagram for llvm::iplist< NodeTy, Traits >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef NodeTy * pointer
typedef const NodeTy * const_pointer
typedef NodeTy & reference
typedef const NodeTy & const_reference
typedef NodeTy value_type
typedef ilist_iterator< NodeTy > iterator
typedef ilist_iterator< const
NodeTy > 
const_iterator
typedef size_t size_type
typedef ptrdiff_t difference_type
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
typedef std::reverse_iterator
< iterator
reverse_iterator

Public Member Functions

 iplist ()
 ~iplist ()
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const
size_type max_size () const
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty () const
reference front ()
const_reference front () const
reference back ()
const_reference back () const
void swap (iplist &RHS)
iterator insert (iterator where, NodeTy *New)
iterator insertAfter (iterator where, NodeTy *New)
NodeTy * remove (iterator &IT)
NodeTy * remove (const iterator &IT)
NodeTy * remove (NodeTy *IT)
NodeTy * remove (NodeTy &IT)
iterator erase (iterator where)
iterator erase (NodeTy *IT)
iterator erase (NodeTy &IT)
void clearAndLeakNodesUnsafely ()
 Remove all nodes from the list like clear(), but do not call removeNodeFromList() or deleteNode().
size_type
LLVM_ATTRIBUTE_UNUSED_RESULT 
size () const
iterator erase (iterator first, iterator last)
void clear ()
void push_front (NodeTy *val)
void push_back (NodeTy *val)
void pop_front ()
void pop_back ()
template<class InIt >
void insert (iterator where, InIt first, InIt last)
void splice (iterator where, iplist &L2)
void splice (iterator where, iplist &L2, iterator first)
void splice (iterator where, iplist &L2, iterator first, iterator last)
void splice (iterator where, iplist &L2, NodeTy &N)
void splice (iterator where, iplist &L2, NodeTy *N)
template<class Compare >
void merge (iplist &Right, Compare comp)
void merge (iplist &Right)
template<class Compare >
void sort (Compare comp)
void sort ()
NodeTy * getPrevNode (NodeTy &N) const
 Get the previous node, or nullptr for the list head.
const NodeTy * getPrevNode (const NodeTy &N) const
 Get the previous node, or nullptr for the list head.
NodeTy * getNextNode (NodeTy &N) const
 Get the next node, or nullptr for the list tail.
const NodeTy * getNextNode (const NodeTy &N) const
 Get the next node, or nullptr for the list tail.

Detailed Description

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
class llvm::iplist< NodeTy, Traits >

iplist - The subset of list functionality that can safely be used on nodes of polymorphic types, i.e.

a heterogeneous list with a common base class that holds the next/prev pointers. The only state of the list itself is a single pointer to the head of the list.

This list can be in one of three interesting states: 1. The list may be completely unconstructed. In this case, the head pointer is null. When in this form, any query for an iterator (e.g. begin() or end()) causes the list to transparently change to state #2. 2. The list may be empty, but contain a sentinel for the end iterator. This sentinel is created by the Traits::createSentinel method and is a link in the list. When the list is empty, the pointer in the iplist points to the sentinel. Once the sentinel is constructed, it is not destroyed until the list is. 3. The list may contain actual objects in it, which are stored as a doubly linked list of nodes. One invariant of the list is that the predecessor of the first node in the list always points to the last node in the list, and the successor pointer for the sentinel (which always stays at the end of the list) is always null.

Definition at line 362 of file ilist.h.


Member Typedef Documentation

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
typedef ilist_iterator<const NodeTy> llvm::iplist< NodeTy, Traits >::const_iterator

Definition at line 394 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
typedef const NodeTy* llvm::iplist< NodeTy, Traits >::const_pointer

Definition at line 389 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
typedef const NodeTy& llvm::iplist< NodeTy, Traits >::const_reference

Definition at line 391 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
typedef std::reverse_iterator<const_iterator> llvm::iplist< NodeTy, Traits >::const_reverse_iterator

Definition at line 397 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
typedef ptrdiff_t llvm::iplist< NodeTy, Traits >::difference_type

Definition at line 396 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
typedef ilist_iterator<NodeTy> llvm::iplist< NodeTy, Traits >::iterator
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
typedef NodeTy* llvm::iplist< NodeTy, Traits >::pointer

Definition at line 388 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
typedef NodeTy& llvm::iplist< NodeTy, Traits >::reference

Definition at line 390 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
typedef std::reverse_iterator<iterator> llvm::iplist< NodeTy, Traits >::reverse_iterator

Definition at line 398 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
typedef size_t llvm::iplist< NodeTy, Traits >::size_type
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
typedef NodeTy llvm::iplist< NodeTy, Traits >::value_type

Definition at line 392 of file ilist.h.


Constructor & Destructor Documentation

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
llvm::iplist< NodeTy, Traits >::iplist ( ) [inline]

Definition at line 400 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
llvm::iplist< NodeTy, Traits >::~iplist ( ) [inline]

Definition at line 401 of file ilist.h.


Member Function Documentation

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
reference llvm::iplist< NodeTy, Traits >::back ( ) [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
const_reference llvm::iplist< NodeTy, Traits >::back ( ) const [inline]

Definition at line 451 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
iterator llvm::iplist< NodeTy, Traits >::begin ( ) [inline]

Definition at line 408 of file ilist.h.

Referenced by llvm::Module::aliases(), llvm::SelectionDAG::allnodes_begin(), llvm::MCSection::begin(), llvm::IVUsers::begin(), llvm::BasicBlock::begin(), llvm::MachineFunction::begin(), llvm::AliasSetTracker::begin(), llvm::Function::begin(), llvm::iplist< IVStrideUse >::clear(), llvm::SparseBitVector< ElementSize >::count(), llvm::NVPTXAsmPrinter::doFinalization(), llvm::Function::dropAllReferences(), llvm::SlotIndexes::dump(), llvm::SparseBitVector< ElementSize >::find_first(), llvm::Module::functions(), llvm::iplist< IVStrideUse >::getPrevNode(), llvm::ilist< IVStrideUse >::ilist(), llvm::iplist< IVStrideUse >::insertAfter(), llvm::MachineBasicBlock::instr_begin(), llvm::SparseBitVector< ElementSize >::intersects(), llvm::SparseBitVector< ElementSize >::intersectWithComplement(), LdStHasDebugValue(), llvm::iplist< IVStrideUse >::merge(), llvm::Module::named_metadata(), llvm::SparseBitVector< ElementSize >::operator&=(), llvm::SparseBitVector< ElementSize >::operator=(), llvm::SparseBitVector< ElementSize >::operator==(), llvm::SparseBitVector< ElementSize >::operator|=(), llvm::yaml::Scanner::peekNext(), llvm::iplist< IVStrideUse >::pop_front(), llvm::IVUsers::print(), llvm::iplist< IVStrideUse >::push_front(), llvm::iplist< IVStrideUse >::rend(), llvm::SlotIndexes::renumberIndexes(), llvm::SymbolTableListTraits< ValueSubClass >::setSymTabObject(), llvm::iplist< IVStrideUse >::size(), llvm::iplist< IVStrideUse >::sort(), llvm::SparseBitVector< ElementSize >::SparseBitVector(), and llvm::iplist< IVStrideUse >::splice().

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
const_iterator llvm::iplist< NodeTy, Traits >::begin ( ) const [inline]

Definition at line 412 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::clear ( ) [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::clearAndLeakNodesUnsafely ( ) [inline]

Remove all nodes from the list like clear(), but do not call removeNodeFromList() or deleteNode().

This should only be used immediately before freeing nodes in bulk to avoid traversing the list and bringing all the nodes into cache.

Definition at line 530 of file ilist.h.

Referenced by llvm::SlotIndexes::~SlotIndexes().

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
bool LLVM_ATTRIBUTE_UNUSED_RESULT llvm::iplist< NodeTy, Traits >::empty ( ) const [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
iterator llvm::iplist< NodeTy, Traits >::end ( ) [inline]

Definition at line 416 of file ilist.h.

Referenced by llvm::SelectionDAG::allnodes_end(), llvm::SelectionDAG::AssignTopologicalOrder(), llvm::iplist< IVStrideUse >::clear(), llvm::SparseBitVector< ElementSize >::count(), llvm::NVPTXAsmPrinter::doFinalization(), llvm::SlotIndexes::dump(), llvm::IVUsers::end(), llvm::MCSection::end(), llvm::BasicBlock::end(), llvm::MachineFunction::end(), llvm::AliasSetTracker::end(), llvm::Function::end(), llvm::iplist< IVStrideUse >::getNextNode(), llvm::SlotIndexes::getNextNonNullIndex(), llvm::ilist< IVStrideUse >::ilist(), llvm::MachineBasicBlock::instr_end(), llvm::SparseBitVector< ElementSize >::intersects(), llvm::SparseBitVector< ElementSize >::intersectWithComplement(), llvm::iplist< IVStrideUse >::merge(), llvm::SparseBitVector< ElementSize >::operator&=(), llvm::SparseBitVector< ElementSize >::operator=(), llvm::SparseBitVector< ElementSize >::operator==(), llvm::SparseBitVector< ElementSize >::operator|=(), llvm::iplist< IVStrideUse >::pop_back(), llvm::IVUsers::print(), llvm::iplist< IVStrideUse >::push_back(), llvm::iplist< IVStrideUse >::rbegin(), llvm::iplist< IVStrideUse >::remove(), llvm::SlotIndexes::renumberIndexes(), llvm::SparseBitVector< ElementSize >::reset(), llvm::SparseBitVector< ElementSize >::set(), llvm::SymbolTableListTraits< ValueSubClass >::setSymTabObject(), llvm::iplist< IVStrideUse >::size(), llvm::iplist< IVStrideUse >::sort(), llvm::SparseBitVector< ElementSize >::SparseBitVector(), llvm::iplist< IVStrideUse >::splice(), llvm::BasicBlock::splitBasicBlock(), and llvm::SparseBitVector< ElementSize >::test().

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
const_iterator llvm::iplist< NodeTy, Traits >::end ( ) const [inline]

Definition at line 420 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
iterator llvm::iplist< NodeTy, Traits >::erase ( iterator  where) [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
iterator llvm::iplist< NodeTy, Traits >::erase ( NodeTy *  IT) [inline]

Definition at line 522 of file ilist.h.

Referenced by llvm::iplist< IVStrideUse >::erase().

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
iterator llvm::iplist< NodeTy, Traits >::erase ( NodeTy &  IT) [inline]

Definition at line 523 of file ilist.h.

Referenced by llvm::iplist< IVStrideUse >::erase().

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
iterator llvm::iplist< NodeTy, Traits >::erase ( iterator  first,
iterator  last 
) [inline]

Definition at line 599 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
reference llvm::iplist< NodeTy, Traits >::front ( ) [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
const_reference llvm::iplist< NodeTy, Traits >::front ( ) const [inline]

Definition at line 443 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
NodeTy* llvm::iplist< NodeTy, Traits >::getNextNode ( NodeTy &  N) const [inline]

Get the next node, or nullptr for the list tail.

Definition at line 704 of file ilist.h.

Referenced by llvm::iplist< IVStrideUse >::getNextNode().

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
const NodeTy* llvm::iplist< NodeTy, Traits >::getNextNode ( const NodeTy &  N) const [inline]

Get the next node, or nullptr for the list tail.

Definition at line 711 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
NodeTy* llvm::iplist< NodeTy, Traits >::getPrevNode ( NodeTy &  N) const [inline]

Get the previous node, or nullptr for the list head.

Definition at line 692 of file ilist.h.

Referenced by llvm::iplist< IVStrideUse >::getPrevNode().

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
const NodeTy* llvm::iplist< NodeTy, Traits >::getPrevNode ( const NodeTy &  N) const [inline]

Get the previous node, or nullptr for the list head.

Definition at line 699 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
iterator llvm::iplist< NodeTy, Traits >::insert ( iterator  where,
NodeTy *  New 
) [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
template<class InIt >
void llvm::iplist< NodeTy, Traits >::insert ( iterator  where,
InIt  first,
InIt  last 
) [inline]

Definition at line 620 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
iterator llvm::iplist< NodeTy, Traits >::insertAfter ( iterator  where,
NodeTy *  New 
) [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
size_type llvm::iplist< NodeTy, Traits >::max_size ( ) const [inline]

Definition at line 433 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
template<class Compare >
void llvm::iplist< NodeTy, Traits >::merge ( iplist< NodeTy, Traits > &  Right,
Compare  comp 
) [inline]

Definition at line 645 of file ilist.h.

Referenced by llvm::iplist< IVStrideUse >::sort().

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::merge ( iplist< NodeTy, Traits > &  Right) [inline]

Definition at line 662 of file ilist.h.

Referenced by llvm::iplist< IVStrideUse >::merge().

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::pop_back ( ) [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::pop_front ( ) [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::push_back ( NodeTy *  val) [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::push_front ( NodeTy *  val) [inline]

Definition at line 608 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
reverse_iterator llvm::iplist< NodeTy, Traits >::rbegin ( ) [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
const_reverse_iterator llvm::iplist< NodeTy, Traits >::rbegin ( ) const [inline]

Definition at line 427 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
NodeTy* llvm::iplist< NodeTy, Traits >::remove ( iterator IT) [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
NodeTy* llvm::iplist< NodeTy, Traits >::remove ( const iterator IT) [inline]

Definition at line 508 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
NodeTy* llvm::iplist< NodeTy, Traits >::remove ( NodeTy *  IT) [inline]

Definition at line 513 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
NodeTy* llvm::iplist< NodeTy, Traits >::remove ( NodeTy &  IT) [inline]

Definition at line 514 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
reverse_iterator llvm::iplist< NodeTy, Traits >::rend ( ) [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
const_reverse_iterator llvm::iplist< NodeTy, Traits >::rend ( ) const [inline]

Definition at line 429 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
size_type LLVM_ATTRIBUTE_UNUSED_RESULT llvm::iplist< NodeTy, Traits >::size ( ) const [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
template<class Compare >
void llvm::iplist< NodeTy, Traits >::sort ( Compare  comp) [inline]

Definition at line 665 of file ilist.h.

Referenced by llvm::MachineFunction::sort(), and llvm::iplist< IVStrideUse >::sort().

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::sort ( ) [inline]

Definition at line 689 of file ilist.h.

Referenced by llvm::iplist< IVStrideUse >::sort().

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::splice ( iterator  where,
iplist< NodeTy, Traits > &  L2 
) [inline]
template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::splice ( iterator  where,
iplist< NodeTy, Traits > &  L2,
iterator  first 
) [inline]

Definition at line 629 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::splice ( iterator  where,
iplist< NodeTy, Traits > &  L2,
iterator  first,
iterator  last 
) [inline]

Definition at line 634 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::splice ( iterator  where,
iplist< NodeTy, Traits > &  L2,
NodeTy &  N 
) [inline]

Definition at line 637 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::splice ( iterator  where,
iplist< NodeTy, Traits > &  L2,
NodeTy *  N 
) [inline]

Definition at line 640 of file ilist.h.

template<typename NodeTy, typename Traits = ilist_traits<NodeTy>>
void llvm::iplist< NodeTy, Traits >::swap ( iplist< NodeTy, Traits > &  RHS) [inline]

Definition at line 456 of file ilist.h.

Referenced by llvm::iplist< IVStrideUse >::swap(), and std::swap().


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