LLVM  14.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::jitlink::BlockAddressMap Class Reference

Enables easy lookup of blocks by addresses. More...

#include "llvm/ExecutionEngine/JITLink/JITLink.h"

Public Types

using AddrToBlockMap = std::map< JITTargetAddress, Block * >
 
using const_iterator = AddrToBlockMap::const_iterator
 

Public Member Functions

 BlockAddressMap ()=default
 
template<typename PredFn = decltype(includeAllBlocks)>
Error addBlock (Block &B, PredFn Pred=includeAllBlocks)
 Add a block to the map. More...
 
void addBlockWithoutChecking (Block &B)
 Add a block to the map without checking for overlap with existing blocks. More...
 
template<typename BlockPtrRange , typename PredFn = decltype(includeAllBlocks)>
Error addBlocks (BlockPtrRange &&Blocks, PredFn Pred=includeAllBlocks)
 Add a range of blocks to the map. More...
 
template<typename BlockPtrRange >
void addBlocksWithoutChecking (BlockPtrRange &&Blocks)
 Add a range of blocks to the map without checking for overlap with existing blocks. More...
 
const_iterator begin () const
 Iterates over (Address, Block*) pairs in ascending order of address. More...
 
const_iterator end () const
 
BlockgetBlockAt (JITTargetAddress Addr) const
 Returns the block starting at the given address, or nullptr if no such block exists. More...
 
BlockgetBlockCovering (JITTargetAddress Addr) const
 Returns the block covering the given address, or nullptr if no such block exists. More...
 

Static Public Member Functions

static bool includeAllBlocks (const Block &B)
 A block predicate that always adds all blocks. More...
 
static bool includeNonNull (const Block &B)
 A block predicate that always includes blocks with non-null addresses. More...
 

Detailed Description

Enables easy lookup of blocks by addresses.

Definition at line 1378 of file JITLink.h.

Member Typedef Documentation

◆ AddrToBlockMap

Definition at line 1380 of file JITLink.h.

◆ const_iterator

using llvm::jitlink::BlockAddressMap::const_iterator = AddrToBlockMap::const_iterator

Definition at line 1381 of file JITLink.h.

Constructor & Destructor Documentation

◆ BlockAddressMap()

llvm::jitlink::BlockAddressMap::BlockAddressMap ( )
default

Member Function Documentation

◆ addBlock()

template<typename PredFn = decltype(includeAllBlocks)>
Error llvm::jitlink::BlockAddressMap::addBlock ( Block B,
PredFn  Pred = includeAllBlocks 
)
inline

Add a block to the map.

Returns an error if the block overlaps with any existing block.

Definition at line 1394 of file JITLink.h.

References B, I, and llvm::Error::success().

◆ addBlocks()

template<typename BlockPtrRange , typename PredFn = decltype(includeAllBlocks)>
Error llvm::jitlink::BlockAddressMap::addBlocks ( BlockPtrRange &&  Blocks,
PredFn  Pred = includeAllBlocks 
)
inline

Add a range of blocks to the map.

Returns an error if any block in the range overlaps with any other block in the range, or with any existing block in the map.

Definition at line 1429 of file JITLink.h.

References B.

◆ addBlocksWithoutChecking()

template<typename BlockPtrRange >
void llvm::jitlink::BlockAddressMap::addBlocksWithoutChecking ( BlockPtrRange &&  Blocks)
inline

Add a range of blocks to the map without checking for overlap with existing blocks.

The client is responsible for ensuring that the block added does not overlap with any existing block.

Definition at line 1440 of file JITLink.h.

References addBlockWithoutChecking(), and B.

◆ addBlockWithoutChecking()

void llvm::jitlink::BlockAddressMap::addBlockWithoutChecking ( Block B)
inline

Add a block to the map without checking for overlap with existing blocks.

The client is responsible for ensuring that the block added does not overlap with any existing block.

Definition at line 1422 of file JITLink.h.

References B.

Referenced by addBlocksWithoutChecking().

◆ begin()

const_iterator llvm::jitlink::BlockAddressMap::begin ( ) const
inline

Iterates over (Address, Block*) pairs in ascending order of address.

Definition at line 1446 of file JITLink.h.

◆ end()

const_iterator llvm::jitlink::BlockAddressMap::end ( ) const
inline

Definition at line 1447 of file JITLink.h.

◆ getBlockAt()

Block* llvm::jitlink::BlockAddressMap::getBlockAt ( JITTargetAddress  Addr) const
inline

Returns the block starting at the given address, or nullptr if no such block exists.

Definition at line 1451 of file JITLink.h.

References Addr, and I.

◆ getBlockCovering()

Block* llvm::jitlink::BlockAddressMap::getBlockCovering ( JITTargetAddress  Addr) const
inline

Returns the block covering the given address, or nullptr if no such block exists.

Definition at line 1460 of file JITLink.h.

References Addr, B, and I.

◆ includeAllBlocks()

static bool llvm::jitlink::BlockAddressMap::includeAllBlocks ( const Block B)
inlinestatic

A block predicate that always adds all blocks.

Definition at line 1384 of file JITLink.h.

◆ includeNonNull()

static bool llvm::jitlink::BlockAddressMap::includeNonNull ( const Block B)
inlinestatic

A block predicate that always includes blocks with non-null addresses.

Definition at line 1387 of file JITLink.h.

References B.


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