decompiler  1.0.0
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ghidra::BlockVarnode Class Reference

Helper class associating a Varnode with the block where it is defined. More...

#include <merge.hh>

Public Member Functions

void set (Varnode *v)
 Set this as representing the given Varnode. More...
 
bool operator< (const BlockVarnode &op2) const
 Comparator.
 
VarnodegetVarnode (void) const
 Get the Varnode represented by this.
 
int4 getIndex (void) const
 Get the Varnode's defining block index.
 

Static Public Member Functions

static int4 findFront (int4 blocknum, const vector< BlockVarnode > &list)
 Find the first Varnode defined in the BlockBasic of the given index. More...
 

Private Attributes

int4 index
 Index of BlockBasic defining Varnode.
 
Varnodevn
 The Varnode itself.
 

Detailed Description

Helper class associating a Varnode with the block where it is defined.

This class explicitly stores a Varnode with the index of the BlockBasic that defines it. If a Varnode does not have a defining PcodeOp it is assigned an index of 0. This facilitates quicker sorting of Varnodes based on their defining block.

Member Function Documentation

◆ findFront()

int4 ghidra::BlockVarnode::findFront ( int4  blocknum,
const vector< BlockVarnode > &  list 
)
static

Find the first Varnode defined in the BlockBasic of the given index.

A BlockVarnode is identified from a sorted list. The position of the first BlockVarnode in this list that has the given BlockBasic index is returned.

Parameters
blocknumis the index of the BlockBasic to search for
listis the sorted list of BlockVarnodes
Returns
the index of the BlockVarnode within the list or -1 if no Varnode in the block is found

References getIndex().

Referenced by ghidra::Merge::eliminateIntersect(), and getIndex().

◆ set()

void ghidra::BlockVarnode::set ( Varnode v)

Set this as representing the given Varnode.

This instance assumes the identity of the given Varnode and the defining index is cached to facilitate quick sorting.

Parameters
vis the given Varnode

References ghidra::Varnode::getDef(), ghidra::FlowBlock::getIndex(), ghidra::PcodeOp::getParent(), index, and vn.


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