My Project
|
All paths from a (putative) switch variable to the CPUI_BRANCHIND. More...
#include <jumptable.hh>
Public Member Functions | |
void | set (const PathMeld &op2) |
Copy paths from another container. More... | |
void | set (const vector< PcodeOp *> &path, const vector< int4 > &slot) |
Initialize this to be a single path. More... | |
void | set (PcodeOp *op, Varnode *vn) |
Initialize this container to a single node "path". More... | |
void | append (const PathMeld &op2) |
Append a new set of paths to this set of paths. More... | |
void | clear (void) |
Clear this to be an empty container. | |
void | meld (vector< PcodeOp *> &path, vector< int4 > &slot) |
Meld a new path into this container. More... | |
void | markPaths (bool val, int4 startVarnode) |
Mark PcodeOps paths from the given start. More... | |
int4 | numCommonVarnode (void) const |
Return the number of Varnodes common to all paths. | |
int4 | numOps (void) const |
Return the number of PcodeOps across all paths. | |
Varnode * | getVarnode (int4 i) const |
Get the i-th common Varnode. | |
Varnode * | getOpParent (int4 i) const |
Get the split-point for the i-th PcodeOp. | |
PcodeOp * | getOp (int4 i) const |
Get the i-th PcodeOp. | |
PcodeOp * | getEarliestOp (int4 pos) const |
Find earliest PcodeOp that has a specific common Varnode as input. More... | |
bool | empty (void) const |
Return true if this container holds no paths. | |
All paths from a (putative) switch variable to the CPUI_BRANCHIND.
This is a container for intersecting paths during the construction of a JumpModel. It contains every PcodeOp from some starting Varnode through all paths to a specific BRANCHIND. The paths can split and rejoin. This also keeps track of Varnodes that are present on all paths, as these are the potential switch variables for the model.
void PathMeld::append | ( | const PathMeld & | op2 | ) |
Append a new set of paths to this set of paths.
The new paths must all start at the common end-point of the paths in this container. The new set of melded paths start at the original common start point for this container, flow through this old common end-point, and end at the new common end-point.
op2 | is the set of paths to be appended |
PcodeOp * PathMeld::getEarliestOp | ( | int4 | pos | ) | const |
Find earliest PcodeOp that has a specific common Varnode as input.
The Varnode is specified by an index into sequence of Varnodes common to all paths in this PathMeld. We find the earliest (as in executed first) PcodeOp, within this PathMeld that uses the Varnode as input.
pos | is the index of the Varnode |
void PathMeld::markPaths | ( | bool | val, |
int4 | startVarnode | ||
) |
void PathMeld::meld | ( | vector< PcodeOp *> & | path, |
vector< int4 > & | slot | ||
) |
Meld a new path into this container.
Add the new path, recalculating the set of Varnodes common to all paths. Paths are trimmed to ensure that any path that splits from the common intersection must eventually rejoin.
path | is the new path of PcodeOps to meld, in reverse execution order |
slot | is the set of Varnodes in the new path presented as input slots to the corresponding PcodeOp |
void PathMeld::set | ( | const PathMeld & | op2 | ) |
Copy paths from another container.
op2 | is the path container to copy from |
void PathMeld::set | ( | const vector< PcodeOp *> & | path, |
const vector< int4 > & | slot | ||
) |