decompiler
1.0.0
|
The topological scope of a variable within a basic block. More...
#include <cover.hh>
Public Member Functions | |
CoverBlock (void) | |
Construct empty/uncovered block. | |
const PcodeOp * | getStart (void) const |
Get the start of the range. | |
const PcodeOp * | getStop (void) const |
Get the end of the range. | |
void | clear (void) |
Clear this block to empty/uncovered. | |
void | setAll (void) |
Mark whole block as covered. | |
void | setBegin (const PcodeOp *begin) |
Reset start of range. | |
void | setEnd (const PcodeOp *end) |
Reset end of range. | |
int4 | intersect (const CoverBlock &op2) const |
Compute intersection with another CoverBlock. More... | |
bool | empty (void) const |
Return true if this is empty/uncovered. | |
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... | |
Private Attributes | |
const PcodeOp * | start |
Beginning of the range. | |
const PcodeOp * | stop |
End of the range. | |
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:
int4 CoverBlock::boundary | ( | const PcodeOp * | point | ) | const |
Characterize given point as boundary.
Return:
point | is the given PcodeOp point |
References empty(), getUIndex(), start, and stop.
Referenced by Merge::collectCorrectable().
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.
point | is the given PcodeOp |
References empty(), getUIndex(), start, and stop.
Referenced by Merge::collectCovering(), and merge().
|
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.
op | is the PcodeOp and/or boundary point |
References PcodeOp::code(), CPUI_INDIRECT, CPUI_MULTIEQUAL, Varnode::getAddr(), PcodeOp::getIn(), PcodeOp::getOpFromConst(), SeqNum::getOrder(), PcodeOp::getSeqNum(), and PcodeOp::isMarker().
Referenced by Cover::addRefPoint(), Cover::addRefRecurse(), boundary(), Merge::collectCorrectable(), contain(), intersect(), merge(), and print().
int4 CoverBlock::intersect | ( | const CoverBlock & | op2 | ) | const |
Compute intersection with another CoverBlock.
Characterize the intersection of this range with another CoverBlock. Return:
op2 | is the other CoverBlock to compare |
References empty(), getUIndex(), start, and stop.
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.
op2 | is the other given CoverBlock |
References contain(), empty(), getUIndex(), setAll(), start, and stop.
void CoverBlock::print | ( | ostream & | s | ) | const |
Dump a description to stream.
Print a description of the covered range of ops in this block
s | is the output stream |
References empty(), PcodeOp::getSeqNum(), getUIndex(), start, and stop.