Static Value-Flow Analysis
Public Member Functions | Private Attributes | List of all members
SVF::WTO< GraphT >::WTOCycleDepthBuilder Class Referencefinal

Visitor to build the cycle depths of each node. More...

#include <WTO.h>

Inheritance diagram for SVF::WTO< GraphT >::WTOCycleDepthBuilder:
SVF::WTOComponentVisitor< GraphT >

Public Member Functions

 WTOCycleDepthBuilder (NodeRefToWTOCycleDepthPtr &nodeToWTOCycleDepth)
 
void visit (const WTOCycleT &cycle) override
 Visit the given cycle. More...
 
void visit (const WTONodeT &node) override
 Visit the given node. More...
 
- Public Member Functions inherited from SVF::WTOComponentVisitor< GraphT >
 WTOComponentVisitor ()=default
 Default constructor. More...
 
 WTOComponentVisitor (const WTOComponentVisitor &) noexcept=default
 Copy constructor. More...
 
 WTOComponentVisitor (WTOComponentVisitor &&) noexcept=default
 Move constructor. More...
 
WTOComponentVisitoroperator= (const WTOComponentVisitor &) noexcept=default
 Copy assignment operator. More...
 
WTOComponentVisitoroperator= (WTOComponentVisitor &&) noexcept=default
 Move assignment operator. More...
 
virtual ~WTOComponentVisitor ()=default
 Destructor. More...
 

Private Attributes

WTOCycleDepthPtr _wtoCycleDepth
 
NodeRefToWTOCycleDepthPtr_nodeToWTOCycleDepth
 

Additional Inherited Members

- Public Types inherited from SVF::WTOComponentVisitor< GraphT >
typedef WTONode< GraphT > WTONodeT
 
typedef WTOCycle< GraphT > WTOCycleT
 

Detailed Description

template<typename GraphT>
class SVF::WTO< GraphT >::WTOCycleDepthBuilder

Visitor to build the cycle depths of each node.

Definition at line 685 of file WTO.h.

Constructor & Destructor Documentation

◆ WTOCycleDepthBuilder()

template<typename GraphT >
SVF::WTO< GraphT >::WTOCycleDepthBuilder::WTOCycleDepthBuilder ( NodeRefToWTOCycleDepthPtr nodeToWTOCycleDepth)
inlineexplicit

Definition at line 692 of file WTO.h.

694  : _wtoCycleDepth(std::make_shared<GraphTWTOCycleDepth>()),
695  _nodeToWTOCycleDepth(nodeToWTOCycleDepth)
696  {
697  }
NodeRefToWTOCycleDepthPtr & _nodeToWTOCycleDepth
Definition: WTO.h:689
WTOCycleDepthPtr _wtoCycleDepth
Definition: WTO.h:688

Member Function Documentation

◆ visit() [1/2]

template<typename GraphT >
void SVF::WTO< GraphT >::WTOCycleDepthBuilder::visit ( const WTOCycleT )
inlineoverridevirtual

Visit the given cycle.

Implements SVF::WTOComponentVisitor< GraphT >.

Definition at line 699 of file WTO.h.

700  {
701  const NodeT* head = cycle.head()->getICFGNode();
702  WTOCycleDepthPtr previous_cycleDepth = _wtoCycleDepth;
703  _nodeToWTOCycleDepth.insert(std::make_pair(head, _wtoCycleDepth));
705  std::make_shared<GraphTWTOCycleDepth>(*_wtoCycleDepth);
706  _wtoCycleDepth->add(head);
707  for (auto it = cycle.begin(), et = cycle.end(); it != et; ++it)
708  {
709  (*it)->accept(*this);
710  }
711  _wtoCycleDepth = previous_cycleDepth;
712  }
GraphT::NodeType NodeT
Definition: WTO.h:521
std::shared_ptr< GraphTWTOCycleDepth > WTOCycleDepthPtr
Definition: WTO.h:542

◆ visit() [2/2]

template<typename GraphT >
void SVF::WTO< GraphT >::WTOCycleDepthBuilder::visit ( const WTONodeT )
inlineoverridevirtual

Visit the given node.

Implements SVF::WTOComponentVisitor< GraphT >.

Definition at line 714 of file WTO.h.

715  {
716  _nodeToWTOCycleDepth.insert(
717  std::make_pair(node.getICFGNode(), _wtoCycleDepth));
718  }

Member Data Documentation

◆ _nodeToWTOCycleDepth

template<typename GraphT >
NodeRefToWTOCycleDepthPtr& SVF::WTO< GraphT >::WTOCycleDepthBuilder::_nodeToWTOCycleDepth
private

Definition at line 689 of file WTO.h.

◆ _wtoCycleDepth

template<typename GraphT >
WTOCycleDepthPtr SVF::WTO< GraphT >::WTOCycleDepthBuilder::_wtoCycleDepth
private

Definition at line 688 of file WTO.h.


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