SVF
PAG.h
Go to the documentation of this file.
1 //===- PAG.h -- Program assignment 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 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 General Public License for more details.
17 
18 // You should have received a copy of the GNU General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 //
21 //===----------------------------------------------------------------------===//
22 
23 /*
24  * PAG.h
25  *
26  * Created on: Nov 1, 2013
27  * Author: Yulei Sui
28  */
29 
30 
31 #ifndef PAG_H_
32 #define PAG_H_
33 
34 #include "PAGEdge.h"
35 #include "PAGNode.h"
36 #include "Util/NodeIDAllocator.h"
37 #include "Util/SVFUtil.h"
38 #include "Graphs/ICFG.h"
39 
40 namespace SVF
41 {
42 
47 class PAG : public GenericGraph<PAGNode,PAGEdge>
48 {
49 
50 public:
56  typedef std::vector<const PAGEdge*> PAGEdgeList;
57  typedef std::vector<const PAGNode*> PAGNodeList;
58  typedef std::vector<const CopyPE*> CopyPEList;
59  typedef std::vector<const BinaryOPPE*> BinaryOPList;
60  typedef std::vector<const UnaryOPPE*> UnaryOPList;
61  typedef std::vector<const CmpPE*> CmpPEList;
73  typedef std::pair<NodeID, Size_t> NodeOffset;
74  typedef std::pair<NodeID, LocationSet> NodeLocationSet;
79 
80 private:
84  PAGEdge::PAGKindToEdgeSetMapTy PAGEdgeKindToSetMap; // < PAG edge map containing all PAGEdges
85  PAGEdge::PAGKindToEdgeSetMapTy PTAPAGEdgeKindToSetMap; // < PAG edge map containing only pointer-related edges, i.e, both RHS and RHS are of pointer type
86  Inst2PAGEdgesMap inst2PAGEdgesMap;
87  Inst2PAGEdgesMap inst2PTAPAGEdgesMap;
88  GepValPNMap GepValNodeMap;
89  NodeLocationSetMap GepObjNodeMap;
90  MemObjToFieldsMap memToFieldsMap;
91  PAGEdgeSet globPAGEdgesSet;
92  PHINodeMap phiNodeMap;
93  BinaryNodeMap binaryNodeMap;
94  UnaryNodeMap unaryNodeMap;
95  CmpNodeMap cmpNodeMap;
96  FunToArgsListMap funArgsListMap;
97  CSToArgsListMap callSiteArgsListMap;
98  CSToRetMap callSiteRetMap;
99  FunToRetMap funRetMap;
100  static PAG* pag;
101  CallSiteToFunPtrMap indCallSiteToFunPtrMap;
102  FunPtrToCallSitesMap funPtrToCallSitesMap;
103  bool fromFile;
107  NodeID nodeNumAfterPAGBuild; // initial node number after building PAG, excluding later added nodes, e.g., gepobj nodes
108  ICFG* icfg; // ICFG
109  CallSiteSet callSiteSet;
110 
112  PAG(bool buildFromFile);
113 
115  void destroy();
116 
117 public:
119 
121  inline MemObjToFieldsMap& getMemToFieldsMap()
122  {
123  return memToFieldsMap;
124  }
125 
127  inline NodeLocationSetMap& getGepObjNodeMap()
128  {
129  return GepObjNodeMap;
130  }
131 
133  inline ICFG* getICFG()
134  {
135  return icfg;
136  }
137 
140  {
141  return candidatePointers;
142  }
145  {
146  // collect candidate pointers for demand-driven analysis
147  for (iterator nIter = begin(); nIter != end(); ++nIter)
148  {
149  NodeID nodeId = nIter->first;
150  // do not compute points-to for isolated node
151  if (isValidPointer(nodeId) == false)
152  continue;
153 
154  candidatePointers.insert(nodeId);
155  }
156  }
157 
159 
160  static inline PAG* getPAG(bool buildFromFile = false)
161  {
162  if (pag == nullptr)
163  {
164  pag = new PAG(buildFromFile);
165  }
166  return pag;
167  }
168  static void releasePAG()
169  {
170  if (pag)
171  delete pag;
172  pag = nullptr;
173  }
175 
177  virtual ~PAG()
178  {
179  destroy();
180  }
181 
183  inline bool isBuiltFromFile()
184  {
185  return fromFile;
186  }
188 
189  static void handleBlackHole(bool b);
192  inline SVFModule* getModule()
194  {
196  }
197  inline void addCallSite(const CallBlockNode* call)
198  {
199  callSiteSet.insert(call);
200  }
201  inline const CallSiteSet& getCallSiteSet() const
202  {
203  return callSiteSet;
204  }
206 
209  {
210  return PAGEdgeKindToSetMap[kind];
211  }
214  {
215  return PTAPAGEdgeKindToSetMap[kind];
216  }
218  inline bool hasPAGEdgeList(const ICFGNode* inst) const
219  {
220  return inst2PAGEdgesMap.find(inst)!=inst2PAGEdgesMap.end();
221  }
222  inline bool hasPTAPAGEdgeList(const ICFGNode* inst) const
223  {
224  return inst2PTAPAGEdgesMap.find(inst)!=inst2PTAPAGEdgesMap.end();
225  }
227  inline PAGEdgeList& getInstPAGEdgeList(const ICFGNode* inst)
228  {
229  return inst2PAGEdgesMap[inst];
230  }
232  inline PAGEdgeList& getInstPTAPAGEdgeList(const ICFGNode* inst)
233  {
234  return inst2PTAPAGEdgesMap[inst];
235  }
237  inline void addToInstPAGEdgeList(ICFGNode* inst, PAGEdge* edge)
238  {
239  edge->setICFGNode(inst);
240  inst2PAGEdgesMap[inst].push_back(edge);
241  if (edge->isPTAEdge())
242  inst2PTAPAGEdgesMap[inst].push_back(edge);
243  }
245  inline void addGlobalPAGEdge(const PAGEdge* edge)
246  {
247  globPAGEdgesSet.insert(edge);
248  }
250  inline PAGEdgeSet& getGlobalPAGEdgeSet()
251  {
252  return globPAGEdgesSet;
253  }
255  inline void addPhiNode(const PAGNode* res, const CopyPE* edge)
256  {
257  phiNodeMap[res].push_back(edge);
258  }
260  inline bool isPhiNode(const PAGNode* node) const
261  {
262  return phiNodeMap.find(node) != phiNodeMap.end();
263  }
265  inline PHINodeMap& getPhiNodeMap()
266  {
267  return phiNodeMap;
268  }
270  inline void addBinaryNode(const PAGNode* res, const BinaryOPPE* edge)
271  {
272  binaryNodeMap[res].push_back(edge);
273  }
275  inline bool isBinaryNode(const PAGNode* node) const
276  {
277  return binaryNodeMap.find(node) != binaryNodeMap.end();
278  }
280  inline BinaryNodeMap& getBinaryNodeMap()
281  {
282  return binaryNodeMap;
283  }
285  inline void addUnaryNode(const PAGNode* res, const UnaryOPPE* edge)
286  {
287  unaryNodeMap[res].push_back(edge);
288  }
290  inline bool isUnaryNode(const PAGNode* node) const
291  {
292  return unaryNodeMap.find(node) != unaryNodeMap.end();
293  }
295  inline UnaryNodeMap& getUnaryNodeMap()
296  {
297  return unaryNodeMap;
298  }
300  inline void addCmpNode(const PAGNode* res, const CmpPE* edge)
301  {
302  cmpNodeMap[res].push_back(edge);
303  }
305  inline bool isCmpNode(const PAGNode* node) const
306  {
307  return cmpNodeMap.find(node) != cmpNodeMap.end();
308  }
310  inline CmpNodeMap& getCmpNodeMap()
311  {
312  return cmpNodeMap;
313  }
315 
317 
318  inline void addFunArgs(const SVFFunction* fun, const PAGNode* arg)
320  {
321  FunEntryBlockNode* funEntryBlockNode = icfg->getFunEntryBlockNode(fun);
322  funEntryBlockNode->addFormalParms(arg);
323  funArgsListMap[fun].push_back(arg);
324  }
326  inline void addFunRet(const SVFFunction* fun, const PAGNode* ret)
327  {
328  FunExitBlockNode* funExitBlockNode = icfg->getFunExitBlockNode(fun);
329  funExitBlockNode->addFormalRet(ret);
330  funRetMap[fun] = ret;
331  }
333  inline void addCallSiteArgs(CallBlockNode* callBlockNode,const PAGNode* arg)
334  {
335  callBlockNode->addActualParms(arg);
336  callSiteArgsListMap[callBlockNode].push_back(arg);
337  }
339  inline void addCallSiteRets(RetBlockNode* retBlockNode,const PAGNode* arg)
340  {
341  retBlockNode->addActualRet(arg);
342  callSiteRetMap[retBlockNode]= arg;
343  }
345  inline bool hasFunArgsList(const SVFFunction* func) const
346  {
347  return (funArgsListMap.find(func) != funArgsListMap.end());
348  }
350  inline FunToArgsListMap& getFunArgsMap()
351  {
352  return funArgsListMap;
353  }
355  inline const PAGNodeList& getFunArgsList(const SVFFunction* func) const
356  {
357  FunToArgsListMap::const_iterator it = funArgsListMap.find(func);
358  assert(it != funArgsListMap.end() && "this function doesn't have arguments");
359  return it->second;
360  }
362  inline bool hasCallSiteArgsMap(const CallBlockNode* cs) const
363  {
364  return (callSiteArgsListMap.find(cs) != callSiteArgsListMap.end());
365  }
367  inline CSToArgsListMap& getCallSiteArgsMap()
368  {
369  return callSiteArgsListMap;
370  }
372  inline const PAGNodeList& getCallSiteArgsList(const CallBlockNode* cs) const
373  {
374  CSToArgsListMap::const_iterator it = callSiteArgsListMap.find(cs);
375  assert(it != callSiteArgsListMap.end() && "this call site doesn't have arguments");
376  return it->second;
377  }
379  inline CSToRetMap& getCallSiteRets()
380  {
381  return callSiteRetMap;
382  }
384  inline const PAGNode* getCallSiteRet(const RetBlockNode* cs) const
385  {
386  CSToRetMap::const_iterator it = callSiteRetMap.find(cs);
387  assert(it != callSiteRetMap.end() && "this call site doesn't have return");
388  return it->second;
389  }
390  inline bool callsiteHasRet(const RetBlockNode* cs) const
391  {
392  return callSiteRetMap.find(cs) != callSiteRetMap.end();
393  }
395  inline FunToRetMap& getFunRets()
396  {
397  return funRetMap;
398  }
400  inline const PAGNode* getFunRet(const SVFFunction* func) const
401  {
402  FunToRetMap::const_iterator it = funRetMap.find(func);
403  assert(it != funRetMap.end() && "this function doesn't have return");
404  return it->second;
405  }
406  inline bool funHasRet(const SVFFunction* func) const
407  {
408  return funRetMap.find(func) != funRetMap.end();
409  }
411 
413 
414  inline Size_t getPAGNodeNum() const
415  {
416  return nodeNum;
417  }
418  inline Size_t getPAGEdgeNum() const
419  {
420  return edgeNum;
421  }
422  inline Size_t getValueNodeNum() const
423  {
424  return symInfo->valSyms().size();
425  }
426  inline Size_t getObjectNodeNum() const
427  {
428  return symInfo->idToObjMap().size();
429  }
430  inline Size_t getFieldValNodeNum() const
431  {
432  return GepValNodeMap.size();
433  }
434  inline Size_t getFieldObjNodeNum() const
435  {
436  return GepObjNodeMap.size();
437  }
439 
441  inline NodeID getGepValNode(const Value* curInst, NodeID base, const LocationSet& ls) const
442  {
443  GepValPNMap::const_iterator iter = GepValNodeMap.find(curInst);
444  if(iter==GepValNodeMap.end()){
445  return UINT_MAX;
446  }
447  else{
448  NodeLocationSetMap::const_iterator lit = iter->second.find(std::make_pair(base, ls));
449  if(lit==iter->second.end())
450  return UINT_MAX;
451  else
452  return lit->second;
453  }
454  }
455 
457 
458  inline const CallSiteToFunPtrMap& getIndirectCallsites() const
459  {
460  return indCallSiteToFunPtrMap;
461  }
462  inline void addIndirectCallsites(const CallBlockNode* cs,NodeID funPtr)
463  {
464  bool added = indCallSiteToFunPtrMap.insert(std::make_pair(cs,funPtr)).second;
465  funPtrToCallSitesMap[funPtr].insert(cs);
466  assert(added && "adding the same indirect callsite twice?");
467  }
468  inline NodeID getFunPtr(const CallBlockNode* cs) const
469  {
470  CallSiteToFunPtrMap::const_iterator it = indCallSiteToFunPtrMap.find(cs);
471  assert(it!=indCallSiteToFunPtrMap.end() && "indirect callsite not have a function pointer?");
472  return it->second;
473  }
474  inline const CallSiteSet& getIndCallSites(NodeID funPtr) const
475  {
476  FunPtrToCallSitesMap::const_iterator it = funPtrToCallSitesMap.find(funPtr);
477  assert(it!=funPtrToCallSitesMap.end() && "function pointer not used at any indirect callsite?");
478  return it->second;
479  }
480  inline bool isIndirectCallSites(const CallBlockNode* cs) const
481  {
482  return (indCallSiteToFunPtrMap.find(cs) != indCallSiteToFunPtrMap.end());
483  }
484  inline bool isFunPtr(NodeID id) const
485  {
486  return (funPtrToCallSitesMap.find(id) != funPtrToCallSitesMap.end());
487  }
489 
491  inline bool findPAGNode(NodeID id) const
492  {
493  return hasGNode(id);
494  }
495 
497 
499  {
500  return getIntraPAGEdge(getPAGNode(src), getPAGNode(dst), kind);
501  }
503  {
504  PAGEdge edge(src,dst,kind);
505  const PAGEdge::PAGEdgeSetTy& edgeSet = getEdgeSet(kind);
506  PAGEdge::PAGEdgeSetTy::const_iterator it = edgeSet.find(&edge);
507  assert(it != edgeSet.end() && "can not find pag edge");
508  return (*it);
509  }
511 
513  inline PAGNode* getPAGNode(NodeID id) const
514  {
515  return getGNode(id);
516  }
517 
519 
520  inline NodeID getValueNode(const Value *V)
522  {
523  return symInfo->getValSym(V);
524  }
525  inline bool hasValueNode(const Value* V)
526  {
527  return symInfo->hasValSym(V);
528  }
531  inline NodeID getObjectNode(const Value *V)
532  {
533  return symInfo->getObjSym(V);
534  }
536  inline NodeID getObjectNode(const MemObj *mem)
537  {
538  return mem->getSymId();
539  }
543 
544  inline const MemObj*getObject(NodeID id) const
545  {
546  const PAGNode* node = getPAGNode(id);
547  if(const ObjPN* objPN = SVFUtil::dyn_cast<ObjPN>(node))
548  return getObject(objPN);
549  else
550  return nullptr;
551  }
552  inline const MemObj*getObject(const ObjPN* node) const
553  {
554  return node->getMemObj();
555  }
557 
559  inline NodeID getReturnNode(const SVFFunction* func) const
560  {
561  return symInfo->getRetSym(func->getLLVMFun());
562  }
564  inline NodeID getVarargNode(const SVFFunction* func) const
565  {
566  return symInfo->getVarargSym(func->getLLVMFun());
567  }
569  NodeID getGepObjNode(const MemObj* obj, const LocationSet& ls);
571  NodeID getGepObjNode(NodeID id, const LocationSet& ls) ;
573 
574  inline NodeID getFIObjNode(const MemObj* obj) const
575  {
576  return obj->getSymId();
577  }
578  inline NodeID getFIObjNode(NodeID id) const
579  {
580  PAGNode* node = pag->getPAGNode(id);
581  assert(SVFUtil::isa<ObjPN>(node) && "need an object node");
582  ObjPN* obj = SVFUtil::cast<ObjPN>(node);
583  return getFIObjNode(obj->getMemObj());
584  }
586 
588 
589  inline NodeID getBlackHoleNode() const
590  {
591  return symInfo->blackholeSymID();
592  }
593  inline NodeID getConstantNode() const
594  {
595  return symInfo->constantSymID();
596  }
597  inline NodeID getBlkPtr() const
598  {
599  return symInfo->blkPtrSymID();
600  }
601  inline NodeID getNullPtr() const
602  {
603  return symInfo->nullPtrSymID();
604  }
605  inline bool isBlkPtr(NodeID id) const
606  {
607  return (SymbolTableInfo::isBlkPtr(id));
608  }
609  inline bool isNullPtr(NodeID id) const
610  {
611  return (SymbolTableInfo::isNullPtr(id));
612  }
613  inline bool isBlkObjOrConstantObj(NodeID id) const
614  {
615  return (isBlkObj(id) || isConstantObj(id));
616  }
617  inline bool isBlkObj(NodeID id) const
618  {
619  return SymbolTableInfo::isBlkObj(id);
620  }
621  inline bool isConstantObj(NodeID id) const
622  {
623  const MemObj* obj = getObject(id);
624  assert(obj && "not an object node?");
625  return SymbolTableInfo::isConstantObj(id) || obj->isConstant();
626  }
627  inline bool isNonPointerObj(NodeID id) const
628  {
629  PAGNode* node = getPAGNode(id);
630  if (FIObjPN* fiNode = SVFUtil::dyn_cast<FIObjPN>(node))
631  {
632  return (fiNode->getMemObj()->hasPtrObj() == false);
633  }
634  else if (GepObjPN* gepNode = SVFUtil::dyn_cast<GepObjPN>(node))
635  {
636  return (gepNode->getMemObj()->isNonPtrFieldObj(gepNode->getLocationSet()));
637  }
638  else if (SVFUtil::isa<DummyObjPN>(node))
639  {
640  return false;
641  }
642  else
643  {
644  assert(false && "expecting a object node");
645  return false;
646  }
647  }
648  inline const MemObj* getBlackHoleObj() const
649  {
650  return symInfo->getBlkObj();
651  }
652  inline const MemObj* getConstantObj() const
653  {
654  return symInfo->getConstantObj();
655  }
657 
659  {
660  return nodeNumAfterPAGBuild;
661  }
663  {
664  nodeNumAfterPAGBuild = num;
665  }
666 
668 
669  NodeID getBaseValNode(NodeID nodeId);
672  inline NodeID getBaseObjNode(NodeID id) const
673  {
674  return getBaseObj(id)->getSymId();
675  }
676  inline const MemObj* getBaseObj(NodeID id) const
677  {
678  const PAGNode* node = pag->getPAGNode(id);
679  assert(SVFUtil::isa<ObjPN>(node) && "need an object node");
680  const ObjPN* obj = SVFUtil::cast<ObjPN>(node);
681  return obj->getMemObj();
682  }
684 
686 
687  NodeBS& getAllFieldsObjNode(const MemObj* obj);
691 
693 
694  inline NodeID addNode(PAGNode* node, NodeID i)
696  {
697  addGNode(i,node);
698  return i;
699  }
701  inline NodeID addValNode(const Value* val, NodeID i)
702  {
703  PAGNode *node = new ValPN(val,i);
704  return addValNode(val, node, i);
705  }
707  inline NodeID addObjNode(const Value* val, NodeID i)
708  {
709  MemObj* mem = symInfo->getObj(symInfo->getObjSym(val));
710  assert(((mem->getSymId() == i) || (symInfo->getGlobalRep(val)!=val)) && "not same object id?");
711  return addFIObjNode(mem);
712  }
714  inline NodeID addRetNode(const SVFFunction* val, NodeID i)
715  {
716  PAGNode *node = new RetPN(val,i);
717  return addRetNode(val, node, i);
718  }
720  inline NodeID addVarargNode(const SVFFunction* val, NodeID i)
721  {
722  PAGNode *node = new VarArgPN(val,i);
723  return addNode(node,i);
724  }
725 
727  NodeID addGepValNode(const Value* curInst,const Value* val, const LocationSet& ls, NodeID i, const Type *type, u32_t fieldidx);
729  NodeID addGepObjNode(const MemObj* obj, const LocationSet& ls);
731  NodeID addFIObjNode(const MemObj* obj);
733 
735 
737  {
738  return addDummyValNode(NodeIDAllocator::get()->allocateValueId());
739  }
741  {
742  return addValNode(nullptr, new DummyValPN(i), i);
743  }
744  inline NodeID addDummyObjNode(const Type* type = nullptr)
745  {
746  return addDummyObjNode(NodeIDAllocator::get()->allocateObjectId(), type);
747  }
748  inline NodeID addDummyObjNode(NodeID i, const Type* type)
749  {
750  const MemObj* mem = addDummyMemObj(i, type);
751  return addObjNode(nullptr, new DummyObjPN(i,mem), i);
752  }
753  inline const MemObj* addDummyMemObj(NodeID i, const Type* type)
754  {
756  }
758  {
760  }
762  {
764  }
766  {
767  return addDummyValNode(getBlkPtr());
768  }
770 
772  inline NodeID addValNode(const Value*, PAGNode *node, NodeID i)
773  {
774  assert(hasGNode(i) == false && "This NodeID clashes here. Please check NodeIDAllocator. Switch Strategy::DEBUG to SEQ or DENSE");
775  return addNode(node,i);
776  }
778  inline NodeID addObjNode(const Value*, PAGNode *node, NodeID i)
779  {
780  assert(hasGNode(i) == false && "This NodeID clashes here. Please check NodeIDAllocator. Switch Strategy::DEBUG to SEQ or DENSE");
781  return addNode(node,i);
782  }
784  inline NodeID addRetNode(const SVFFunction*, PAGNode *node, NodeID i)
785  {
786  return addNode(node,i);
787  }
789  inline NodeID addVarargNode(const SVFFunction*, PAGNode *node, NodeID i)
790  {
791  return addNode(node,i);
792  }
793 
795 
796  bool addEdge(PAGNode* src, PAGNode* dst, PAGEdge* edge);
798 
803  PAGEdge* hasLabeledEdge(PAGNode* src, PAGNode* dst, PAGEdge::PEDGEK kind, const ICFGNode* cs);
804 
806  AddrPE* addAddrPE(NodeID src, NodeID dst);
808  CopyPE* addCopyPE(NodeID src, NodeID dst);
810  CmpPE* addCmpPE(NodeID src, NodeID dst);
814  UnaryOPPE* addUnaryOPPE(NodeID src, NodeID dst);
816  LoadPE* addLoadPE(NodeID src, NodeID dst);
818  StorePE* addStorePE(NodeID src, NodeID dst, const IntraBlockNode* val);
820  CallPE* addCallPE(NodeID src, NodeID dst, const CallBlockNode* cs);
822  RetPE* addRetPE(NodeID src, NodeID dst, const CallBlockNode* cs);
824  GepPE* addGepPE(NodeID src, NodeID dst, const LocationSet& ls, bool constGep);
826  NormalGepPE* addNormalGepPE(NodeID src, NodeID dst, const LocationSet& ls);
830  TDForkPE* addThreadForkPE(NodeID src, NodeID dst, const CallBlockNode* cs);
832  TDJoinPE* addThreadJoinPE(NodeID src, NodeID dst, const CallBlockNode* cs);
834 
837 
839 
840  bool isValidPointer(NodeID nodeId) const;
841 
842  bool isValidTopLevelPtr(const PAGNode* node);
844 
846  inline std::string getGraphName() const
847  {
848  return "PAG";
849  }
850 
852  void print();
853 
855  void dump(std::string name);
856 
858  void view();
859 
860 };
861 
862 } // End namespace SVF
863 
864 namespace llvm
865 {
866 
867 /* !
868  * GraphTraits specializations of PAG to be used for the generic graph algorithms.
869  * Provide graph traits for tranversing from a PAG node using standard graph traversals.
870  */
871 template<> struct GraphTraits<SVF::PAGNode*> : public GraphTraits<SVF::GenericNode<SVF::PAGNode,SVF::PAGEdge>* >
872 {
873 };
874 
876 template<> struct GraphTraits<Inverse<SVF::PAGNode *> > : public GraphTraits<Inverse<SVF::GenericNode<SVF::PAGNode,SVF::PAGEdge>* > >
877 {
878 };
879 
880 template<> struct GraphTraits<SVF::PAG*> : public GraphTraits<SVF::GenericGraph<SVF::PAGNode,SVF::PAGEdge>* >
881 {
883 };
884 
885 } // End namespace llvm
886 
887 #endif /* PAG_H_ */
std::vector< const CopyPE * > CopyPEList
Definition: PAG.h:58
Map< const PAGNode *, BinaryOPList > BinaryNodeMap
Definition: PAG.h:63
bool hasPAGEdgeList(const ICFGNode *inst) const
Whether this instruction has PAG Edge.
Definition: PAG.h:218
NodeID addValNode(const Value *val, NodeID i)
Add a value (pointer) node.
Definition: PAG.h:701
static PAG * pag
Singleton pattern here to enable instance of PAG can only be created once.
Definition: PAG.h:100
const PAGNode * getFunRet(const SVFFunction *func) const
Get function return list.
Definition: PAG.h:400
bool hasCallSiteArgsMap(const CallBlockNode *cs) const
Callsite has argument list.
Definition: PAG.h:362
bool hasValSym(const Value *val)
static bool isBlkObj(NodeID id)
static void releasePAG()
Definition: PAG.h:168
NodeID getValueNode(const Value *V)
Get PAG Node according to LLVM value.
Definition: PAG.h:521
std::vector< const UnaryOPPE * > UnaryOPList
Definition: PAG.h:60
Definition: ConsG.h:385
NodeID getBaseValNode(NodeID nodeId)
Base and Offset methods for Value and Object node.
Definition: PAG.cpp:818
MemObj * getBlkObj() const
static void handleBlackHole(bool b)
PAG build configurations.
Definition: PAG.cpp:1097
void addToInstPAGEdgeList(ICFGNode *inst, PAGEdge *edge)
Add a PAGEdge into instruction map.
Definition: PAG.h:237
u32_t totalPTAPAGEdge
Definition: PAG.h:118
const MemObj * getBlackHoleObj() const
Definition: PAG.h:648
NodeID addConstantObjNode()
Definition: PAG.h:761
NodeID addGepObjNode(const MemObj *obj, const LocationSet &ls)
Add a field obj node, this method can only invoked by getGepObjNode.
Definition: PAG.cpp:695
IDToMemMapTy & idToObjMap()
ICFG * getICFG()
Return ICFG.
Definition: PAG.h:133
MemObj * getConstantObj() const
bool isBlkObjOrConstantObj(NodeID id) const
Definition: PAG.h:613
void addFunRet(const SVFFunction *fun, const PAGNode *ret)
Add function returns.
Definition: PAG.h:326
Map< const SVFFunction *, PAGEdgeSet > FunToPAGEdgeSetMap
Definition: PAG.h:70
SymID blackholeSymID() const
const MemObj * getMemObj() const
Return memory object.
Definition: PAGNode.h:359
const MemObj * addDummyMemObj(NodeID i, const Type *type)
Definition: PAG.h:753
SymID getVarargSym(const Function *val) const
void addGlobalPAGEdge(const PAGEdge *edge)
Get global PAGEdges (not in a procedure)
Definition: PAG.h:245
const MemObj * getObject(const ObjPN *node) const
Definition: PAG.h:552
CallPE * addCallPE(NodeID src, NodeID dst, const CallBlockNode *cs)
Add Call edge.
Definition: PAG.cpp:494
BinaryOPPE * addBinaryOPPE(NodeID src, NodeID dst)
Add Copy edge.
Definition: PAG.cpp:425
SymID getRetSym(const Function *val) const
virtual ~PAG()
Destructor.
Definition: PAG.h:177
u32_t NodeID
Definition: SVFBasicTypes.h:80
NodeID addVarargNode(const SVFFunction *, PAGNode *node, NodeID i)
Add a unique vararg node for a procedure.
Definition: PAG.h:789
Map< NodeID, NodeID > NodeToNodeMap
Definition: PAG.h:72
llvm::Type Type
Definition: BasicTypes.h:75
FunToRetMap funRetMap
Map a function to its unique function return PAGNodes.
Definition: PAG.h:99
bool addEdge(PAGNode *src, PAGNode *dst, PAGEdge *edge)
Add an edge into PAG.
Definition: PAG.cpp:754
void addFunArgs(const SVFFunction *fun, const PAGNode *arg)
Get/set method for function/callsite arguments and returns.
Definition: PAG.h:319
u32_t getNodeNumAfterPAGBuild() const
Definition: PAG.h:658
bool funHasRet(const SVFFunction *func) const
Definition: PAG.h:406
CallSiteToFunPtrMap indCallSiteToFunPtrMap
Map an indirect callsite to its function pointer.
Definition: PAG.h:101
#define assert(ex)
Definition: util.h:141
bool isNonPointerObj(NodeID id) const
Definition: PAG.h:627
static bool isNullPtr(NodeID id)
GenericNode< PAGNode, PAGEdge >::GEdgeSetTy PAGEdgeSetTy
Definition: PAGEdge.h:169
BinaryNodeMap binaryNodeMap
A set of binary edges.
Definition: PAG.h:93
Size_t getValueNodeNum() const
Definition: PAG.h:422
void destroy()
Clean up memory.
Definition: PAG.cpp:866
Map< NodeID, CallSiteSet > FunPtrToCallSitesMap
Definition: PAG.h:53
NodeID addDummyValNode(NodeID i)
Definition: PAG.h:740
PAGEdgeSet globPAGEdgesSet
Global PAGEdges without control flow information.
Definition: PAG.h:91
const Value * getGlobalRep(const Value *val) const
find the unique defined global across multiple modules
u32_t edgeNum
total num of node
Definition: GenericGraph.h:439
Map< const RetBlockNode *, const PAGNode * > CSToRetMap
Definition: PAG.h:68
static bool isConstantObj(NodeID id)
bool isUnaryNode(const PAGNode *node) const
Whether this PAGNode is an unary node.
Definition: PAG.h:290
ICFG * icfg
Definition: PAG.h:108
Map< const SVFFunction *, PAGNodeList > FunToArgsListMap
Definition: PAG.h:66
void addActualParms(const PAGNode *ap)
Add actual parameters.
Definition: ICFGNode.h:424
LocationSet getLocationSetFromBaseNode(NodeID nodeId)
Definition: PAG.cpp:847
NodeID getReturnNode(const SVFFunction *func) const
GetReturnNode - Return the unique node representing the return value of a function.
Definition: PAG.h:559
u32_t nodeNum
total num of edge
Definition: GenericGraph.h:440
NodeID addObjNode(const Value *val, NodeID i)
Add a memory obj node.
Definition: PAG.h:707
Map< const CallBlockNode *, PAGNodeList > CSToArgsListMap
Definition: PAG.h:67
void initialiseCandidatePointers()
Initialize candidate pointers.
Definition: PAG.h:144
NodeID addDummyValNode()
Add a dummy value/object node according to node ID (llvm value is null)
Definition: PAG.h:736
NodeID getObjectNode(const MemObj *mem)
getObject - return mem object id
Definition: PAG.h:536
Map< const SVFFunction *, const PAGNode * > FunToRetMap
Definition: PAG.h:69
SymID nullPtrSymID() const
Definition: PAG.h:47
ValueToIDMapTy & valSyms()
Get different kinds of syms maps.
CSToArgsListMap & getCallSiteArgsMap()
Get callsite argument list.
Definition: PAG.h:367
MemObjToFieldsMap memToFieldsMap
Map a mem object id to all its fields.
Definition: PAG.h:90
NodeID addDummyObjNode(NodeID i, const Type *type)
Definition: PAG.h:748
const MemObj * getObject(NodeID id) const
Definition: PAG.h:544
NodeLocationSetMap & getGepObjNodeMap()
Return GepObjNodeMap.
Definition: PAG.h:127
Map< const PAGNode *, CmpPEList > CmpNodeMap
Definition: PAG.h:65
OrderedNodeSet & getAllValidPtrs()
Return valid pointers.
Definition: PAG.h:139
Inst2PAGEdgesMap inst2PTAPAGEdgesMap
Map a instruction to its PointerAnalysis related PAGEdges.
Definition: PAG.h:87
PAGEdge::PAGKindToEdgeSetMapTy PTAPAGEdgeKindToSetMap
Definition: PAG.h:85
void view()
View graph from the debugger.
Definition: PAG.cpp:1089
UnaryNodeMap unaryNodeMap
A set of unary edges.
Definition: PAG.h:94
Map< const ICFGNode *, PAGEdgeList > Inst2PAGEdgesMap
Definition: PAG.h:71
Size_t getFieldObjNodeNum() const
Definition: PAG.h:434
MemObjToFieldsMap & getMemToFieldsMap()
Return memToFieldsMap.
Definition: PAG.h:121
PAGEdgeSet & getGlobalPAGEdgeSet()
Get global PAGEdges (not in a procedure)
Definition: PAG.h:250
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
Definition: SVFBasicTypes.h:98
bool isPTAEdge() const
Whether src and dst nodes are both of pointer type.
Definition: PAG.cpp:1010
void addCallSiteArgs(CallBlockNode *callBlockNode, const PAGNode *arg)
Add callsite arguments.
Definition: PAG.h:333
MemObj * getObj(SymID id) const
const MemObj * getConstantObj() const
Definition: PAG.h:652
CallSiteSet callSiteSet
Definition: PAG.h:109
unsigned u32_t
Definition: SVFBasicTypes.h:75
NodeID getObjectNode(const Value *V)
Definition: PAG.h:531
void addBinaryNode(const PAGNode *res, const BinaryOPPE *edge)
Add phi node information.
Definition: PAG.h:270
OrderedNodeSet candidatePointers
Definition: PAG.h:106
GepPE * addGepPE(NodeID src, NodeID dst, const LocationSet &ls, bool constGep)
Add Gep edge.
Definition: PAG.cpp:576
void setNodeNumAfterPAGBuild(u32_t num)
Definition: PAG.h:662
NodeID addVarargNode(const SVFFunction *val, NodeID i)
Add a unique vararg node for a procedure.
Definition: PAG.h:720
NodeID getFIObjNode(const MemObj *obj) const
Get a field-insensitive obj PAG node according to a mem obj.
Definition: PAG.h:574
NodeID addDummyObjNode(const Type *type=nullptr)
Definition: PAG.h:744
NodeID addRetNode(const SVFFunction *, PAGNode *node, NodeID i)
Add a unique return node for a procedure.
Definition: PAG.h:784
NodeBS & getAllFieldsObjNode(const MemObj *obj)
Get all fields of an object.
Definition: PAG.cpp:776
bool isConstantObj(NodeID id) const
Definition: PAG.h:621
PAGEdge::PAGEdgeSetTy & getPTAEdgeSet(PAGEdge::PEDGEK kind)
Get PTA edges set according to its kind.
Definition: PAG.h:213
PAGEdge::PAGKindToEdgeSetMapTy PAGEdgeKindToSetMap
Definition: PAG.h:84
static PAG * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis. ...
Definition: PAG.h:160
const PAGNodeList & getCallSiteArgsList(const CallBlockNode *cs) const
Get callsite argument list.
Definition: PAG.h:372
std::pair< NodeID, Size_t > NodeOffset
Definition: PAG.h:73
NodeID addBlackholeObjNode()
Definition: PAG.h:757
Map< NodePair, NodeID > NodePairSetMap
Definition: PAG.h:78
PAGEdge * addBlackHoleAddrPE(NodeID node)
Set a pointer points-to black hole (e.g. int2ptr)
Definition: PAG.cpp:528
NodeID getVarargNode(const SVFFunction *func) const
getVarargNode - Return the unique node representing the variadic argument of a variadic function...
Definition: PAG.h:564
bool hasGNode(NodeID id) const
Has a node.
Definition: GenericGraph.h:399
OrderedMap< const CallBlockNode *, NodeID > CallSiteToFunPtrMap
Definition: PAG.h:52
NodeID addGepValNode(const Value *curInst, const Value *val, const LocationSet &ls, NodeID i, const Type *type, u32_t fieldidx)
Add a temp field value node, this method can only invoked by getGepValNode.
Definition: PAG.cpp:635
PAGNode * getPAGNode(NodeID id) const
Get PAGNode ID.
Definition: PAG.h:513
PAGEdge * hasLabeledEdge(PAGNode *src, PAGNode *dst, PAGEdge::PEDGEK kind, const ICFGNode *cs)
Definition: PAG.cpp:739
bool isBlkPtr(NodeID id) const
Definition: PAG.h:605
IDToNodeMapTy::iterator iterator
Node Iterators.
Definition: GenericGraph.h:337
Map< const Value *, NodeLocationSetMap > GepValPNMap
Definition: PAG.h:77
SymID constantSymID() const
std::vector< const PAGEdge * > PAGEdgeList
Definition: PAG.h:56
void addFormalParms(const PAGNode *fp)
Add formal parameters.
Definition: ICFGNode.h:274
NodeID addRetNode(const SVFFunction *val, NodeID i)
Add a unique return node for a procedure.
Definition: PAG.h:714
std::unordered_set< Key, Hash, KeyEqual, Allocator > Set
Definition: SVFBasicTypes.h:93
SymID getObjSym(const Value *val) const
const MemObj * createDummyObj(SymID symId, const Type *type)
Can only be invoked by PAG::addDummyNode() when creaing PAG from file.
NodeBS getFieldsAfterCollapse(NodeID id)
Definition: PAG.cpp:798
NodeID getGepValNode(const Value *curInst, NodeID base, const LocationSet &ls) const
Due to constaint expression, curInst is used to distinguish different instructions (e...
Definition: PAG.h:441
NodeID getGepObjNode(const MemObj *obj, const LocationSet &ls)
Get a field PAG Object node according to base mem obj and offset.
Definition: PAG.cpp:671
AddrPE * addAddrPE(NodeID src, NodeID dst)
Add Address edge.
Definition: PAG.cpp:373
Size_t getPAGEdgeNum() const
Definition: PAG.h:418
signed long Size_t
Definition: SVFBasicTypes.h:78
NodeID getBlackHoleNode() const
Get black hole and constant id.
Definition: PAG.h:589
bool callsiteHasRet(const RetBlockNode *cs) const
Definition: PAG.h:390
CmpNodeMap & getCmpNodeMap()
Get all phi copy edges.
Definition: PAG.h:310
BinaryNodeMap & getBinaryNodeMap()
Get all phi copy edges.
Definition: PAG.h:280
PAGEdgeList & getInstPAGEdgeList(const ICFGNode *inst)
Given an instruction, get all its PAGEdges.
Definition: PAG.h:227
NodeID addNode(PAGNode *node, NodeID i)
add node into PAG
Definition: PAG.h:695
void addCallSite(const CallBlockNode *call)
Definition: PAG.h:197
NodeID getNullPtr() const
Definition: PAG.h:601
CopyPE * addCopyPE(NodeID src, NodeID dst)
Add Copy edge.
Definition: PAG.cpp:390
NormalGepPE * addNormalGepPE(NodeID src, NodeID dst, const LocationSet &ls)
Add Offset(Gep) edge.
Definition: PAG.cpp:595
Set< const PAGEdge * > PAGEdgeSet
Definition: PAG.h:55
static bool isBlkPtr(NodeID id)
std::vector< const PAGNode * > PAGNodeList
Definition: PAG.h:57
FunExitBlockNode * getFunExitBlockNode(const SVFFunction *fun)
Add a function exit node.
Definition: ICFG.cpp:239
const CallSiteSet & getIndCallSites(NodeID funPtr) const
Definition: PAG.h:474
UnaryNodeMap & getUnaryNodeMap()
Get all unary edges.
Definition: PAG.h:295
Set< const CallBlockNode * > CallSiteSet
Definition: PAG.h:51
SVFModule * getModule()
Module.
Size_t getObjectNodeNum() const
Definition: PAG.h:426
const PAGNode * getCallSiteRet(const RetBlockNode *cs) const
Get callsite return.
Definition: PAG.h:384
NodeID getFIObjNode(NodeID id) const
Definition: PAG.h:578
PAGEdgeList & getInstPTAPAGEdgeList(const ICFGNode *inst)
Given an instruction, get all its PTA PAGEdges.
Definition: PAG.h:232
void addActualRet(const PAGNode *ar)
Add actual return parameter.
Definition: ICFGNode.h:491
bool hasPTAPAGEdgeList(const ICFGNode *inst) const
Definition: PAG.h:222
static SymbolTableInfo * SymbolInfo()
Singleton design here to make sure we only have one instance during any analysis. ...
SymID getValSym(const Value *val)
Get different kinds of syms.
NodeID addValNode(const Value *, PAGNode *node, NodeID i)
Add a value (pointer) node.
Definition: PAG.h:772
Map< const PAGNode *, CopyPEList > PHINodeMap
Definition: PAG.h:62
FunPtrToCallSitesMap funPtrToCallSitesMap
Map a function pointer to the callsites where it is used.
Definition: PAG.h:102
NodeID getBlkPtr() const
Definition: PAG.h:597
void addGNode(NodeID id, NodeType *node)
Add a Node.
Definition: GenericGraph.h:384
void setICFGNode(ICFGNode *node)
Definition: PAGEdge.h:128
VariantGepPE * addVariantGepPE(NodeID src, NodeID dst)
Add Variant(Gep) edge.
Definition: PAG.cpp:614
NodeID getBaseObjNode(NodeID id) const
Definition: PAG.h:672
CmpPE * addCmpPE(NodeID src, NodeID dst)
Add Copy edge.
Definition: PAG.cpp:407
RetPE * addRetPE(NodeID src, NodeID dst, const CallBlockNode *cs)
Add Return edge.
Definition: PAG.cpp:511
Inst2PAGEdgesMap inst2PAGEdgesMap
Map a instruction to its PAGEdges.
Definition: PAG.h:86
PAGEdge::PAGEdgeSetTy & getEdgeSet(PAGEdge::PEDGEK kind)
Get/set methods to get control flow information of a PAGEdge.
Definition: PAG.h:208
bool isConstant() const
Definition: MemModel.h:401
Definition: ICFG.h:46
bool fromFile
Definition: PAG.h:103
std::string getGraphName() const
Return graph name.
Definition: PAG.h:846
SVFModule * getModule()
Get LLVM Module.
Definition: PAG.h:193
SymID getSymId() const
Get the memory object id.
Definition: MemModel.h:331
SymID blkPtrSymID() const
PHINodeMap & getPhiNodeMap()
Get all phi copy edges.
Definition: PAG.h:265
Map< NodeOffset, NodeID > NodeOffsetMap
Definition: PAG.h:75
void dump(std::string name)
Dump PAG.
Definition: PAG.cpp:1081
CSToRetMap callSiteRetMap
Map a callsite to its callsite returns PAGNodes.
Definition: PAG.h:98
const MemObj * getBaseObj(NodeID id) const
Definition: PAG.h:676
Size_t getFieldValNodeNum() const
Definition: PAG.h:430
PAGEdge * getIntraPAGEdge(NodeID src, NodeID dst, PAGEdge::PEDGEK kind)
Get an edge according to src, dst and kind.
Definition: PAG.h:498
GepValPNMap GepValNodeMap
Map a pair<base,off> to a gep value node id.
Definition: PAG.h:88
FunToArgsListMap funArgsListMap
Map a function to a list of all its formal parameters.
Definition: PAG.h:96
TDForkPE * addThreadForkPE(NodeID src, NodeID dst, const CallBlockNode *cs)
Add Thread fork edge for parameter passing.
Definition: PAG.cpp:539
const PAGNodeList & getFunArgsList(const SVFFunction *func) const
Get function arguments list.
Definition: PAG.h:355
Function * getLLVMFun() const
Definition: BasicTypes.h:245
std::pair< NodeID, LocationSet > NodeLocationSet
Definition: PAG.h:74
bool hasFunArgsList(const SVFFunction *func) const
Function has arguments list.
Definition: PAG.h:345
bool isValidPointer(NodeID nodeId) const
Whether a node is a valid pointer.
Definition: PAG.cpp:976
bool isValidTopLevelPtr(const PAGNode *node)
Definition: PAG.cpp:984
for isBitcode
Definition: ContextDDA.h:15
void addIndirectCallsites(const CallBlockNode *cs, NodeID funPtr)
Definition: PAG.h:462
std::vector< const CmpPE * > CmpPEList
Definition: PAG.h:61
static NodeIDAllocator * get(void)
Return (singleton) allocator.
PAGEdge * getIntraPAGEdge(PAGNode *src, PAGNode *dst, PAGEdge::PEDGEK kind)
Definition: PAG.h:502
std::vector< const BinaryOPPE * > BinaryOPList
Definition: PAG.h:59
FunEntryBlockNode * getFunEntryBlockNode(const SVFFunction *fun)
Add a function entry node.
Definition: ICFG.cpp:230
StorePE * addStorePE(NodeID src, NodeID dst, const IntraBlockNode *val)
Add Store edge.
Definition: PAG.cpp:477
llvm::SparseBitVector NodeBS
Definition: SVFBasicTypes.h:87
OrderedSet< NodeID > OrderedNodeSet
void addFormalRet(const PAGNode *fr)
Add actual return parameter.
Definition: ICFGNode.h:330
TDJoinPE * addThreadJoinPE(NodeID src, NodeID dst, const CallBlockNode *cs)
Add Thread join edge for parameter passing.
Definition: PAG.cpp:556
bool isCmpNode(const PAGNode *node) const
Whether this PAGNode is a result operand a of phi node.
Definition: PAG.h:305
FunToRetMap & getFunRets()
Get function return list.
Definition: PAG.h:395
Map< const PAGNode *, UnaryOPList > UnaryNodeMap
Definition: PAG.h:64
CSToArgsListMap callSiteArgsListMap
Map a callsite to a list of all its actual parameters.
Definition: PAG.h:97
void addCallSiteRets(RetBlockNode *retBlockNode, const PAGNode *arg)
Add callsite returns.
Definition: PAG.h:339
Size_t getPAGNodeNum() const
Node and edge statistics.
Definition: PAG.h:414
FunToArgsListMap & getFunArgsMap()
Get function arguments list.
Definition: PAG.h:350
void addCmpNode(const PAGNode *res, const CmpPE *edge)
Add phi node information.
Definition: PAG.h:300
NodeID addObjNode(const Value *, PAGNode *node, NodeID i)
Add a memory obj node.
Definition: PAG.h:778
NodeID addBlackholePtrNode()
Definition: PAG.h:765
void print()
Print PAG.
Definition: PAG.cpp:885
bool isNullPtr(NodeID id) const
Definition: PAG.h:609
PAGEdgeToSetMapTy PAGKindToEdgeSetMapTy
Definition: PAGEdge.h:171
bool findPAGNode(NodeID id) const
Get a pag node according to its ID.
Definition: PAG.h:491
bool isPhiNode(const PAGNode *node) const
Whether this PAGNode is a result operand a of phi node.
Definition: PAG.h:260
SVF::PAGNode * NodeRef
Definition: PAG.h:882
LoadPE * addLoadPE(NodeID src, NodeID dst)
Add Load edge.
Definition: PAG.cpp:459
NodeLocationSetMap GepObjNodeMap
Map a pair<base,off> to a gep obj node id.
Definition: PAG.h:89
NodeID addFIObjNode(const MemObj *obj)
Add a field-insensitive node, this method can only invoked by getFIGepObjNode.
Definition: PAG.cpp:712
CmpNodeMap cmpNodeMap
A set of comparision edges.
Definition: PAG.h:95
Map< NodeID, NodeBS > MemObjToFieldsMap
Definition: PAG.h:54
NodeType * getGNode(NodeID id) const
Get a node.
Definition: GenericGraph.h:391
PHINodeMap phiNodeMap
A set of phi copy edges.
Definition: PAG.h:92
PAG(bool buildFromFile)
all the callsites of a program
Definition: PAG.cpp:362
PAGEdge * hasNonlabeledEdge(PAGNode *src, PAGNode *dst, PAGEdge::PEDGEK kind)
Definition: PAG.cpp:725
CSToRetMap & getCallSiteRets()
Get callsite return.
Definition: PAG.h:379
void addUnaryNode(const PAGNode *res, const UnaryOPPE *edge)
Add unary node information.
Definition: PAG.h:285
const CallSiteSet & getCallSiteSet() const
Definition: PAG.h:201
NodeID getConstantNode() const
Definition: PAG.h:593
bool isBinaryNode(const PAGNode *node) const
Whether this PAGNode is a result operand a of phi node.
Definition: PAG.h:275
UnaryOPPE * addUnaryOPPE(NodeID src, NodeID dst)
Add Unary edge.
Definition: PAG.cpp:442
llvm::Value Value
Definition: BasicTypes.h:78
Map< NodeLocationSet, NodeID > NodeLocationSetMap
Definition: PAG.h:76
SymbolTableInfo * symInfo
Definition: PAG.h:81
bool hasValueNode(const Value *V)
Definition: PAG.h:525
NodeID nodeNumAfterPAGBuild
Definition: PAG.h:107
bool isBuiltFromFile()
Whether this PAG built from a txt file.
Definition: PAG.h:183
bool isBlkObj(NodeID id) const
Definition: PAG.h:617
bool isFunPtr(NodeID id) const
Definition: PAG.h:484
void addPhiNode(const PAGNode *res, const CopyPE *edge)
Add phi node information.
Definition: PAG.h:255
const CallSiteToFunPtrMap & getIndirectCallsites() const
Add/get indirect callsites.
Definition: PAG.h:458
bool isIndirectCallSites(const CallBlockNode *cs) const
Definition: PAG.h:480
NodeID getFunPtr(const CallBlockNode *cs) const
Definition: PAG.h:468
std::map< Key, Value, Compare, Allocator > OrderedMap