LLDB  mainline
Public Member Functions | Private Attributes | List of all members
lldb_private::HTRBlockLayer Class Reference

HTR layer composed of blocks of the trace. More...

#include <TraceHTR.h>

Inheritance diagram for lldb_private::HTRBlockLayer:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::HTRBlockLayer:
Collaboration graph
[legend]

Public Member Functions

 HTRBlockLayer (size_t id)
 Construct new block layer. More...
 
size_t GetNumUnits () const override
 Get the total number of units (instruction or block) in this layer. More...
 
HTRBlockMetadata GetMetadataByIndex (size_t index) const override
 Get the metadata of a unit (instruction or block) in the layer. More...
 
const HTRBlockGetBlockById (size_t block_id) const
 Get an HTRBlock from its block id. More...
 
llvm::ArrayRef< size_t > GetBlockIdTrace () const
 Get the block ID trace for this layer. More...
 
void AppendNewBlock (size_t block_id, HTRBlock &&block)
 Appends a new block to the layer. More...
 
void AppendRepeatedBlock (size_t block_id)
 Appends a repeated block to the layer. More...
 
- Public Member Functions inherited from lldb_private::IHTRLayer
 IHTRLayer (size_t id)
 Construct new HTR layer. More...
 
size_t GetLayerId () const
 Get the ID of the layer. More...
 
HTRBlock MergeUnits (size_t start_unit_index, size_t num_units)
 Creates a new block from the result of merging a contiguous sequence of "units" (instructions or blocks depending on layer type) in this layer This allows the implementation class to decide how to store/generate this metadata. More...
 
virtual ~IHTRLayer ()=default
 

Private Attributes

std::unordered_map< size_t, HTRBlockm_block_defs
 Maps a unique Block ID to the corresponding HTRBlock. More...
 
std::vector< size_t > m_block_id_trace
 Reduce memory footprint by just storing a trace of block IDs and use m_block_defs to map a block_id to its corresponding HTRBlock. More...
 

Additional Inherited Members

- Protected Attributes inherited from lldb_private::IHTRLayer
size_t m_layer_id
 ID of the layer. More...
 

Detailed Description

HTR layer composed of blocks of the trace.

See lldb/docs/htr.rst for comprehensive HTR documentation

Definition at line 244 of file TraceHTR.h.

Constructor & Destructor Documentation

◆ HTRBlockLayer()

lldb_private::HTRBlockLayer::HTRBlockLayer ( size_t  id)
inline

Construct new block layer.

Parameters
[in]idThe layer's id.

Definition at line 250 of file TraceHTR.h.

Member Function Documentation

◆ AppendNewBlock()

void HTRBlockLayer::AppendNewBlock ( size_t  block_id,
HTRBlock &&  block 
)

Appends a new block to the layer.

Parameters
[in]block_idThe block id of the new block.
[in]blockThe new HTRBlock to be appended to the layer. This block is moved into the layer.

Definition at line 69 of file TraceHTR.cpp.

◆ AppendRepeatedBlock()

void HTRBlockLayer::AppendRepeatedBlock ( size_t  block_id)

Appends a repeated block to the layer.

Parameters
[in]block_idThe block id of the repeated block.

Definition at line 74 of file TraceHTR.cpp.

◆ GetBlockById()

const HTRBlock * HTRBlockLayer::GetBlockById ( size_t  block_id) const

Get an HTRBlock from its block id.

Parameters
[in]block_idThe id of the block to retrieve.
Returns
The HTRBlock with the specified id, nullptr if no there is no block in the layer with the specified block id.

Definition at line 91 of file TraceHTR.cpp.

◆ GetBlockIdTrace()

llvm::ArrayRef< size_t > HTRBlockLayer::GetBlockIdTrace ( ) const

Get the block ID trace for this layer.

This block ID trace stores the block ID of each block that occured in the trace and the block defs map maps block ID to the corresponding HTRBlock.

Returns
The block ID trace for this layer.

Definition at line 99 of file TraceHTR.cpp.

◆ GetMetadataByIndex()

HTRBlockMetadata HTRBlockLayer::GetMetadataByIndex ( size_t  index) const
overridevirtual

Get the metadata of a unit (instruction or block) in the layer.

Parameters
[in]indexThe position of the unit in the layer.
Returns
The metadata of the unit in the layer.

Implements lldb_private::IHTRLayer.

Definition at line 122 of file TraceHTR.cpp.

References lldb_private::HTRBlock::GetMetadata().

◆ GetNumUnits()

size_t HTRBlockLayer::GetNumUnits ( ) const
overridevirtual

Get the total number of units (instruction or block) in this layer.

Returns
The total number of units in the layer.

Implements lldb_private::IHTRLayer.

Definition at line 103 of file TraceHTR.cpp.

Member Data Documentation

◆ m_block_defs

std::unordered_map<size_t, HTRBlock> lldb_private::HTRBlockLayer::m_block_defs
private

Maps a unique Block ID to the corresponding HTRBlock.

Definition at line 293 of file TraceHTR.h.

◆ m_block_id_trace

std::vector<size_t> lldb_private::HTRBlockLayer::m_block_id_trace
private

Reduce memory footprint by just storing a trace of block IDs and use m_block_defs to map a block_id to its corresponding HTRBlock.

Definition at line 296 of file TraceHTR.h.


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