|
decompiler 1.0.0
|
A p-code expression tree. More...
#include <pcodecompile.hh>
Public Member Functions | |
| ExprTree (void) | |
| Construct an empty expression. | |
| ExprTree (VarnodeTpl *vn) | |
| Construct an expression with a single VarnodeTpl. More... | |
| ~ExprTree (void) | |
| Destructor. | |
| void | setOutput (VarnodeTpl *newout) |
| Force the output of the expression to be a new VarnodeTpl. More... | |
| VarnodeTpl * | getOut (void) |
| Get the root VarnodeTpl. | |
| const ConstTpl & | getSize (void) const |
| Get the size of the root VarnodeTpl. | |
Static Public Member Functions | |
| static vector< OpTpl * > * | appendParams (OpTpl *op, vector< ExprTree * > *param) |
| Create a new raw expression by appending an array of VarnodeTpl, as inputs, to a new root OpTpl. More... | |
| static vector< OpTpl * > * | toVector (ExprTree *expr) |
| Convert an expression to a raw array of OpTpl. More... | |
Private Attributes | |
| vector< OpTpl * > * | ops |
| Flattened ops making up the expression. | |
| VarnodeTpl * | outvn |
| Root VarnodeTpl: Copy of the output from the final OpTpl (or NULL) | |
Friends | |
| class | PcodeCompile |
A p-code expression tree.
A single connected tree of OpTpl and VarnodeTpl nodes, with either a root VarnodeTpl or a root OpTpl with no output. The OpTpl are stored in the flattened order the will be emitted as.
| ghidra::ExprTree::ExprTree | ( | VarnodeTpl * | vn | ) |
Construct an expression with a single VarnodeTpl.
| vn | is the expression root |
|
static |
Create a new raw expression by appending an array of VarnodeTpl, as inputs, to a new root OpTpl.
The OpTpl may already have inputs. The root VarnodeTpl from each ExprTree passed in is appended to the list of input parameters of the OpTpl, creating a single new expression. The original ExprTrees and their container are all destroyed. The new expression is returned, in raw form, as a flattened array of OpTpl.
| op | is the new root OpTpl |
| param | is the list of expressions, each with a root VarnodeTpl |
References ghidra::OpTpl::addInput(), and outvn.
Referenced by ghidra::SleighCompile::createMacroUse(), ghidra::PcodeCompile::createUserOpNoOut(), and ghidra::PcodeCompile::createVariadic().
| void ghidra::ExprTree::setOutput | ( | VarnodeTpl * | newout | ) |
Force the output of the expression to be a new VarnodeTpl.
| newout | is the new output being forced |
References ghidra::OpTpl::addInput(), ghidra::OpTpl::clearOutput(), ghidra::CPUI_COPY, ghidra::VarnodeTpl::isUnnamed(), ops, outvn, and ghidra::OpTpl::setOutput().
Referenced by ghidra::PcodeCompile::newOutput().