LLVM  8.0.1
Public Member Functions | List of all members
llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits > Class Template Reference

#include "llvm/ADT/IntervalMap.h"

Inheritance diagram for llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits >:
Inheritance graph
[legend]
Collaboration diagram for llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits >:
Collaboration graph
[legend]

Public Member Functions

const KeyT & start (unsigned i) const
 
const KeyT & stop (unsigned i) const
 
const ValT & value (unsigned i) const
 
KeyT & start (unsigned i)
 
KeyT & stop (unsigned i)
 
ValT & value (unsigned i)
 
unsigned findFrom (unsigned i, unsigned Size, KeyT x) const
 findFrom - Find the first interval after i that may contain x. More...
 
unsigned safeFind (unsigned i, KeyT x) const
 safeFind - Find an interval that is known to exist. More...
 
ValT safeLookup (KeyT x, ValT NotFound) const
 safeLookup - Lookup mapped value for a safe key. More...
 
unsigned insertFrom (unsigned &Pos, unsigned Size, KeyT a, KeyT b, ValT y)
 insertFrom - Add mapping of [a;b] to y if possible, coalescing as much as possible. More...
 
- Public Member Functions inherited from llvm::IntervalMapImpl::NodeBase< std::pair< KeyT, KeyT >, ValT, N >
void copy (const NodeBase< std::pair< KeyT, KeyT >, ValT, M > &Other, unsigned i, unsigned j, unsigned Count)
 copy - Copy elements from another node. More...
 
void moveLeft (unsigned i, unsigned j, unsigned Count)
 moveLeft - Move elements to the left. More...
 
void moveRight (unsigned i, unsigned j, unsigned Count)
 moveRight - Move elements to the right. More...
 
void erase (unsigned i, unsigned j, unsigned Size)
 erase - Erase elements [i;j). More...
 
void erase (unsigned i, unsigned Size)
 erase - Erase element at i. More...
 
void shift (unsigned i, unsigned Size)
 shift - Shift elements [i;size) 1 position to the right. More...
 
void transferToLeftSib (unsigned Size, NodeBase &Sib, unsigned SSize, unsigned Count)
 transferToLeftSib - Transfer elements to a left sibling node. More...
 
void transferToRightSib (unsigned Size, NodeBase &Sib, unsigned SSize, unsigned Count)
 transferToRightSib - Transfer elements to a right sibling node. More...
 
int adjustFromLeftSib (unsigned Size, NodeBase &Sib, unsigned SSize, int Add)
 adjustFromLeftSib - Adjust the number if elements in this node by moving elements to or from a left sibling node. More...
 

Additional Inherited Members

- Public Types inherited from llvm::IntervalMapImpl::NodeBase< std::pair< KeyT, KeyT >, ValT, N >
enum  
 
- Public Attributes inherited from llvm::IntervalMapImpl::NodeBase< std::pair< KeyT, KeyT >, ValT, N >
std::pair< KeyT, KeyT > first [N]
 
ValT second [N]
 

Detailed Description

template<typename KeyT, typename ValT, unsigned N, typename Traits>
class llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits >

Definition at line 564 of file IntervalMap.h.

Member Function Documentation

◆ findFrom()

template<typename KeyT , typename ValT , unsigned N, typename Traits >
unsigned llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits >::findFrom ( unsigned  i,
unsigned  Size,
KeyT  x 
) const
inline

findFrom - Find the first interval after i that may contain x.

Parameters
iStarting index for the search.
SizeNumber of elements in node.
xKey to search for.
Returns
First index with !stopLess(key[i].stop, x), or size. This is the first interval that can possibly contain x.

Definition at line 580 of file IntervalMap.h.

References assert(), and N.

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

◆ insertFrom()

template<typename KeyT , typename ValT , unsigned N, typename Traits >
unsigned llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits >::insertFrom ( unsigned Pos,
unsigned  Size,
KeyT  a,
KeyT  b,
ValT  y 
)

insertFrom - Add mapping of [a;b] to y if possible, coalescing as much as possible.

This may cause the node to grow by 1, or it may cause the node to shrink because of coalescing.

Parameters
PosStarting index = insertFrom(0, size, a)
SizeNumber of elements in node.
aInterval start.
bInterval stop.
yValue be mapped.
Returns
(insert position, new size), or (i, Capacity+1) on overflow.

Definition at line 628 of file IntervalMap.h.

References assert(), N, and Size.

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

◆ safeFind()

template<typename KeyT , typename ValT , unsigned N, typename Traits >
unsigned llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits >::safeFind ( unsigned  i,
KeyT  x 
) const
inline

safeFind - Find an interval that is known to exist.

This is the same as findFrom except is it assumed that x is at least within range of the last interval.

Parameters
iStarting index for the search.
xKey to search for.
Returns
First index with !stopLess(key[i].stop, x), never size. This is the first interval that can possibly contain x.

Definition at line 595 of file IntervalMap.h.

References assert(), and N.

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

◆ safeLookup()

template<typename KeyT , typename ValT , unsigned N, typename Traits >
ValT llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits >::safeLookup ( KeyT  x,
ValT  NotFound 
) const
inline

safeLookup - Lookup mapped value for a safe key.

It is assumed that x is within range of the last entry.

Parameters
xKey to search for.
NotFoundValue to return if x is not in any interval.
Returns
The mapped value at x or NotFound.

Definition at line 609 of file IntervalMap.h.

References llvm::LegalizeActions::NotFound, and Size.

◆ start() [1/2]

template<typename KeyT , typename ValT , unsigned N, typename Traits >
const KeyT& llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits >::start ( unsigned  i) const
inline

◆ start() [2/2]

template<typename KeyT , typename ValT , unsigned N, typename Traits >
KeyT& llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits >::start ( unsigned  i)
inline

Definition at line 570 of file IntervalMap.h.

References first.

◆ stop() [1/2]

template<typename KeyT , typename ValT , unsigned N, typename Traits >
const KeyT& llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits >::stop ( unsigned  i) const
inline

◆ stop() [2/2]

template<typename KeyT , typename ValT , unsigned N, typename Traits >
KeyT& llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits >::stop ( unsigned  i)
inline

Definition at line 571 of file IntervalMap.h.

References first.

◆ value() [1/2]

template<typename KeyT , typename ValT , unsigned N, typename Traits >
const ValT& llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits >::value ( unsigned  i) const
inline

◆ value() [2/2]

template<typename KeyT , typename ValT , unsigned N, typename Traits >
ValT& llvm::IntervalMapImpl::LeafNode< KeyT, ValT, N, Traits >::value ( unsigned  i)
inline

Definition at line 572 of file IntervalMap.h.

References second.


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