LLVM  6.0.0svn
Classes | Public Member Functions | List of all members
llvm::IntervalMapImpl::Path Class Reference

#include "llvm/ADT/IntervalMap.h"

Public Member Functions

template<typename NodeT >
NodeT & node (unsigned Level) const
 
unsigned size (unsigned Level) const
 
unsigned offset (unsigned Level) const
 
unsignedoffset (unsigned Level)
 
template<typename NodeT >
NodeT & leaf () const
 
unsigned leafSize () const
 
unsigned leafOffset () const
 
unsignedleafOffset ()
 
bool valid () const
 valid - Return true if path is at a valid node, not at end(). More...
 
unsigned height () const
 height - Return the height of the tree corresponding to this path. More...
 
NodeRefsubtree (unsigned Level) const
 subtree - Get the subtree referenced from Level. More...
 
void reset (unsigned Level)
 reset - Reset cached information about node(Level) from subtree(Level -1). More...
 
void push (NodeRef Node, unsigned Offset)
 push - Add entry to path. More...
 
void pop ()
 pop - Remove the last path entry. More...
 
void setSize (unsigned Level, unsigned Size)
 setSize - Set the size of a node both in the path and in the tree. More...
 
void setRoot (void *Node, unsigned Size, unsigned Offset)
 setRoot - Clear the path and set a new root node. More...
 
void replaceRoot (void *Root, unsigned Size, IdxPair Offsets)
 replaceRoot - Replace the current root node with two new entries after the tree height has increased. More...
 
NodeRef getLeftSibling (unsigned Level) const
 getLeftSibling - Get the left sibling node at Level, or a null NodeRef. More...
 
void moveLeft (unsigned Level)
 moveLeft - Move path to the left sibling at Level. More...
 
void fillLeft (unsigned Height)
 fillLeft - Grow path to Height by taking leftmost branches. More...
 
NodeRef getRightSibling (unsigned Level) const
 getLeftSibling - Get the left sibling node at Level, or a null NodeRef. More...
 
void moveRight (unsigned Level)
 moveRight - Move path to the left sibling at Level. More...
 
bool atBegin () const
 atBegin - Return true if path is at begin(). More...
 
bool atLastEntry (unsigned Level) const
 atLastEntry - Return true if the path is at the last entry of the node at Level. More...
 
void legalizeForInsert (unsigned Level)
 legalizeForInsert - Prepare the path for an insertion at Level. More...
 

Detailed Description

Definition at line 770 of file IntervalMap.h.

Member Function Documentation

◆ atBegin()

bool llvm::IntervalMapImpl::Path::atBegin ( ) const
inline

◆ atLastEntry()

bool llvm::IntervalMapImpl::Path::atLastEntry ( unsigned  Level) const
inline

atLastEntry - Return true if the path is at the last entry of the node at Level.

Parameters
LevelNode to examine.

Definition at line 907 of file IntervalMap.h.

References llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by getRightSibling(), moveRight(), llvm::IntervalMap< KeyT, ValT, N, Traits >::iterator::operator--(), and llvm::IntervalMap< KeyT, ValT, N, Traits >::iterator::setValue().

◆ fillLeft()

void llvm::IntervalMapImpl::Path::fillLeft ( unsigned  Height)
inline

fillLeft - Grow path to Height by taking leftmost branches.

Parameters
HeightThe target height.

Definition at line 881 of file IntervalMap.h.

Referenced by llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::goToBegin().

◆ getLeftSibling()

NodeRef llvm::IntervalMapImpl::Path::getLeftSibling ( unsigned  Level) const

getLeftSibling - Get the left sibling node at Level, or a null NodeRef.

Parameters
LevelGet the sibling to node(Level).
Returns
Left sibling, or NodeRef().

Definition at line 25 of file IntervalMap.cpp.

References offset(), llvm::IntervalMapImpl::NodeRef::size(), and llvm::IntervalMapImpl::NodeRef::subtree().

◆ getRightSibling()

NodeRef llvm::IntervalMapImpl::Path::getRightSibling ( unsigned  Level) const

getLeftSibling - Get the left sibling node at Level, or a null NodeRef.

Parameters
LevelGet the sinbling to node(Level).
Returns
Left sibling, or NodeRef().

Definition at line 75 of file IntervalMap.cpp.

References atLastEntry(), offset(), and llvm::IntervalMapImpl::NodeRef::subtree().

◆ height()

unsigned llvm::IntervalMapImpl::Path::height ( ) const
inline

height - Return the height of the tree corresponding to this path.

This matches map->height in a full path.

Definition at line 816 of file IntervalMap.h.

References llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by moveLeft().

◆ leaf()

template<typename NodeT >
NodeT& llvm::IntervalMapImpl::Path::leaf ( ) const
inline

◆ leafOffset() [1/2]

unsigned llvm::IntervalMapImpl::Path::leafOffset ( ) const
inline

◆ leafOffset() [2/2]

unsigned& llvm::IntervalMapImpl::Path::leafOffset ( )
inline

◆ leafSize()

unsigned llvm::IntervalMapImpl::Path::leafSize ( ) const
inline

◆ legalizeForInsert()

void llvm::IntervalMapImpl::Path::legalizeForInsert ( unsigned  Level)
inline

legalizeForInsert - Prepare the path for an insertion at Level.

When the path is at end(), node(Level) may not be a legal node. legalizeForInsert ensures that node(Level) is real by moving back to the last node at Level, and setting offset(Level) to size(Level) if required.

Parameters
LevelThe level where an insertion is about to take place.

Definition at line 916 of file IntervalMap.h.

References N.

Referenced by llvm::IntervalMap< KeyT, ValT, N, Traits >::iterator::setValue().

◆ moveLeft()

void llvm::IntervalMapImpl::Path::moveLeft ( unsigned  Level)

moveLeft - Move path to the left sibling at Level.

Leave nodes below Level unaltered.

Parameters
LevelMove node(Level).

Definition at line 48 of file IntervalMap.cpp.

References assert(), height(), offset(), llvm::SmallVectorImpl< T >::resize(), llvm::IntervalMapImpl::NodeRef::size(), llvm::IntervalMapImpl::NodeRef::subtree(), subtree(), and valid().

Referenced by llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::operator--().

◆ moveRight()

void llvm::IntervalMapImpl::Path::moveRight ( unsigned  Level)

moveRight - Move path to the left sibling at Level.

Leave nodes below Level unaltered.

Parameters
LevelMove node(Level).

Definition at line 98 of file IntervalMap.cpp.

References assert(), atLastEntry(), offset(), size(), llvm::IntervalMapImpl::NodeRef::subtree(), and subtree().

Referenced by llvm::IntervalMap< KeyT, ValT, N, Traits >::iterator::erase(), and llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::operator++().

◆ node()

template<typename NodeT >
NodeT& llvm::IntervalMapImpl::Path::node ( unsigned  Level) const
inline

◆ offset() [1/2]

unsigned llvm::IntervalMapImpl::Path::offset ( unsigned  Level) const
inline

◆ offset() [2/2]

unsigned& llvm::IntervalMapImpl::Path::offset ( unsigned  Level)
inline

Definition at line 799 of file IntervalMap.h.

◆ pop()

void llvm::IntervalMapImpl::Path::pop ( )
inline

pop - Remove the last path entry.

Definition at line 839 of file IntervalMap.h.

References llvm::SmallVectorTemplateBase< T, isPodLike >::pop_back().

◆ push()

void llvm::IntervalMapImpl::Path::push ( NodeRef  Node,
unsigned  Offset 
)
inline

push - Add entry to path.

Parameters
NodeNode to add, should be subtree(path.size()-1).
OffsetOffset into Node.

Definition at line 834 of file IntervalMap.h.

References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

◆ replaceRoot()

void llvm::IntervalMapImpl::Path::replaceRoot ( void *  Root,
unsigned  Size,
IdxPair  Offsets 
)

replaceRoot - Replace the current root node with two new entries after the tree height has increased.

Parameters
RootThe new root node.
SizeNumber of entries in the new root.
OffsetsOffsets into the root and first branch nodes.

Definition at line 19 of file IntervalMap.cpp.

References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T, typename >::front(), llvm::SmallVectorImpl< T >::insert(), and subtree().

Referenced by llvm::IntervalMap< KeyT, ValT, N, Traits >::iterator::insert(), and llvm::IntervalMap< KeyT, ValT, N, Traits >::iterator::setValue().

◆ reset()

void llvm::IntervalMapImpl::Path::reset ( unsigned  Level)
inline

reset - Reset cached information about node(Level) from subtree(Level -1).

Parameters
Level1..height. THe node to update after parent node changed.

Definition at line 827 of file IntervalMap.h.

Referenced by llvm::IntervalMap< KeyT, ValT, N, Traits >::iterator::erase(), and llvm::IntervalMap< KeyT, ValT, N, Traits >::iterator::setValue().

◆ setRoot()

void llvm::IntervalMapImpl::Path::setRoot ( void *  Node,
unsigned  Size,
unsigned  Offset 
)
inline

setRoot - Clear the path and set a new root node.

Parameters
NodeNew root node.
SizeNew root size.
OffsetOffset into root node.

Definition at line 857 of file IntervalMap.h.

References llvm::SmallVectorImpl< T >::clear(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size.

Referenced by llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::setRoot().

◆ setSize()

void llvm::IntervalMapImpl::Path::setSize ( unsigned  Level,
unsigned  Size 
)
inline

setSize - Set the size of a node both in the path and in the tree.

Parameters
Level0..height. Note that setting the root size won't change map->rootSize.
SizeNew node size.

Definition at line 847 of file IntervalMap.h.

References llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size.

Referenced by llvm::IntervalMap< KeyT, ValT, N, Traits >::iterator::erase(), llvm::IntervalMap< KeyT, ValT, N, Traits >::iterator::insert(), and llvm::IntervalMap< KeyT, ValT, N, Traits >::iterator::setValue().

◆ size()

unsigned llvm::IntervalMapImpl::Path::size ( unsigned  Level) const
inline

◆ subtree()

NodeRef& llvm::IntervalMapImpl::Path::subtree ( unsigned  Level) const
inline

subtree - Get the subtree referenced from Level.

When the path is consistent, node(Level + 1) == subtree(Level).

Parameters
Level0..height-1. The leaves have no subtrees.

Definition at line 821 of file IntervalMap.h.

Referenced by moveLeft(), moveRight(), and replaceRoot().

◆ valid()

bool llvm::IntervalMapImpl::Path::valid ( ) const
inline

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