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

A constraint like sink = operation(source) [l, u] Examples: unary instructions such as truncation, sign extensions, zero extensions. More...

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

Public Member Functions

 UnaryOpNode (const ValueRangeRef &intersect, VarNode *sink, const tree_nodeConstRef &inst, VarNode *source, kind opcode)
 
 ~UnaryOpNode () override=default
 
 UnaryOpNode (const UnaryOpNode &)=delete
 
 UnaryOpNode (UnaryOpNode &&)=delete
 
UnaryOpNodeoperator= (const UnaryOpNode &)=delete
 
UnaryOpNodeoperator= (UnaryOpNode &&)=delete
 
OperationId getValueId () const override
 
kind getOpcode () const
 Return the opcode of the operation. More...
 
VarNodegetSource () const
 Returns the source of the operation. More...
 
std::vector< tree_nodeConstRefgetSources () 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 (UnaryOpNode 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

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

Detailed Description

A constraint like sink = operation(source) [l, u] Examples: unary instructions such as truncation, sign extensions, zero extensions.

Definition at line 2531 of file Range_Analysis.cpp.

Constructor & Destructor Documentation

◆ UnaryOpNode() [1/3]

UnaryOpNode::UnaryOpNode ( const ValueRangeRef &  intersect,
VarNode sink,
const tree_nodeConstRef inst,
VarNode source,
kind  opcode 
)

Definition at line 2589 of file Range_Analysis.cpp.

Referenced by opCtorGenerator().

Here is the caller graph for this function:

◆ ~UnaryOpNode()

UnaryOpNode::~UnaryOpNode ( )
overridedefault

◆ UnaryOpNode() [2/3]

UnaryOpNode::UnaryOpNode ( const UnaryOpNode )
delete

◆ UnaryOpNode() [3/3]

UnaryOpNode::UnaryOpNode ( UnaryOpNode &&  )
delete

Member Function Documentation

◆ classof() [1/2]

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

Definition at line 2556 of file Range_Analysis.cpp.

◆ classof() [2/2]

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

Definition at line 2560 of file Range_Analysis.cpp.

References OpNode::getValueId(), OpNode::SigmaOpId, and OpNode::UnaryOpId.

Here is the call graph for this function:

◆ eval()

RangeRef UnaryOpNode::eval ( ) const
overrideprivatevirtual

◆ getOpcode()

kind UnaryOpNode::getOpcode ( ) const
inline

Return the opcode of the operation.

Definition at line 2566 of file Range_Analysis.cpp.

Referenced by eval(), and print().

Here is the caller graph for this function:

◆ getSource()

VarNode* UnaryOpNode::getSource ( ) const
inline

Returns the source of the operation.

Definition at line 2571 of file Range_Analysis.cpp.

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

Here is the caller graph for this function:

◆ getSources()

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

Implements OpNode.

Reimplemented in SigmaOpNode.

Definition at line 2575 of file Range_Analysis.cpp.

References VarNode::getValue(), PhiOpNode::opCtorGenerator(), PhiOpNode::print(), and PhiOpNode::printDot().

Referenced by SigmaOpNode::getSources().

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

◆ getValueId()

OperationId UnaryOpNode::getValueId ( ) const
inlineoverridevirtual

Implements OpNode.

Reimplemented in SigmaOpNode.

Definition at line 2552 of file Range_Analysis.cpp.

References OpNode::UnaryOpId.

Referenced by SigmaOpNode::classof().

Here is the caller graph for this function:

◆ opCtorGenerator()

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

Definition at line 2731 of file Range_Analysis.cpp.

References DEBUG_LEVEL_VERY_PEDANTIC, GET_CONST_NODE, INDENT_DBG_MEX, OpNode::sink, and UnaryOpNode().

Referenced by SigmaOpNode::markUnresolved(), and LoadOpNode::printDot().

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

UnaryOpNode& UnaryOpNode::operator= ( UnaryOpNode &&  )
delete

◆ print()

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

Prints the content of the operation.

Implements OpNode.

Reimplemented in SigmaOpNode.

Definition at line 2777 of file Range_Analysis.cpp.

References GET_CONST_NODE, getOpcode(), OpNode::getSink(), getSource(), and tree_node::GetString().

Referenced by SigmaOpNode::markUnresolved().

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

◆ printDot()

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

Implements OpNode.

Reimplemented in SigmaOpNode.

Definition at line 2783 of file Range_Analysis.cpp.

References GET_CONST_NODE, VarNode::getBitWidth(), tree_helper::GetConstValue(), OpNode::getIntersect(), OpNode::getSink(), getSource(), VarNode::getValue(), opcode, source, THROW_UNREACHABLE, and test_panda::type.

Referenced by SigmaOpNode::markUnresolved().

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

Field Documentation

◆ opcode

kind UnaryOpNode::opcode
private

Definition at line 2537 of file Range_Analysis.cpp.

Referenced by BinaryOpNode::getOpcode(), and printDot().

◆ source

VarNode* UnaryOpNode::source
private

Definition at line 2535 of file Range_Analysis.cpp.

Referenced by eval(), SigmaOpNode::opCtorGenerator(), and printDot().


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

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