PandA-2024.02
|
A constraint like sink = source1 operation source2 intersect [l, u]. More...
Public Member Functions | |
BinaryOpNode (const ValueRangeRef &intersect, VarNode *sink, const tree_nodeConstRef &inst, VarNode *source1, VarNode *source2, kind opcode) | |
~BinaryOpNode () override=default | |
BinaryOpNode (const BinaryOpNode &)=delete | |
BinaryOpNode (BinaryOpNode &&)=delete | |
BinaryOpNode & | operator= (const BinaryOpNode &)=delete |
BinaryOpNode & | operator= (BinaryOpNode &&)=delete |
OperationId | getValueId () const override |
kind | getOpcode () const |
Return the opcode of the operation. More... | |
VarNode * | getSource1 () const |
Returns the first operand of this operation. More... | |
VarNode * | getSource2 () const |
Returns the second operand of this operation. More... | |
std::vector< tree_nodeConstRef > | getSources () const override |
void | print (std::ostream &OS) const override |
Prints the content of the operation. More... | |
void | printDot (std::ostream &OS) const override |
Public Member Functions inherited from OpNode | |
virtual | ~OpNode ()=default |
The dtor. It's virtual because this is a base class. More... | |
OpNode (const OpNode &)=delete | |
OpNode (OpNode &&)=delete | |
OpNode & | operator= (const OpNode &)=delete |
OpNode & | operator= (OpNode &&)=delete |
const tree_nodeConstRef & | getInstruction () const |
Return the instruction that originated this op node. More... | |
void | solveFuture (VarNode *future) |
Replace symbolic intervals with hard-wired constants. More... | |
ValueRangeConstRef | getIntersect () const |
Returns the range of the operation. More... | |
void | setIntersect (const RangeConstRef &newIntersect) |
Changes the interval of the operation. More... | |
VarNode * | getSink () const |
Returns the target of the operation, that is, where the result will be stored. More... | |
std::string | ToString () const |
Static Public Member Functions | |
static bool | classof (BinaryOpNode const *) |
static bool | classof (OpNode const *BO) |
static RangeRef | evaluate (kind opcode, bw_t bw, const RangeConstRef &op1, const RangeConstRef &op2, bool opSigned) |
static std::function< OpNode *(NodeContainer *)> | opCtorGenerator (const tree_nodeConstRef &stmt, unsigned int, const FunctionBehaviorConstRef &FB, const tree_managerConstRef &TM, const application_managerRef &AppM) |
Static Public Member Functions inherited from OpNode | |
static bool | classof (OpNode const *) |
Private Member Functions | |
RangeRef | eval () const override |
Computes the interval of the sink based on the interval of the sources, the operation and the interval associated to the operation. More... | |
Private Attributes | |
VarNode * | source1 |
VarNode * | source2 |
kind | opcode |
Additional Inherited Members | |
Public Types inherited from OpNode | |
enum | OperationId { OperationId::UnaryOpId, OperationId::SigmaOpId, OperationId::BinaryOpId, OperationId::TernaryOpId, OperationId::PhiOpId, OperationId::ControlDepId, OperationId::LoadOpId, OperationId::StoreOpId } |
Data Fields inherited from OpNode | |
enum OpNode::OperationId | __attribute__ |
Static Public Attributes inherited from OpNode | |
static int | debug_level = DEBUG_LEVEL_NONE |
Protected Member Functions inherited from OpNode | |
OpNode (const ValueRangeRef &intersect, VarNode *sink, const tree_nodeConstRef &inst) | |
We do not want people creating objects of this class, but we want to inherit from it. More... | |
A constraint like sink = source1 operation source2 intersect [l, u].
Definition at line 3074 of file Range_Analysis.cpp.
BinaryOpNode::BinaryOpNode | ( | const ValueRangeRef & | intersect, |
VarNode * | sink, | ||
const tree_nodeConstRef & | inst, | ||
VarNode * | source1, | ||
VarNode * | source2, | ||
kind | opcode | ||
) |
Definition at line 3142 of file Range_Analysis.cpp.
References GET_CONST_NODE, VarNode::getValue(), THROW_ASSERT, and OpNode::ToString().
Referenced by opCtorGenerator().
|
overridedefault |
|
delete |
|
delete |
|
inlinestatic |
Definition at line 3101 of file Range_Analysis.cpp.
Definition at line 3105 of file Range_Analysis.cpp.
References OpNode::BinaryOpId, and OpNode::getValueId().
|
overrideprivatevirtual |
Computes the interval of the sink based on the interval of the sources, the operation and the interval associated to the operation.
Basically, this function performs the operation indicated in its opcode taking as its operands the source1 and the source2.
Implements OpNode.
Definition at line 3336 of file Range_Analysis.cpp.
References bitstring_to_string(), OpNode::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, Empty, evaluate(), GET_CONST_NODE, VarNode::getBitWidth(), OpNode::getIntersect(), getOpcode(), VarNode::getRange(), OpNode::getSink(), getSource1(), getSource2(), tree_node::GetString(), INDENT_DBG_MEX, Regular, result, STR, test(), THROW_ASSERT, OpNode::ToString(), and Unknown.
|
static |
Definition at line 3150 of file Range_Analysis.cpp.
References add(), CASE_CPP_NODES, CASE_CST_NODES, CASE_DECL_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_MISCELLANEOUS, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, OpNode::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, tree_node::GetString(), INDENT_DBG_MEX, RETURN_DISABLED_OPTION, shl(), shr(), and THROW_UNREACHABLE.
Referenced by eval(), and evaluateBranch().
|
inline |
Return the opcode of the operation.
Definition at line 3113 of file Range_Analysis.cpp.
References UnaryOpNode::opcode.
Referenced by eval(), and print().
|
inline |
Returns the first operand of this operation.
Definition at line 3118 of file Range_Analysis.cpp.
Referenced by eval(), print(), and printDot().
|
inline |
Returns the second operand of this operation.
Definition at line 3123 of file Range_Analysis.cpp.
Referenced by eval(), print(), and printDot().
|
inlineoverridevirtual |
Implements OpNode.
Definition at line 3127 of file Range_Analysis.cpp.
References VarNode::getValue(), SigmaOpNode::opCtorGenerator(), SigmaOpNode::print(), and SigmaOpNode::printDot().
|
inlineoverridevirtual |
Implements OpNode.
Definition at line 3097 of file Range_Analysis.cpp.
References OpNode::BinaryOpId.
|
static |
Definition at line 3432 of file Range_Analysis.cpp.
References BinaryOpNode(), DEBUG_LEVEL_VERY_PEDANTIC, GET_CONST_NODE, tree_node::GetString(), INDENT_DBG_MEX, and OpNode::sink.
Referenced by TernaryOpNode::getSources(), and LoadOpNode::printDot().
|
delete |
|
delete |
|
overridevirtual |
Prints the content of the operation.
Implements OpNode.
Definition at line 3466 of file Range_Analysis.cpp.
References GET_CONST_NODE, getOpcode(), OpNode::getSink(), getSource1(), getSource2(), and tree_node::GetString().
Referenced by TernaryOpNode::getSources().
|
overridevirtual |
Implements OpNode.
Definition at line 3473 of file Range_Analysis.cpp.
References GET_CONST_NODE, tree_helper::GetConstValue(), OpNode::getSink(), getSource1(), getSource2(), tree_node::GetString(), VarNode::getValue(), and opcode.
Referenced by TernaryOpNode::getSources().
|
private |
Definition at line 3082 of file Range_Analysis.cpp.
Referenced by TernaryOpNode::getOpcode(), and printDot().
|
private |
Definition at line 3078 of file Range_Analysis.cpp.
Referenced by TernaryOpNode::getSource1().
|
private |
Definition at line 3080 of file Range_Analysis.cpp.
Referenced by TernaryOpNode::getSource2().