PandA-2024.02
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes | Protected Member Functions | Private Attributes
OpNode Class Referenceabstract

This class represents a generic operation in our analysis. More...

Inheritance diagram for OpNode:
Inheritance graph
[legend]
Collaboration diagram for OpNode:
Collaboration graph
[legend]

Public Types

enum  OperationId {
  OperationId::UnaryOpId, OperationId::SigmaOpId, OperationId::BinaryOpId, OperationId::TernaryOpId,
  OperationId::PhiOpId, OperationId::ControlDepId, OperationId::LoadOpId, OperationId::StoreOpId
}
 

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
 
OpNodeoperator= (const OpNode &)=delete
 
OpNodeoperator= (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_nodeConstRefgetInstruction () 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...
 
VarNodegetSink () const
 Returns the target of the operation, that is, where the result will be stored. More...
 
virtual std::vector< tree_nodeConstRefgetSources () 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...
 
VarNodesink
 
const tree_nodeConstRef inst
 

Detailed Description

This class represents a generic operation in our analysis.

Definition at line 2038 of file Range_Analysis.cpp.

Member Enumeration Documentation

◆ OperationId

enum OpNode::OperationId
strong
Enumerator
UnaryOpId 
SigmaOpId 
BinaryOpId 
TernaryOpId 
PhiOpId 
ControlDepId 
LoadOpId 
StoreOpId 

Definition at line 2057 of file Range_Analysis.cpp.

Constructor & Destructor Documentation

◆ OpNode() [1/3]

OpNode::OpNode ( const ValueRangeRef &  _intersect,
VarNode _sink,
const tree_nodeConstRef _inst 
)
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.

◆ ~OpNode()

virtual OpNode::~OpNode ( )
virtualdefault

The dtor. It's virtual because this is a base class.

◆ OpNode() [2/3]

OpNode::OpNode ( const OpNode )
delete

◆ OpNode() [3/3]

OpNode::OpNode ( OpNode &&  )
delete

Member Function Documentation

◆ classof()

static bool OpNode::classof ( OpNode const *  )
inlinestatic

Definition at line 2083 of file Range_Analysis.cpp.

◆ eval()

virtual RangeRef OpNode::eval ( ) const
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().

Here is the caller graph for this function:

◆ getInstruction()

const tree_nodeConstRef& OpNode::getInstruction ( ) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIntersect()

ValueRangeConstRef OpNode::getIntersect ( ) const
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().

Here is the caller graph for this function:

◆ getSink()

VarNode* OpNode::getSink ( ) const
inline

◆ getSources()

virtual std::vector<tree_nodeConstRef> OpNode::getSources ( ) const
pure virtual

Implemented in ControlDepNode, LoadOpNode, TernaryOpNode, BinaryOpNode, SigmaOpNode, UnaryOpNode, and PhiOpNode.

Referenced by NodeContainer::pushOperation().

Here is the caller graph for this function:

◆ getValueId()

virtual OperationId OpNode::getValueId ( ) const
pure virtual

◆ operator=() [1/2]

OpNode& OpNode::operator= ( const OpNode )
delete

◆ operator=() [2/2]

OpNode& OpNode::operator= ( OpNode &&  )
delete

◆ print()

virtual void OpNode::print ( std::ostream &  OS) const
pure virtual

Prints the content of the operation.

Implemented in ControlDepNode, LoadOpNode, TernaryOpNode, BinaryOpNode, SigmaOpNode, UnaryOpNode, and PhiOpNode.

Referenced by PhiOpNode::classof(), and ToString().

Here is the caller graph for this function:

◆ printDot()

virtual void OpNode::printDot ( std::ostream &  OS) const
pure virtual

Implemented in ControlDepNode, LoadOpNode, TernaryOpNode, BinaryOpNode, SigmaOpNode, UnaryOpNode, and PhiOpNode.

Referenced by PhiOpNode::classof().

Here is the caller graph for this function:

◆ setIntersect()

void OpNode::setIntersect ( const RangeConstRef &  newIntersect)
inline

Changes the interval of the operation.

Definition at line 2104 of file Range_Analysis.cpp.

Referenced by solveFuture().

Here is the caller graph for this function:

◆ 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().

Here is the call graph for this function:

◆ ToString()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ __attribute__

enum OpNode::OperationId OpNode::__attribute__

◆ debug_level

int OpNode::debug_level = DEBUG_LEVEL_NONE
static

◆ inst

const tree_nodeConstRef OpNode::inst
private

Definition at line 2049 of file Range_Analysis.cpp.

◆ intersect

ValueRangeRef OpNode::intersect
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.

◆ sink

VarNode* OpNode::sink
private

The documentation for this class was generated from the following file:

Generated on Mon Feb 12 2024 13:03:59 for PandA-2024.02 by doxygen 1.8.13