Static Value-Flow Analysis
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
CHG.cpp File Reference
#include "Graphs/CHG.h"
#include "Graphs/GraphPrinter.h"
#include "Graphs/ICFG.h"
#include "Util/GeneralType.h"
#include "Util/SVFUtil.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 FunObjVar *fn)
 

Function Documentation

◆ checkArgTypes()

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

Definition at line 54 of file CHG.cpp.

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

◆ hasEdge()

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

Definition at line 40 of file CHG.cpp.

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