LLDB mainline
Public Member Functions | Protected Attributes | List of all members
lldb_private::IHTRLayer Class Referenceabstract

HTR layer interface See lldb/docs/htr.rst for comprehensive HTR documentation. More...

#include <TraceHTR.h>

Inheritance diagram for lldb_private::IHTRLayer:
Inheritance graph
[legend]

Public Member Functions

 IHTRLayer (size_t id)
 Construct new HTR layer.
 
size_t GetLayerId () const
 Get the ID of the layer.
 
virtual HTRBlockMetadata GetMetadataByIndex (size_t index) const =0
 Get the metadata of a unit (instruction or block) in the layer.
 
virtual size_t GetNumUnits () const =0
 Get the total number of units (instruction or block) in this layer.
 
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.
 
virtual ~IHTRLayer ()=default
 

Protected Attributes

size_t m_layer_id
 ID of the layer.
 

Detailed Description

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

Definition at line 138 of file TraceHTR.h.

Constructor & Destructor Documentation

◆ IHTRLayer()

lldb_private::IHTRLayer::IHTRLayer ( size_t  id)
inline

Construct new HTR layer.

Parameters
[in]idThe layer's id.

Definition at line 144 of file TraceHTR.h.

◆ ~IHTRLayer()

virtual lldb_private::IHTRLayer::~IHTRLayer ( )
virtualdefault

Member Function Documentation

◆ GetLayerId()

size_t IHTRLayer::GetLayerId ( ) const

Get the ID of the layer.

Returns
The layer ID of this layer.

Definition at line 68 of file TraceHTR.cpp.

References m_layer_id.

Referenced by lldb_private::BasicSuperBlockMerge(), and lldb_private::toJSON().

◆ GetMetadataByIndex()

virtual HTRBlockMetadata lldb_private::IHTRLayer::GetMetadataByIndex ( size_t  index) const
pure virtual

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.

Implemented in lldb_private::HTRInstructionLayer, and lldb_private::HTRBlockLayer.

Referenced by lldb_private::BasicSuperBlockMerge(), and MergeUnits().

◆ GetNumUnits()

virtual size_t lldb_private::IHTRLayer::GetNumUnits ( ) const
pure virtual

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

Returns
The total number of units in the layer.

Implemented in lldb_private::HTRInstructionLayer, and lldb_private::HTRBlockLayer.

Referenced by lldb_private::BasicSuperBlockMerge(), and lldb_private::TraceHTR::ExecutePasses().

◆ MergeUnits()

HTRBlock IHTRLayer::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.

For example, in the case of the instruction layer we want to lazily generate this metadata instead of storing it for each instruction.

Parameters
[in]start_unit_indexThe index of the first unit to be merged.
[in]num_unitsThe number of units to be merged. Must be >= 1, since merging 0 blocks does not make sense.
Returns
A new block instance representing the merge of the specified units.

Definition at line 200 of file TraceHTR.cpp.

References GetMetadataByIndex(), and lldb_private::HTRBlockMetadata::MergeMetadata().

Referenced by lldb_private::BasicSuperBlockMerge().

Member Data Documentation

◆ m_layer_id

size_t lldb_private::IHTRLayer::m_layer_id
protected

ID of the layer.

Definition at line 188 of file TraceHTR.h.

Referenced by GetLayerId().


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