decompiler  1.0.0
Public Member Functions | Public Attributes | List of all members
ghidra::CommentSorter::Subsort Struct Reference

The sorting key for placing a Comment within a specific basic block. More...

Public Member Functions

bool operator< (const Subsort &op2) const
 Compare comments based on basic block, then position within the block. More...
 
void setHeader (uint4 headerType)
 Initialize a key for a header comment. More...
 
void setBlock (int4 i, uint4 ord)
 Initialize a key for a basic block position. More...
 

Public Attributes

int4 index
 Either the basic block index or -1 for a function header.
 
uint4 order
 The order index within the basic block.
 
uint4 pos
 A final count to guarantee a unique sorting.
 

Detailed Description

The sorting key for placing a Comment within a specific basic block.

Member Function Documentation

◆ operator<()

bool ghidra::CommentSorter::Subsort::operator< ( const Subsort op2) const
inline

Compare comments based on basic block, then position within the block.

Parameters
op2is the other key to compare with this
Returns
true if this gets ordered before the other key

References index, order, and pos.

◆ setBlock()

void ghidra::CommentSorter::Subsort::setBlock ( int4  i,
uint4  ord 
)
inline

Initialize a key for a basic block position.

Parameters
iis the index of the basic block
ordis the position within the block

Referenced by ghidra::CommentSorter::findPosition().

◆ setHeader()

void ghidra::CommentSorter::Subsort::setHeader ( uint4  headerType)
inline

Initialize a key for a header comment.

Parameters
headerTypecan be either header_basic or header_unplaced

Referenced by ghidra::CommentSorter::findPosition().


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