Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVFG.h
Go to the documentation of this file.
1//===- SVFG.h -- Sparse value-flow graph--------------------------------------//
2//
3// SVF: Static Value-Flow Analysis
4//
5// Copyright (C) <2013-2017> <Yulei Sui>
6//
7
8// This program is free software: you can redistribute it and/or modify
9// it under the terms of the GNU Affero General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU Affero General Public License for more details.
17
18// You should have received a copy of the GNU Affero General Public License
19// along with this program. If not, see <http://www.gnu.org/licenses/>.
20//
21//===----------------------------------------------------------------------===//
22
23/*
24 * SVFG.h
25 *
26 * Created on: Oct 28, 2013
27 * Author: Yulei Sui
28 */
29
30#ifndef SVFG_H_
31#define SVFG_H_
32
33#include "Graphs/VFG.h"
34#include "Graphs/SVFGNode.h"
35
36namespace SVF
37{
38
39class PointerAnalysis;
40class SVFGStat;
41
48
59
60
65class SVFG : public VFG
66{
67 friend class SVFGBuilder;
68 friend class SaberSVFGBuilder;
69 friend class CFLSVFGBuilder;
70 friend class TaintSVFGBuilder;
71 friend class DDASVFGBuilder;
72 friend class MTASVFGBuilder;
73 friend class RcSvfgBuilder;
74
75public:
90 typedef MemSSA::MU MU;
98
99protected:
106 std::unique_ptr<MemSSA> mssa;
108
110 void destroy();
111
113 SVFG(std::unique_ptr<MemSSA> mssa, VFGK k);
114
116 virtual void buildSVFG();
117
118public:
120 virtual ~SVFG()
121 {
122 destroy();
123 }
124
126 inline SVFGStat* getStat() const
127 {
128 return stat;
129 }
130
132 inline void clearMSSA()
133 {
134 mssa = nullptr;
135 }
136
138 inline MemSSA* getMSSA() const
139 {
140 return mssa.get();
141 }
142
144 inline PointerAnalysis* getPTA() const
145 {
146 return pta;
147 }
148
150 inline SVFGNode* getSVFGNode(NodeID id) const
151 {
152 return getVFGNode(id);
153 }
154
156 inline bool hasSVFGNode(NodeID id) const
157 {
158 return hasVFGNode(id);
159 }
160
163
165 void dump(const std::string& file, bool simple = false);
166
168 virtual void connectCallerAndCallee(const CallICFGNode* cs, const FunObjVar* callee, SVFGEdgeSetTy& edges);
169
171 inline const SVFGNode* getDefSVFGNode(const ValVar* valVar) const
172 {
173 return getSVFGNode(getDef(valVar));
174 }
175
177 inline bool hasDefSVFGNode(const ValVar* valVar) const
178 {
180 }
181
184 const ICFGNode* getDefSiteOfValVar(const ValVar* var) const;
185
188 const ICFGNode* getDefSiteOfObjVar(const ObjVar* obj, const ICFGNode* node) const;
189
193
196 const Set<const ICFGNode*> getUseSitesOfObjVar(const ObjVar* obj, const ICFGNode* node) const;
197
199 void performStat();
200
202
203 inline bool hasActualINSVFGNodes(const CallICFGNode* cs) const
204 {
205 return callSiteToActualINMap.find(cs)!=callSiteToActualINMap.end();
206 }
207
208 inline bool hasActualOUTSVFGNodes(const CallICFGNode* cs) const
209 {
210 return callSiteToActualOUTMap.find(cs)!=callSiteToActualOUTMap.end();
211 }
212
213 inline bool hasFormalINSVFGNodes(const FunObjVar* fun) const
214 {
215 return funToFormalINMap.find(fun)!=funToFormalINMap.end();
216 }
217
218 inline bool hasFormalOUTSVFGNodes(const FunObjVar* fun) const
219 {
220 return funToFormalOUTMap.find(fun)!=funToFormalOUTMap.end();
221 }
223
225
227 {
228 return callSiteToActualINMap[cs];
229 }
230
235
237 {
238 return funToFormalINMap[fun];
239 }
240
242 {
243 return funToFormalOUTMap[fun];
244 }
246
248 const FunObjVar* isFunEntrySVFGNode(const SVFGNode* node) const;
249
251 const CallICFGNode* isCallSiteRetSVFGNode(const SVFGNode* node) const;
252
255 {
257 }
259 inline void removeSVFGNode(SVFGNode* node)
260 {
261 removeVFGNode(node);
262 }
263
266 {
267 return addVFGEdge(edge);
268 }
269
271 inline u32_t getSVFGNodeNum() const
272 {
273 return nodeNum;
274 }
275
279 inline const DummyVersionPropSVFGNode *addDummyVersionPropSVFGNode(const NodeID object, const NodeID version)
280 {
282 // Not going through add[S]VFGNode because we have no ICFG edge.
283 addGNode(dvpNode->getId(), dvpNode);
284 return dvpNode;
285 }
286
287 virtual void writeToFile(const std::string& filename);
288 virtual void readFile(const std::string& filename);
289 virtual MRVer* getMRVERFromString(const std::string& input);
290
291protected:
293
299
302
305
307
308
310 {
312 if (edge != nullptr)
313 edges.insert(edge);
314 }
317 {
319 if (edge != nullptr)
320 edges.insert(edge);
321 }
323
325
327 {
331 assert(edge != nullptr && "Can not find inter value flow edge from aparam to fparam");
332 edges.insert(edge);
333 }
334
336 {
337 SVFGNode* formalRet = getSVFGNode(getDef(fun_ret));
338 SVFGNode* actualRet = getSVFGNode(getDef(cs_ret));
339 SVFGEdge* edge = hasInterVFGEdge(formalRet, actualRet, SVFGEdge::RetDirVF, csId);
340 assert(edge != nullptr && "Can not find inter value flow edge from fret to aret");
341 edges.insert(edge);
342 }
343
345 {
346 for (SVFGNode::const_iterator outIt = actualIn->OutEdgeBegin(), outEit = actualIn->OutEdgeEnd(); outIt != outEit; ++outIt)
347 {
348 SVFGEdge* edge = *outIt;
349 if (edge->getDstNode()->getFun() == callee)
350 edges.insert(edge);
351 }
352 }
353
355 {
356 for (SVFGNode::const_iterator inIt = actualOut->InEdgeBegin(), inEit = actualOut->InEdgeEnd(); inIt != inEit; ++inIt)
357 {
358 SVFGEdge* edge = *inIt;
359 if (edge->getSrcNode()->getFun() == callee)
360 edges.insert(edge);
361 }
362 }
364
365
367
368 inline void setDef(const ValVar* valVar, const SVFGNode* node)
369 {
370 VFG::setDef(valVar, node);
371 }
372 inline NodeID getDef(const ValVar* valVar) const
373 {
374 return VFG::getDef(valVar);
375 }
376 inline bool hasDef(const ValVar* valVar) const
377 {
378 return VFG::hasDef(valVar);
379 }
381
383
384 inline void setDef(const MRVer* mvar, const SVFGNode* node)
385 {
386 MSSAVarToDefMapTy::iterator it = MSSAVarToDefMap.find(mvar);
387 if(it==MSSAVarToDefMap.end())
388 {
389 MSSAVarToDefMap[mvar] = node->getId();
390 assert(hasSVFGNode(node->getId()) && "not in the map!!");
391 }
392 else
393 {
394 assert((it->second == node->getId()) && "a SVFIR node can only have unique definition ");
395 }
396 }
397 inline NodeID getDef(const MRVer* mvar) const
398 {
399 MSSAVarToDefMapTy::const_iterator it = MSSAVarToDefMap.find(mvar);
400 assert(it!=MSSAVarToDefMap.end() && "memory SSA does not have a definition??");
401 return it->second;
402 }
404
411
413 virtual inline void addSVFGNode(SVFGNode* node, ICFGNode* icfgNode)
414 {
415 addVFGNode(node, icfgNode);
416 }
417
419 inline void addFormalINSVFGNode(const FunEntryICFGNode* funEntry, const MRVer* resVer, const NodeID nodeId)
420 {
423 setDef(resVer,sNode);
424 funToFormalINMap[funEntry->getFun()].set(sNode->getId());
425 }
426
428 inline void addFormalOUTSVFGNode(const FunExitICFGNode* funExit, const MRVer* ver, const NodeID nodeId)
429 {
432 funToFormalOUTMap[funExit->getFun()].set(sNode->getId());
433 }
434
436 inline void addActualINSVFGNode(const CallICFGNode* callsite, const MRVer* ver, const NodeID nodeId)
437 {
438 ActualINSVFGNode* sNode = new ActualINSVFGNode(nodeId, callsite, ver);
439 addSVFGNode(sNode, const_cast<CallICFGNode*>(callsite));
440 callSiteToActualINMap[callsite].set(sNode->getId());
441 }
442
444 inline void addActualOUTSVFGNode(const CallICFGNode* callsite, const MRVer* resVer, const NodeID nodeId)
445 {
446 ActualOUTSVFGNode* sNode = new ActualOUTSVFGNode(nodeId, callsite, resVer);
447 addSVFGNode(sNode,const_cast<RetICFGNode*>(callsite->getRetICFGNode()));
448 setDef(resVer,sNode);
449 callSiteToActualOUTMap[callsite].set(sNode->getId());
450 }
451
454 const Map<u32_t,const MRVer*>::const_iterator opVerEnd, const MRVer* resVer, const NodeID nodeId)
455 {
458 for(MemSSA::PHI::OPVers::const_iterator it = opVerBegin, eit=opVerEnd; it!=eit; ++it)
459 sNode->setOpVer(it->first,it->second);
460 setDef(resVer,sNode);
461 }
462
464
465 inline bool hasFuncEntryChi(const FunObjVar* func) const
466 {
467 return (funToFormalINMap.find(func) != funToFormalINMap.end());
468 }
469 inline bool hasFuncRetMu(const FunObjVar* func) const
470 {
471 return (funToFormalOUTMap.find(func) != funToFormalOUTMap.end());
472 }
473 inline bool hasCallSiteChi(const CallICFGNode* cs) const
474 {
475 return (callSiteToActualOUTMap.find(cs) != callSiteToActualOUTMap.end());
476 }
477 inline bool hasCallSiteMu(const CallICFGNode* cs) const
478 {
479 return (callSiteToActualINMap.find(cs) != callSiteToActualINMap.end());
480 }
482};
483
484} // End namespace SVF
485
486namespace SVF
487{
488/* !
489 * GenericGraphTraits specializations for SVFG to be used for generic graph algorithms.
490 * Provide graph traits for traversing from a SVFG node using standard graph traversals.
491 */
492//template<> struct GenericGraphTraits<SVF::SVFGNode*>: public GenericGraphTraits<SVF::GenericNode<SVF::SVFGNode,SVF::SVFGEdge>* > {
493//};
494//
496//template<>
497//struct GenericGraphTraits<Inverse<SVF::SVFGNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::SVFGNode,SVF::SVFGEdge>* > > {
498//};
499
500template<> struct GenericGraphTraits<SVF::SVFG*> : public GenericGraphTraits<SVF::GenericGraph<SVF::SVFGNode,SVF::SVFGEdge>* >
501{
503};
504
505} // End namespace llvm
506
507#endif /* SVFG_H_ */
const RetICFGNode * getRetICFGNode() const
Return callsite.
Definition ICFGNode.h:439
void addGNode(NodeID id, NodeType *node)
Add a Node.
u32_t nodeNum
total num of edge
FunExitICFGNode * getFunExitICFGNode(const FunObjVar *fun)
Add a function exit node.
Definition ICFG.cpp:249
FunEntryICFGNode * getFunEntryICFGNode(const FunObjVar *fun)
Add a function entry node.
Definition ICFG.cpp:242
StoreCHI< Condition > STORECHI
Definition MemSSA.h:65
MSSAMU< Condition > MU
Definition MemSSA.h:59
LoadMU< Condition > LOADMU
Definition MemSSA.h:61
MSSACHI< Condition > CHI
Definition MemSSA.h:63
CallCHI< Condition > CALLCHI
Definition MemSSA.h:66
EntryCHI< Condition > ENTRYCHI
Definition MemSSA.h:64
CallMU< Condition > CALLMU
Definition MemSSA.h:62
Set< MU * > MUSet
Definition MemSSA.h:70
Set< PHI * > PHISet
Definition MemSSA.h:72
RetMU< Condition > RETMU
Definition MemSSA.h:60
Set< CHI * > CHISet
Definition MemSSA.h:71
MemSSA::RETMU RETMU
Definition SVFG.h:94
virtual void getInterVFEdgeAtIndCSFromFOutToAOut(ActualOUTSVFGNode *actualOut, const FunObjVar *callee, SVFGEdgeSetTy &edges)
Definition SVFG.h:354
virtual void buildSVFG()
Start building SVFG.
Definition SVFG.cpp:228
PointerAnalysis * pta
Definition SVFG.h:107
MemSSA::ENTRYCHI ENTRYCHI
Definition SVFG.h:95
void connectIndirectSVFGEdges()
Connect direct SVFG edges between two SVFG nodes (value-flow of top address-taken variables)
Definition SVFG.cpp:330
SVFGEdge * addThreadMHPIndirectVFEdge(NodeID srcId, NodeID dstId, const NodeBS &cpts)
Definition SVFG.cpp:485
bool hasSVFGNode(NodeID id) const
Whether has the SVFGNode.
Definition SVFG.h:156
ActualOUTSVFGNodeSet & getActualOUTSVFGNodes(const CallICFGNode *cs)
Definition SVFG.h:231
bool hasActualINSVFGNodes(const CallICFGNode *cs) const
Has a SVFGNode.
Definition SVFG.h:203
MemSSA * getMSSA() const
Get SVFG memory SSA.
Definition SVFG.h:138
FormalOUTSVFGNodeSet & getFormalOUTSVFGNodes(const FunObjVar *fun)
Definition SVFG.h:241
NodeBS ActualOUTSVFGNodeSet
Definition SVFG.h:80
bool hasFormalOUTSVFGNodes(const FunObjVar *fun) const
Definition SVFG.h:218
FormalINSVFGNodeSet & getFormalINSVFGNodes(const FunObjVar *fun)
Definition SVFG.h:236
SVFGStat * getStat() const
Return statistics.
Definition SVFG.h:126
CallSiteToActualOUTsMapTy callSiteToActualOUTMap
Definition SVFG.h:102
VFGNodeIDToNodeMapTy SVFGNodeIDToNodeMapTy
Definition SVFG.h:76
virtual void connectFOutAndAOut(const FormalOUTSVFGNode *formalOut, const ActualOUTSVFGNode *actualOut, CallSiteID csId, SVFGEdgeSetTy &edges)
Connect formal-out and actual-out.
Definition SVFG.h:316
Map< const FunObjVar *, FormalINSVFGNodeSet > FunctionToFormalINsMapTy
Definition SVFG.h:85
virtual void getInterVFEdgeAtIndCSFromAPToFP(const ValVar *cs_arg, const ValVar *fun_arg, const CallICFGNode *, CallSiteID csId, SVFGEdgeSetTy &edges)
Get inter value flow edges between indirect call site and callee.
Definition SVFG.h:326
const ICFGNode * getDefSiteOfValVar(const ValVar *var) const
Definition SVFG.cpp:765
NodeID getDef(const MRVer *mvar) const
Definition SVFG.h:397
SVFGEdge * addInterIndirectVFCallEdge(const ActualINSVFGNode *src, const FormalINSVFGNode *dst, CallSiteID csId)
Add inter VF edge from callsite mu to function entry chi.
Definition SVFG.cpp:545
virtual void getInterVFEdgeAtIndCSFromAInToFIn(ActualINSVFGNode *actualIn, const FunObjVar *callee, SVFGEdgeSetTy &edges)
Definition SVFG.h:344
void connectFromGlobalToProgEntry()
Connect indirect SVFG edges from global initializers (store) to main function entry.
Definition SVFG.cpp:428
SVFGNode * getSVFGNode(NodeID id) const
Get a SVFG node.
Definition SVFG.h:150
void getInterVFEdgesForIndirectCallSite(const CallICFGNode *cs, const FunObjVar *callee, SVFGEdgeSetTy &edges)
Get all inter value flow edges of a indirect call site.
Definition SVFG.cpp:584
MemSSA::CALLCHI CALLCHI
Definition SVFG.h:96
void dump(const std::string &file, bool simple=false)
Dump graph into dot file.
Definition SVFG.cpp:576
void addIntraMSSAPHISVFGNode(ICFGNode *BlockICFGNode, const Map< u32_t, const MRVer * >::const_iterator opVerBegin, const Map< u32_t, const MRVer * >::const_iterator opVerEnd, const MRVer *resVer, const NodeID nodeId)
Add memory SSA PHI SVFG node.
Definition SVFG.h:453
MemSSA::CHI CHI
Definition SVFG.h:91
ActualINSVFGNodeSet & getActualINSVFGNodes(const CallICFGNode *cs)
Get SVFGNode set.
Definition SVFG.h:226
friend class TaintSVFGBuilder
Definition SVFG.h:70
friend class RcSvfgBuilder
Definition SVFG.h:73
bool addSVFGEdge(SVFGEdge *edge)
Add SVFG edge.
Definition SVFG.h:265
void removeSVFGNode(SVFGNode *node)
Remove a SVFGNode.
Definition SVFG.h:259
virtual ~SVFG()
Destructor.
Definition SVFG.h:120
Map< const CallICFGNode *, ActualINSVFGNodeSet > CallSiteToActualINsMapTy
Definition SVFG.h:83
void addActualOUTSVFGNode(const CallICFGNode *callsite, const MRVer *resVer, const NodeID nodeId)
Add memory callsite chi SVFG node.
Definition SVFG.h:444
bool hasDefSVFGNode(const ValVar *valVar) const
Given a valVar, return whether it has definition site.
Definition SVFG.h:177
bool hasFormalINSVFGNodes(const FunObjVar *fun) const
Definition SVFG.h:213
Map< const CallICFGNode *, ActualOUTSVFGNodeSet > CallSiteToActualOUTsMapTy
Definition SVFG.h:84
virtual void writeToFile(const std::string &filename)
FunctionToFormalOUTsMapTy funToFormalOUTMap
Definition SVFG.h:104
Map< const FunObjVar *, FormalOUTSVFGNodeSet > FunctionToFormalOUTsMapTy
Definition SVFG.h:86
MemSSA::MU MU
Definition SVFG.h:90
void addFormalOUTSVFGNode(const FunExitICFGNode *funExit, const MRVer *ver, const NodeID nodeId)
Add memory Function return mu SVFG node.
Definition SVFG.h:428
void destroy()
Clean up memory.
Definition SVFG.cpp:212
virtual void connectCallerAndCallee(const CallICFGNode *cs, const FunObjVar *callee, SVFGEdgeSetTy &edges)
Connect SVFG nodes between caller and callee for indirect call site.
Definition SVFG.cpp:658
bool hasCallSiteMu(const CallICFGNode *cs) const
Definition SVFG.h:477
const DummyVersionPropSVFGNode * addDummyVersionPropSVFGNode(const NodeID object, const NodeID version)
Definition SVFG.h:279
MemSSA::LOADMU LOADMU
Definition SVFG.h:92
MemSSA::CHISet CHISet
Definition SVFG.h:88
NodeBS FormalINSVFGNodeSet
Definition SVFG.h:81
virtual void addSVFGNode(SVFGNode *node, ICFGNode *icfgNode)
Add SVFG node.
Definition SVFG.h:413
void setDef(const ValVar *valVar, const SVFGNode *node)
Given a ValVar, set/get its def SVFG node (definition of top level pointers)
Definition SVFG.h:368
SVFGEdge * addRetIndirectVFEdge(NodeID srcId, NodeID dstId, const NodeBS &cpts, CallSiteID csId)
Definition SVFG.cpp:525
const Set< const ICFGNode * > getUseSitesOfValVar(const ValVar *var) const
Definition SVFG.cpp:795
virtual MRVer * getMRVERFromString(const std::string &input)
void addActualINSVFGNode(const CallICFGNode *callsite, const MRVer *ver, const NodeID nodeId)
Add memory callsite mu SVFG node.
Definition SVFG.h:436
void removeSVFGEdge(SVFGEdge *edge)
Remove a SVFG edge.
Definition SVFG.h:254
bool hasFuncRetMu(const FunObjVar *func) const
Definition SVFG.h:469
NodeID getDef(const ValVar *valVar) const
Definition SVFG.h:372
Map< const ValVar *, NodeID > ValVarToDefMapTy
Definition SVFG.h:77
friend class DDASVFGBuilder
Definition SVFG.h:71
virtual void readFile(const std::string &filename)
void setDef(const MRVer *mvar, const SVFGNode *node)
Given a MSSADef, set/get its def SVFG node (definition of address-taken variables)
Definition SVFG.h:384
std::unique_ptr< MemSSA > mssa
Definition SVFG.h:106
const ICFGNode * getDefSiteOfObjVar(const ObjVar *obj, const ICFGNode *node) const
Definition SVFG.cpp:772
NodeBS ActualINSVFGNodeSet
Definition SVFG.h:79
MSSAVarToDefMapTy MSSAVarToDefMap
map a memory SSA operator to its definition SVFG node
Definition SVFG.h:100
bool hasActualOUTSVFGNodes(const CallICFGNode *cs) const
Definition SVFG.h:208
void addFormalINSVFGNode(const FunEntryICFGNode *funEntry, const MRVer *resVer, const NodeID nodeId)
Add memory Function entry chi SVFG node.
Definition SVFG.h:419
void addSVFGNodesForAddrTakenVars()
Create SVFG nodes for address-taken variables.
Definition SVFG.cpp:255
friend class MTASVFGBuilder
Definition SVFG.h:72
virtual void getInterVFEdgeAtIndCSFromFRToAR(const ValVar *fun_ret, const ValVar *cs_ret, CallSiteID csId, SVFGEdgeSetTy &edges)
Definition SVFG.h:335
Map< const MRVer *, NodeID > MSSAVarToDefMapTy
Definition SVFG.h:78
u32_t getSVFGNodeNum() const
Return total SVFG node number.
Definition SVFG.h:271
SVFGEdge * addInterIndirectVFRetEdge(const FormalOUTSVFGNode *src, const ActualOUTSVFGNode *dst, CallSiteID csId)
Add inter VF edge from function exit mu to callsite chi.
Definition SVFG.cpp:560
virtual void connectAInAndFIn(const ActualINSVFGNode *actualIn, const FormalINSVFGNode *formalIn, CallSiteID csId, SVFGEdgeSetTy &edges)
Connect SVFG nodes between caller and callee for indirect call site.
Definition SVFG.h:309
NodeBS FormalOUTSVFGNodeSet
Definition SVFG.h:82
MemSSA::CALLMU CALLMU
Definition SVFG.h:97
MemSSA::MUSet MUSet
Definition SVFG.h:87
SVFGEdge * addIntraIndirectVFEdge(NodeID srcId, NodeID dstId, const NodeBS &cpts)
Add indirect def-use edges of a memory region between two statements,.
Definition SVFG.cpp:463
MemSSA::STORECHI STORECHI
Definition SVFG.h:93
const CallICFGNode * isCallSiteRetSVFGNode(const SVFGNode *node) const
Whether a node is callsite return SVFGNode.
Definition SVFG.cpp:732
SVFGStat * stat
Definition SVFG.h:105
bool hasCallSiteChi(const CallICFGNode *cs) const
Definition SVFG.h:473
bool hasFuncEntryChi(const FunObjVar *func) const
Has function for EntryCHI/RetMU/CallCHI/CallMU.
Definition SVFG.h:465
void performStat()
Perform statistics.
Definition SVFG.cpp:758
const FunObjVar * isFunEntrySVFGNode(const SVFGNode *node) const
Whether a node is function entry SVFGNode.
Definition SVFG.cpp:706
FunctionToFormalINsMapTy funToFormalINMap
Definition SVFG.h:103
bool hasDef(const ValVar *valVar) const
Definition SVFG.h:376
const Set< const ICFGNode * > getUseSitesOfObjVar(const ObjVar *obj, const ICFGNode *node) const
Definition SVFG.cpp:815
void clearMSSA()
Clear MSSA.
Definition SVFG.h:132
const SVFGNode * getDefSVFGNode(const ValVar *valVar) const
Given a valVar, return its definition site.
Definition SVFG.h:171
MemSSA::PHISet PHISet
Definition SVFG.h:89
SVFGEdge * addCallIndirectVFEdge(NodeID srcId, NodeID dstId, const NodeBS &cpts, CallSiteID csId)
Definition SVFG.cpp:505
CallSiteToActualINsMapTy callSiteToActualINMap
Definition SVFG.h:101
PointerAnalysis * getPTA() const
Get Pointer Analysis.
Definition SVFG.h:144
ICFG * getICFG() const
Definition SVFIR.h:227
NodeID getId() const
Get ID.
Definition SVFValue.h:163
VFGEdge::VFGEdgeSetTy::const_iterator const_iterator
Definition VFGNode.h:55
Definition VFG.h:51
NodeID getDef(const ValVar *valVar) const
Definition VFG.h:482
void removeVFGNode(VFGNode *node)
Remove a VFGNode.
Definition VFG.h:388
void setDef(const ValVar *valVar, const VFGNode *node)
Given a ValVar, set/get its def VFG node (definition of top level pointers)
Definition VFG.h:469
SVFIR * pag
Definition VFG.h:104
bool hasVFGNode(NodeID id) const
Whether has the VFGNode.
Definition VFG.h:151
bool hasDef(const ValVar *valVar) const
Definition VFG.h:488
bool addVFGEdge(VFGEdge *edge)
Add VFG edge.
Definition VFG.h:401
VFGNode * getVFGNode(NodeID id) const
Get a VFG node.
Definition VFG.h:145
VFGK
VFG kind.
Definition VFG.h:56
VFGEdge::SVFGEdgeSetTy SVFGEdgeSetTy
Definition VFG.h:78
OrderedMap< NodeID, VFGNode * > VFGNodeIDToNodeMapTy
Definition VFG.h:60
NodeID totalVFGNode
Definition VFG.h:88
VFGEdge * hasInterVFGEdge(VFGNode *src, VFGNode *dst, VFGEdge::VFGEdgeK kind, CallSiteID csId)
Definition VFG.cpp:894
virtual void addVFGNode(VFGNode *vfgNode, ICFGNode *icfgNode)
Add a VFG node.
Definition VFG.h:526
void removeVFGEdge(VFGEdge *edge)
Remove a SVFG edge.
Definition VFG.h:381
for isBitcode
Definition BasicTypes.h:70
unsigned CallSiteID
Definition GeneralType.h:58
InterPHIVFGNode InterPHISVFGNode
Definition SVFG.h:58
ActualParmVFGNode ActualParmSVFGNode
Definition SVFG.h:44
StmtVFGNode StmtSVFGNode
Definition SVFG.h:50
LoadVFGNode LoadSVFGNode
Definition SVFG.h:54
u32_t NodeID
Definition GeneralType.h:56
StoreVFGNode StoreSVFGNode
Definition SVFG.h:53
VFGNode SVFGNode
Definition SVFG.h:43
GepVFGNode GepSVFGNode
Definition SVFG.h:55
PHIVFGNode PHISVFGNode
Definition SVFG.h:56
ActualRetVFGNode ActualRetSVFGNode
Definition SVFG.h:45
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76
AddrVFGNode AddrSVFGNode
Definition SVFG.h:51
VFGEdge SVFGEdge
Definition SVFG.h:42
CopyVFGNode CopySVFGNode
Definition SVFG.h:52
unsigned u32_t
Definition GeneralType.h:47
FormalParmVFGNode FormalParmSVFGNode
Definition SVFG.h:46
IntraPHIVFGNode IntraPHISVFGNode
Definition SVFG.h:57
FormalRetVFGNode FormalRetSVFGNode
Definition SVFG.h:47
NullPtrVFGNode NullPtrSVFGNode
Definition SVFG.h:49