Ghidra Decompiler Analysis Engine
Public Member Functions | Static Public Member Functions | List of all members
CoverBlock Class Reference

The topological scope of a variable within a basic block. More...

#include <cover.hh>

Public Member Functions

int4 intersect (const CoverBlock &op2) const
 Compute intersection with another CoverBlock. More...
 
bool contain (const PcodeOp *point) const
 Check containment of given point. More...
 
int4 boundary (const PcodeOp *point) const
 Characterize given point as boundary. More...
 
void merge (const CoverBlock &op2)
 Merge another CoverBlock into this. More...
 
void print (ostream &s) const
 Dump a description to stream. More...
 

Static Public Member Functions

static uintm getUIndex (const PcodeOp *op)
 Get the comparison index for a PcodeOp. More...
 

Detailed Description

The topological scope of a variable within a basic block.

Within a basic block, the topological scope of a variable can be considered a contiguous range of p-code operations. This range can be described with a start and stop PcodeOp object, indicating all p-code operations between the two inclusive. The start and stop may hold special encodings meaning:

Member Function Documentation

◆ boundary()

int4 CoverBlock::boundary ( const PcodeOp point) const

Characterize given point as boundary.

Return:

  • 0 if point not on boundary
  • 1 if on tail
  • 2 if on the defining point
Parameters
pointis the given PcodeOp point
Returns
the characterization

◆ contain()

bool CoverBlock::contain ( const PcodeOp point) const

Check containment of given point.

If the given PcodeOp or boundary point is contained in this range, return true.

Parameters
pointis the given PcodeOp
Returns
true if the point is contained

◆ getUIndex()

uintm CoverBlock::getUIndex ( const PcodeOp op)
static

Get the comparison index for a PcodeOp.

PcodeOp objects and a CoverBlock start/stop boundaries have a natural ordering that can be used to tell if a PcodeOp falls between boundary points and if CoverBlock objects intersect. Ordering is determined by comparing the values returned by this method.

Parameters
opis the PcodeOp and/or boundary point
Returns
a value for comparison

◆ intersect()

int4 CoverBlock::intersect ( const CoverBlock op2) const

Compute intersection with another CoverBlock.

Characterize the intersection of this range with another CoverBlock. Return:

  • 0 if there is no intersection
  • 1 if only the intersection is at boundary points
  • 2 if a whole interval intersects
Parameters
op2is the other CoverBlock to compare
Returns
the intersection characterization

◆ merge()

void CoverBlock::merge ( const CoverBlock op2)

Merge another CoverBlock into this.

Compute the union of this with the other given CoverBlock, replacing this in place.

Parameters
op2is the other given CoverBlock

◆ print()

void CoverBlock::print ( ostream &  s) const

Dump a description to stream.

Print a description of the covered range of ops in this block

Parameters
sis the output stream

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