33using namespace SVFUtil;
37 std::vector<const SVFBasicBlock *> &
path,
38 std::vector<const SVFBasicBlock *> &
tgtNodes,
48 auto it =
ld->getPostDomTreeMap().find(cur);
49 for (
const auto &
nxt:
it->second)
66 std::vector<const SVFBasicBlock *> &
tgtNodes)
69 std::vector<const SVFBasicBlock *>
path;
90 assert(!
BB->getICFGNodeList().empty() &&
"empty bb?");
103 return intraEdge->getSuccessorCondValue();
109 assert(
false &&
"not intra edge?");
142 getLoopAndDomInfo()->findNearestCommonPDominator(
pred,
succ);
143 std::vector<const SVFBasicBlock *>
tgtNodes;
174 for (
const auto &bb: *func)
176 for (
const auto &
succ: bb->getSuccessors())
180 res[bb].push_back(
succ);
192 for (
const auto &
it2:
it.second)
216 "not a branch stmt?");
218 SVFUtil::cast<BranchStmt>(
Map< const ICFGNode *, Map< const ICFGNode *, Set< s32_t > > > _nodeControlMap
map an ICFG node to its controlling ICFG nodes (position, set of Nodes)
void updateMap(const SVFBasicBlock *pred, const SVFBasicBlock *bb, s32_t pos)
update map
void extractNodesBetweenPdomNodes(const SVFBasicBlock *succ, const SVFBasicBlock *LCA, std::vector< const SVFBasicBlock * > &tgtNodes)
extract nodes between two nodes in pdom tree
static void extractBBS(const SVFFunction *func, Map< const SVFBasicBlock *, std::vector< const SVFBasicBlock * > > &res)
extract basic block edges to be processed
void dfsNodesBetweenPdomNodes(const SVFBasicBlock *cur, const SVFBasicBlock *tgt, std::vector< const SVFBasicBlock * > &path, std::vector< const SVFBasicBlock * > &tgtNodes, SVFLoopAndDomInfo *ld)
void buildControlDependence(const SVFModule *svfgModule)
build control dependence for each function
Map< const SVFBasicBlock *, Map< const SVFBasicBlock *, Set< s32_t > > > _svfcontrolMap
map a basicblock to its controlling BBs (position, set of BBs)
void buildICFGNodeControlMap()
build map at icfg node level
Map< const ICFGNode *, Map< const ICFGNode *, Set< s32_t > > > _nodeDependentOnMap
map an ICFG node to its dependent on ICFG nodes (position, set of Nodes)
s64_t getBBSuccessorBranchID(const SVFBasicBlock *BB, const SVFBasicBlock *Succ)
void addCDGEdgeFromSrcDst(const ICFGNode *src, const ICFGNode *dst, const SVFVar *pNode, s32_t branchID)
Add CDG edges from nodeid pair.
u32_t getTotalNodeNum() const
Get total number of node/edge.
NodeType * getGNode(NodeID id) const
Get a node.
ICFGEdge * getICFGEdge(const ICFGNode *src, const ICFGNode *dst, ICFGEdge::ICFGEdgeK kind)
Get a SVFG edge according to src and dst.
NodeID getNullPtr() const
bool postDominate(const SVFBasicBlock *bbKey, const SVFBasicBlock *bbValue) const
CallGraph * getCallGraph()
static SVFIR * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
bool isExtCall(const SVFFunction *fun)
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
llvm::IRBuilder IRBuilder