Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
SVF::DOTGraphTraits< ICFG * > Struct Reference
Inheritance diagram for SVF::DOTGraphTraits< ICFG * >:
SVF::DOTGraphTraits< SVFIR * > SVF::DefaultDOTGraphTraits

Public Types

typedef ICFGNode NodeType
 

Public Member Functions

 DOTGraphTraits (bool isSimple=false)
 
std::string getNodeLabel (NodeType *node, ICFG *graph)
 
- Public Member Functions inherited from SVF::DOTGraphTraits< SVFIR * >
 DOTGraphTraits (bool simple=false)
 
- Public Member Functions inherited from SVF::DefaultDOTGraphTraits
 DefaultDOTGraphTraits (bool simple=false)
 
template<typename GraphType >
std::string getNodeLabel (const void *, const GraphType &)
 

Static Public Member Functions

static std::string getGraphName (ICFG *)
 Return name of the graph.
 
static std::string getSimpleNodeLabel (NodeType *node, ICFG *)
 Return the label of an ICFG node.
 
static bool isNodeHidden (ICFGNode *node, ICFG *)
 
static std::string getNodeAttributes (NodeType *node, ICFG *)
 
template<class EdgeIter >
static std::string getEdgeAttributes (NodeType *, EdgeIter EI, ICFG *)
 
template<class EdgeIter >
static std::string getEdgeSourceLabel (NodeType *, EdgeIter EI)
 
- Static Public Member Functions inherited from SVF::DefaultDOTGraphTraits
template<typename GraphType >
static std::string getGraphName (const GraphType &)
 
template<typename GraphType >
static std::string getGraphProperties (const GraphType &)
 
static bool renderGraphFromBottomUp ()
 
template<typename GraphType >
static bool isNodeHidden (const void *, const GraphType &)
 
template<typename GraphType >
static std::string getNodeIdentifierLabel (const void *, const GraphType &)
 
template<typename GraphType >
static std::string getNodeDescription (const void *, const GraphType &)
 
template<typename GraphType >
static std::string getNodeAttributes (const void *, const GraphType &)
 
template<typename EdgeIter , typename GraphType >
static std::string getEdgeAttributes (const void *, EdgeIter, const GraphType &)
 
template<typename EdgeIter >
static std::string getEdgeSourceLabel (const void *, EdgeIter)
 
template<typename EdgeIter >
static bool edgeTargetsEdgeSource (const void *, EdgeIter)
 
template<typename EdgeIter >
static EdgeIter getEdgeTarget (const void *, EdgeIter I)
 
static bool hasEdgeDestLabels ()
 
static unsigned numEdgeDestLabels (const void *)
 
static std::string getEdgeDestLabel (const void *, unsigned)
 
template<typename GraphType , typename GraphWriter >
static void addCustomGraphFeatures (const GraphType &, GraphWriter &)
 

Additional Inherited Members

- Protected Member Functions inherited from SVF::DefaultDOTGraphTraits
bool isSimple ()
 

Detailed Description

Definition at line 481 of file ICFG.cpp.

Member Typedef Documentation

◆ NodeType

Definition at line 484 of file ICFG.cpp.

Constructor & Destructor Documentation

◆ DOTGraphTraits()

SVF::DOTGraphTraits< ICFG * >::DOTGraphTraits ( bool  isSimple = false)
inline

Definition at line 485 of file ICFG.cpp.

485 :
487 {
488 }
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

Member Function Documentation

◆ getEdgeAttributes()

template<class EdgeIter >
static std::string SVF::DOTGraphTraits< ICFG * >::getEdgeAttributes ( NodeType ,
EdgeIter  EI,
ICFG  
)
inlinestatic

Definition at line 553 of file ICFG.cpp.

554 {
555 ICFGEdge* edge = *(EI.getCurrent());
556 assert(edge && "No edge found!!");
557 if (SVFUtil::isa<CallCFGEdge>(edge))
558 return "style=solid,color=red";
559 else if (SVFUtil::isa<RetCFGEdge>(edge))
560 return "style=solid,color=blue";
561 else
562 return "style=solid";
563 return "";
564 }

◆ getEdgeSourceLabel()

template<class EdgeIter >
static std::string SVF::DOTGraphTraits< ICFG * >::getEdgeSourceLabel ( NodeType ,
EdgeIter  EI 
)
inlinestatic

Definition at line 567 of file ICFG.cpp.

568 {
569 ICFGEdge* edge = *(EI.getCurrent());
570 assert(edge && "No edge found!!");
571
572 std::string str;
573 std::stringstream rawstr(str);
574 if (CallCFGEdge* dirCall = SVFUtil::dyn_cast<CallCFGEdge>(edge))
575 rawstr << dirCall->getSrcNode();
576 else if (RetCFGEdge* dirRet = SVFUtil::dyn_cast<RetCFGEdge>(edge))
577 {
578 if(RetICFGNode* ret = SVFUtil::dyn_cast<RetICFGNode>(dirRet->getDstNode()))
579 rawstr << ret->getCallICFGNode();
580 }
581
582 return rawstr.str();
583 }

◆ getGraphName()

static std::string SVF::DOTGraphTraits< ICFG * >::getGraphName ( ICFG )
inlinestatic

Return name of the graph.

Definition at line 491 of file ICFG.cpp.

492 {
493 return "ICFG";
494 }

◆ getNodeAttributes()

static std::string SVF::DOTGraphTraits< ICFG * >::getNodeAttributes ( NodeType node,
ICFG  
)
inlinestatic

Definition at line 515 of file ICFG.cpp.

516 {
517 std::string str;
518 std::stringstream rawstr(str);
519
520 rawstr << "shape=record";
521
522 if(SVFUtil::isa<IntraICFGNode>(node))
523 {
524 rawstr << ",color=black";
525 }
526 else if(SVFUtil::isa<FunEntryICFGNode>(node))
527 {
528 rawstr << ",color=yellow";
529 }
530 else if(SVFUtil::isa<FunExitICFGNode>(node))
531 {
532 rawstr << ",color=green";
533 }
534 else if(SVFUtil::isa<CallICFGNode>(node))
535 {
536 rawstr << ",color=red";
537 }
538 else if(SVFUtil::isa<RetICFGNode>(node))
539 {
540 rawstr << ",color=blue";
541 }
542 else if(SVFUtil::isa<GlobalICFGNode>(node))
543 {
544 rawstr << ",color=purple";
545 }
546 else
547 assert(false && "no such kind of node!!");
548
549 return rawstr.str();
550 }

◆ getNodeLabel()

std::string SVF::DOTGraphTraits< ICFG * >::getNodeLabel ( NodeType node,
ICFG graph 
)
inline

Definition at line 496 of file ICFG.cpp.

497 {
498 return getSimpleNodeLabel(node, graph);
499 }
static std::string getSimpleNodeLabel(NodeType *node, ICFG *)
Return the label of an ICFG node.
Definition ICFG.cpp:502

◆ getSimpleNodeLabel()

static std::string SVF::DOTGraphTraits< ICFG * >::getSimpleNodeLabel ( NodeType node,
ICFG  
)
inlinestatic

Return the label of an ICFG node.

Definition at line 502 of file ICFG.cpp.

503 {
504 return node->toString();
505 }

◆ isNodeHidden()

static bool SVF::DOTGraphTraits< ICFG * >::isNodeHidden ( ICFGNode node,
ICFG  
)
inlinestatic

Definition at line 507 of file ICFG.cpp.

508 {
510 return false;
511 else
512 return node->getInEdges().empty() && node->getOutEdges().empty();
513 }
const GEdgeSetTy & getOutEdges() const
const GEdgeSetTy & getInEdges() const
static const Option< bool > ShowHiddenNode
Definition Options.h:221

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