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 480 of file ICFG.cpp.

Member Typedef Documentation

◆ NodeType

Definition at line 483 of file ICFG.cpp.

Constructor & Destructor Documentation

◆ DOTGraphTraits()

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

Definition at line 484 of file ICFG.cpp.

484 :
486 {
487 }
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 552 of file ICFG.cpp.

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

◆ getEdgeSourceLabel()

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

Definition at line 566 of file ICFG.cpp.

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

◆ getGraphName()

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

Return name of the graph.

Definition at line 490 of file ICFG.cpp.

491 {
492 return "ICFG";
493 }

◆ getNodeAttributes()

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

Definition at line 514 of file ICFG.cpp.

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

◆ getNodeLabel()

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

Definition at line 495 of file ICFG.cpp.

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

◆ getSimpleNodeLabel()

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

Return the label of an ICFG node.

Definition at line 501 of file ICFG.cpp.

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

◆ isNodeHidden()

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

Definition at line 506 of file ICFG.cpp.

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

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