PandA-2024.02
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PhiOpNode Class Reference

A constraint like sink = phi(src1, src2, ..., srcN) More...

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

Public Member Functions

 PhiOpNode (const ValueRangeRef &intersect, VarNode *sink, const tree_nodeConstRef &inst)
 
 ~PhiOpNode () override=default
 
 PhiOpNode (const PhiOpNode &)=delete
 
 PhiOpNode (PhiOpNode &&)=delete
 
PhiOpNodeoperator= (const PhiOpNode &)=delete
 
PhiOpNodeoperator= (PhiOpNode &&)=delete
 
void addSource (const VarNode *newsrc)
 Add source to the vector of sources. More...
 
const VarNodegetSource (size_t index) const
 Return source identified by index. More...
 
size_t getNumSources () const
 return the number of sources More...
 
std::vector< tree_nodeConstRefgetSources () const override
 
OperationId getValueId () 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
 
OpNodeoperator= (const OpNode &)=delete
 
OpNodeoperator= (OpNode &&)=delete
 
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...
 
std::string ToString () const
 

Static Public Member Functions

static bool classof (PhiOpNode const *)
 
static bool classof (OpNode const *BO)
 
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

std::vector< const VarNode * > sources
 

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

Detailed Description

A constraint like sink = phi(src1, src2, ..., srcN)

Definition at line 2346 of file Range_Analysis.cpp.

Constructor & Destructor Documentation

◆ PhiOpNode() [1/3]

PhiOpNode::PhiOpNode ( const ValueRangeRef &  intersect,
VarNode sink,
const tree_nodeConstRef inst 
)

Definition at line 2411 of file Range_Analysis.cpp.

Referenced by opCtorGenerator().

Here is the caller graph for this function:

◆ ~PhiOpNode()

PhiOpNode::~PhiOpNode ( )
overridedefault

◆ PhiOpNode() [2/3]

PhiOpNode::PhiOpNode ( const PhiOpNode )
delete

◆ PhiOpNode() [3/3]

PhiOpNode::PhiOpNode ( PhiOpNode &&  )
delete

Member Function Documentation

◆ addSource()

void PhiOpNode::addSource ( const VarNode newsrc)
inline

Add source to the vector of sources.

Definition at line 2364 of file Range_Analysis.cpp.

◆ classof() [1/2]

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

Definition at line 2392 of file Range_Analysis.cpp.

◆ classof() [2/2]

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

Definition at line 2396 of file Range_Analysis.cpp.

References OpNode::getValueId(), OpNode::PhiOpId, OpNode::print(), and OpNode::printDot().

Here is the call graph for this function:

◆ eval()

RangeRef PhiOpNode::eval ( ) const
overrideprivatevirtual

Computes the interval of the sink based on the interval of the sources, the operation and the interval associated to the operation.

Computes the interval of the sink based on the interval of the sources.

The result of evaluating a phi-function is the union of the ranges of every variable used in the phi.

Implements OpNode.

Definition at line 2419 of file Range_Analysis.cpp.

References OpNode::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, Empty, GET_CONST_NODE, OpNode::getIntersect(), OpNode::getSink(), INDENT_DBG_MEX, result, sources, test(), THROW_ASSERT, and OpNode::ToString().

Here is the call graph for this function:

◆ getNumSources()

size_t PhiOpNode::getNumSources ( ) const
inline

return the number of sources

Definition at line 2374 of file Range_Analysis.cpp.

◆ getSource()

const VarNode* PhiOpNode::getSource ( size_t  index) const
inline

Return source identified by index.

Definition at line 2369 of file Range_Analysis.cpp.

References index.

◆ getSources()

std::vector<tree_nodeConstRef> PhiOpNode::getSources ( ) const
inlineoverridevirtual

Implements OpNode.

Definition at line 2379 of file Range_Analysis.cpp.

◆ getValueId()

OperationId PhiOpNode::getValueId ( ) const
inlineoverridevirtual

Implements OpNode.

Definition at line 2388 of file Range_Analysis.cpp.

References OpNode::PhiOpId.

◆ opCtorGenerator()

std::function< OpNode *(NodeContainer *)> PhiOpNode::opCtorGenerator ( const tree_nodeConstRef stmt,
unsigned int  function_id,
const FunctionBehaviorConstRef FB,
const tree_managerConstRef TM,
const application_managerRef AppM 
)
static

Definition at line 2452 of file Range_Analysis.cpp.

References DEBUG_LEVEL_VERY_PEDANTIC, GET_CONST_NODE, INDENT_DBG_MEX, phi, PhiOpNode(), OpNode::sink, and STR.

Referenced by UnaryOpNode::getSources(), and LoadOpNode::printDot().

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

PhiOpNode& PhiOpNode::operator= ( PhiOpNode &&  )
delete

◆ print()

void PhiOpNode::print ( std::ostream &  OS) const
overridevirtual

Prints the content of the operation.

Implements OpNode.

Definition at line 2488 of file Range_Analysis.cpp.

References GET_CONST_NODE, OpNode::getSink(), sources, and OpNode::ToString().

Referenced by UnaryOpNode::getSources().

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

◆ printDot()

void PhiOpNode::printDot ( std::ostream &  OS) const
overridevirtual

Implements OpNode.

Definition at line 2499 of file Range_Analysis.cpp.

References GET_CONST_NODE, tree_helper::GetConstValue(), OpNode::getSink(), VarNode::getValue(), and sources.

Referenced by UnaryOpNode::getSources().

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

Field Documentation

◆ sources

std::vector<const VarNode*> PhiOpNode::sources
private

Definition at line 2350 of file Range_Analysis.cpp.

Referenced by eval(), print(), and printDot().


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

Generated on Mon Feb 12 2024 13:04:00 for PandA-2024.02 by doxygen 1.8.13