decompiler  1.0.0
Public Member Functions | Public Attributes | List of all members
ghidra::TraceDAG::BadEdgeScore Struct Reference

Record for scoring a BlockTrace for suitability as an unstructured branch. More...

Public Member Functions

bool compareFinal (const BadEdgeScore &op2) const
 Compare BadEdgeScore for unstructured suitability. More...
 
bool operator< (const BadEdgeScore &op2) const
 Compare for grouping. More...
 

Public Attributes

FlowBlockexitproto
 Putative exit block for the BlockTrace.
 
BlockTracetrace
 The active BlockTrace being considered.
 
int4 distance
 Minimum distance crossed by this and any other BlockTrace sharing same exit block.
 
int4 terminal
 1 if BlockTrace destination has no exit, 0 otherwise
 
int4 siblingedge
 Number of active BlockTraces with same BranchPoint and exit as this.
 

Detailed Description

Record for scoring a BlockTrace for suitability as an unstructured branch.

This class holds various metrics about BlockTraces that are used to sort them.

Member Function Documentation

◆ compareFinal()

bool ghidra::TraceDAG::BadEdgeScore::compareFinal ( const BadEdgeScore op2) const

Compare BadEdgeScore for unstructured suitability.

Parameters
op2is the other BadEdgeScore to compare with this
Returns
true if this is LESS likely to be the bad edge than op2

References ghidra::TraceDAG::BranchPoint::depth, distance, siblingedge, terminal, ghidra::TraceDAG::BlockTrace::top, and trace.

◆ operator<()

bool ghidra::TraceDAG::BadEdgeScore::operator< ( const BadEdgeScore op2) const

Compare for grouping.

Comparator for grouping BlockTraces with the same exit block and parent BranchPoint

Parameters
op2is the other BadEdgeScore to compare to
Returns
true is this should be ordered before op2

References exitproto, ghidra::FlowBlock::getIndex(), ghidra::TraceDAG::BlockTrace::pathout, ghidra::TraceDAG::BranchPoint::top, ghidra::TraceDAG::BlockTrace::top, and trace.


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