PandA-2024.02
|
This class represents a generic operation in our analysis. More...
Public Member Functions | |
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 |
virtual OperationId | getValueId () const =0 |
virtual RangeRef | eval () const =0 |
Given the input of the operation and the operation that will be performed, evaluates the result of the operation. More... | |
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... | |
virtual std::vector< tree_nodeConstRef > | getSources () const =0 |
virtual void | print (std::ostream &OS) const =0 |
Prints the content of the operation. More... | |
virtual void | printDot (std::ostream &OS) const =0 |
std::string | ToString () const |
Static Public Member Functions | |
static bool | classof (OpNode const *) |
Data Fields | |
enum OpNode::OperationId | __attribute__ |
Static Public Attributes | |
static int | debug_level = DEBUG_LEVEL_NONE |
Protected Member Functions | |
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... | |
Private Attributes | |
ValueRangeRef | intersect |
The range of the operation. More... | |
VarNode * | sink |
const tree_nodeConstRef | inst |
This class represents a generic operation in our analysis.
Definition at line 2038 of file Range_Analysis.cpp.
|
strong |
Enumerator | |
---|---|
UnaryOpId | |
SigmaOpId | |
BinaryOpId | |
TernaryOpId | |
PhiOpId | |
ControlDepId | |
LoadOpId | |
StoreOpId |
Definition at line 2057 of file Range_Analysis.cpp.
|
protected |
We do not want people creating objects of this class, but we want to inherit from it.
We can not want people creating objects of this class, but we want to inherit of it.
Definition at line 2129 of file Range_Analysis.cpp.
|
virtualdefault |
The dtor. It's virtual because this is a base class.
|
delete |
|
delete |
Definition at line 2083 of file Range_Analysis.cpp.
|
pure virtual |
Given the input of the operation and the operation that will be performed, evaluates the result of the operation.
Implemented in ControlDepNode, LoadOpNode, TernaryOpNode, BinaryOpNode, SigmaOpNode, UnaryOpNode, and PhiOpNode.
Referenced by Meet::crop(), Meet::fixed(), Meet::growth(), Meet::narrow(), and Meet::widen().
|
inline |
Return the instruction that originated this op node.
Definition at line 2092 of file Range_Analysis.cpp.
References SymbRange::solveFuture().
Referenced by Meet::crop(), TernaryOpNode::eval(), Meet::fixed(), Meet::growth(), Meet::narrow(), and Meet::widen().
|
inline |
Returns the range of the operation.
Definition at line 2099 of file Range_Analysis.cpp.
Referenced by PhiOpNode::eval(), UnaryOpNode::eval(), SigmaOpNode::eval(), BinaryOpNode::eval(), TernaryOpNode::eval(), LoadOpNode::eval(), UnaryOpNode::printDot(), SigmaOpNode::printDot(), and solveFuture().
|
inline |
Returns the target of the operation, that is, where the result will be stored.
Definition at line 2110 of file Range_Analysis.cpp.
References debug_level, DEBUG_LEVEL_NONE, SymbRange::print(), and ValueRange::ToString().
Referenced by Meet::crop(), PhiOpNode::eval(), UnaryOpNode::eval(), BinaryOpNode::eval(), TernaryOpNode::eval(), LoadOpNode::eval(), Meet::fixed(), Meet::growth(), Meet::narrow(), PhiOpNode::print(), UnaryOpNode::print(), SigmaOpNode::print(), BinaryOpNode::print(), TernaryOpNode::print(), LoadOpNode::print(), PhiOpNode::printDot(), UnaryOpNode::printDot(), SigmaOpNode::printDot(), BinaryOpNode::printDot(), TernaryOpNode::printDot(), LoadOpNode::printDot(), NodeContainer::pushOperation(), solveFuture(), and Meet::widen().
|
pure virtual |
Implemented in ControlDepNode, LoadOpNode, TernaryOpNode, BinaryOpNode, SigmaOpNode, UnaryOpNode, and PhiOpNode.
Referenced by NodeContainer::pushOperation().
|
pure virtual |
Implemented in ControlDepNode, LoadOpNode, TernaryOpNode, BinaryOpNode, SigmaOpNode, UnaryOpNode, and PhiOpNode.
Referenced by PhiOpNode::classof(), UnaryOpNode::classof(), SigmaOpNode::classof(), BinaryOpNode::classof(), TernaryOpNode::classof(), LoadOpNode::classof(), and ControlDepNode::classof().
|
pure virtual |
Prints the content of the operation.
Implemented in ControlDepNode, LoadOpNode, TernaryOpNode, BinaryOpNode, SigmaOpNode, UnaryOpNode, and PhiOpNode.
Referenced by PhiOpNode::classof(), and ToString().
|
pure virtual |
Implemented in ControlDepNode, LoadOpNode, TernaryOpNode, BinaryOpNode, SigmaOpNode, UnaryOpNode, and PhiOpNode.
Referenced by PhiOpNode::classof().
|
inline |
Changes the interval of the operation.
Definition at line 2104 of file Range_Analysis.cpp.
Referenced by solveFuture().
void OpNode::solveFuture | ( | VarNode * | future | ) |
Replace symbolic intervals with hard-wired constants.
Definition at line 2134 of file Range_Analysis.cpp.
References getIntersect(), getSink(), and setIntersect().
std::string OpNode::ToString | ( | ) | const |
Definition at line 2142 of file Range_Analysis.cpp.
References print().
Referenced by BinaryOpNode::BinaryOpNode(), PhiOpNode::eval(), UnaryOpNode::eval(), SigmaOpNode::eval(), BinaryOpNode::eval(), TernaryOpNode::eval(), LoadOpNode::eval(), PhiOpNode::print(), and TernaryOpNode::TernaryOpNode().
enum OpNode::OperationId OpNode::__attribute__ |
|
static |
Definition at line 2070 of file Range_Analysis.cpp.
Referenced by PhiOpNode::eval(), UnaryOpNode::eval(), SigmaOpNode::eval(), BinaryOpNode::eval(), TernaryOpNode::eval(), LoadOpNode::eval(), BinaryOpNode::evaluate(), evaluateBranch(), and getSink().
|
private |
Definition at line 2049 of file Range_Analysis.cpp.
|
private |
The range of the operation.
Each operation has a range associated to it. This range is obtained by inspecting the branches in the source program and extracting its condition and intervals.
Definition at line 2044 of file Range_Analysis.cpp.
|
private |
Definition at line 2047 of file Range_Analysis.cpp.
Referenced by PhiOpNode::opCtorGenerator(), UnaryOpNode::opCtorGenerator(), SigmaOpNode::opCtorGenerator(), BinaryOpNode::opCtorGenerator(), TernaryOpNode::opCtorGenerator(), and LoadOpNode::opCtorGenerator().