Static Value-Flow Analysis
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
CHG.cpp File Reference
#include "Graphs/CHG.h"
#include "Util/SVFUtil.h"
#include "Graphs/ICFG.h"
#include "SVFIR/SVFIR.h"

Go to the source code of this file.

Classes

struct  SVF::DOTGraphTraits< CHGraph * >
 

Namespaces

namespace  SVF
 for isBitcode
 

Functions

static bool hasEdge (const CHNode *src, const CHNode *dst, CHEdge::CHEDGETYPE et)
 
static bool checkArgTypes (const CallICFGNode *cs, const SVFFunction *fn)
 

Function Documentation

◆ checkArgTypes()

static bool checkArgTypes ( const CallICFGNode cs,
const SVFFunction fn 
)
static

Definition at line 53 of file CHG.cpp.

54{
55
56 // here we skip the first argument (i.e., this pointer)
57 u32_t arg_size = (fn->arg_size() > cs->arg_size()) ? cs->arg_size(): fn->arg_size();
58 if(arg_size > 1)
59 {
60 for (unsigned i = 1; i < arg_size; i++)
61 {
62 auto cs_arg = cs->getArgument(i);
63 auto fn_arg = fn->getArg(i);
64 if (cs_arg->getType() != fn_arg->getType())
65 {
66 return false;
67 }
68 }
69 }
70
71 return true;
72}
unsigned u32_t
Definition CommandLine.h:18
const ValVar * getArgument(u32_t ArgNo) const
Parameter operations.
Definition ICFGNode.h:500
u32_t arg_size() const
Definition ICFGNode.h:505
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ hasEdge()

static bool hasEdge ( const CHNode src,
const CHNode dst,
CHEdge::CHEDGETYPE  et 
)
static

Definition at line 39 of file CHG.cpp.

41{
42 for (CHEdge::CHEdgeSetTy::const_iterator it = src->getOutEdges().begin(),
43 eit = src->getOutEdges().end(); it != eit; ++it)
44 {
45 CHNode *node = (*it)->getDstNode();
46 CHEdge::CHEDGETYPE edgeType = (*it)->getEdgeType();
47 if (node == dst && edgeType == et)
48 return true;
49 }
50 return false;
51}
CHEDGETYPE
Definition CHG.h:85
const GEdgeSetTy & getOutEdges() const