Static Value-Flow Analysis
VFGNode.h
Go to the documentation of this file.
1 //===- VFGNode.h ----------------------------------------------------------------//
2 //
3 // SVF: Static Value-Flow Analysis
4 //
5 // Copyright (C) <2013-2018> <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  * VFGNode.h
25  *
26  * Created on: 18 Sep. 2018
27  * Author: Yulei Sui
28  */
29 
30 #ifndef INCLUDE_UTIL_VFGNODE_H_
31 #define INCLUDE_UTIL_VFGNODE_H_
32 
33 #include "Graphs/GenericGraph.h"
34 #include "Graphs/SVFGEdge.h"
35 #include "Graphs/ICFGNode.h"
36 #include "SVFIR/SVFIR.h"
37 
38 namespace SVF
39 {
40 
46 class VFGNode : public GenericVFGNodeTy
47 {
48 
49 public:
52  typedef GNodeK VFGNodeK;
53 
54  typedef VFGEdge::VFGEdgeSetTy::iterator iterator;
55  typedef VFGEdge::VFGEdgeSetTy::const_iterator const_iterator;
58 
59 public:
62  {
63 
64  }
65 
67  virtual const ICFGNode* getICFGNode() const
68  {
69  return icfgNode;
70  }
71 
73  virtual void setICFGNode(const ICFGNode* node )
74  {
75  icfgNode = node;
76  }
77 
79  virtual const SVFFunction* getFun() const
80  {
81  return icfgNode->getFun();
82  }
83 
85  virtual const SVFValue* getValue() const
86  {
87  return nullptr;
88  }
89 
91  virtual const NodeBS getDefSVFVars() const = 0;
92 
94 
95  friend OutStream& operator<< (OutStream &o, const VFGNode &node)
96  {
97  o << node.toString();
98  return o;
99  }
101 
102  virtual const std::string toString() const;
103 
104  static inline bool classof(const VFGNode *)
105  {
106  return true;
107  }
108 
109  static inline bool classof(const GenericVFGNodeTy * node)
110  {
111  return isVFGNodeKinds(node->getNodeKind());
112  }
113 
114 
115  static inline bool classof(const SVFBaseNode* node)
116  {
117  return isVFGNodeKinds(node->getNodeKind());
118  }
119 
120 protected:
122 };
123 
127 class StmtVFGNode : public VFGNode
128 {
129 
130 private:
131  const PAGEdge* pagEdge;
132 
133 public:
136  {
137  }
138 
140  inline bool isPTANode() const
141  {
142  return pagEdge->isPTAEdge();
143  }
144 
147  inline const PAGEdge* getPAGEdge() const
148  {
149  return pagEdge;
150  }
151 
152  inline NodeID getPAGSrcNodeID() const
153  {
154  return pagEdge->getSrcID();
155  }
156 
157  inline NodeID getPAGDstNodeID() const
158  {
159  return pagEdge->getDstID();
160  }
161 
162  inline PAGNode* getPAGSrcNode() const
163  {
164  return pagEdge->getSrcNode();
165  }
166 
167  inline PAGNode* getPAGDstNode() const
168  {
169  return pagEdge->getDstNode();
170  }
172 
174 
175  static inline bool classof(const StmtVFGNode *)
176  {
177  return true;
178  }
179  static inline bool classof(const VFGNode *node)
180  {
181  return isStmtVFGNodeKinds(node->getNodeKind());
182  }
183  static inline bool classof(const GenericVFGNodeTy *node)
184  {
185  return isStmtVFGNodeKinds(node->getNodeKind());
186  }
187  static inline bool classof(const SVFBaseNode*node)
188  {
189  return isStmtVFGNodeKinds(node->getNodeKind());
190  }
192 
193  const SVFValue* getValue() const override;
194  const std::string toString() const override;
195 };
196 
201 {
202 private:
205  void operator=(const LoadVFGNode &);
206 
207 public:
209  LoadVFGNode(NodeID id, const LoadStmt* edge): StmtVFGNode(id, edge,Load)
210  {
211 
212  }
214 
215  static inline bool classof(const LoadVFGNode *)
216  {
217  return true;
218  }
219  static inline bool classof(const StmtVFGNode *node)
220  {
221  return node->getNodeKind() == Load;
222  }
223  static inline bool classof(const VFGNode *node)
224  {
225  return node->getNodeKind() == Load;
226  }
227  static inline bool classof(const GenericVFGNodeTy *node)
228  {
229  return node->getNodeKind() == Load;
230  }
231  static inline bool classof(const SVFBaseNode*node)
232  {
233  return node->getNodeKind() == Load;
234  }
236 
237  const NodeBS getDefSVFVars() const override;
238 
239  const std::string toString() const override;
240 };
241 
246 {
247 private:
250  void operator=(const StoreVFGNode &);
251 
252 public:
255  {
256 
257  }
259 
260  static inline bool classof(const StoreVFGNode *)
261  {
262  return true;
263  }
264  static inline bool classof(const StmtVFGNode *node)
265  {
266  return node->getNodeKind() == Store;
267  }
268  static inline bool classof(const VFGNode *node)
269  {
270  return node->getNodeKind() == Store;
271  }
272  static inline bool classof(const GenericVFGNodeTy *node)
273  {
274  return node->getNodeKind() == Store;
275  }
276  static inline bool classof(const SVFBaseNode*node)
277  {
278  return node->getNodeKind() == Store;
279  }
281 
282  const NodeBS getDefSVFVars() const override;
283 
284  const std::string toString() const override;
285 };
286 
291 {
292 private:
295  void operator=(const CopyVFGNode &);
296 
297 public:
300  {
301 
302  }
304 
305  static inline bool classof(const CopyVFGNode *)
306  {
307  return true;
308  }
309  static inline bool classof(const StmtVFGNode *node)
310  {
311  return node->getNodeKind() == Copy;
312  }
313  static inline bool classof(const VFGNode *node)
314  {
315  return node->getNodeKind() == Copy;
316  }
317  static inline bool classof(const GenericVFGNodeTy *node)
318  {
319  return node->getNodeKind() == Copy;
320  }
321  static inline bool classof(const SVFBaseNode*node)
322  {
323  return node->getNodeKind() == Copy;
324  }
326 
327  const NodeBS getDefSVFVars() const override;
328 
329  const std::string toString() const override;
330 };
331 
332 
337 class CmpVFGNode: public VFGNode
338 {
339 public:
341 protected:
342  const PAGNode* res;
344 
345 private:
348  void operator=(const CmpVFGNode &);
349 
350 public:
352  CmpVFGNode(NodeID id,const PAGNode* r): VFGNode(id,Cmp), res(r) { }
354 
355  static inline bool classof(const CmpVFGNode *)
356  {
357  return true;
358  }
359  static inline bool classof(const VFGNode *node)
360  {
361  return node->getNodeKind() == Cmp;
362  }
363  static inline bool classof(const GenericVFGNodeTy *node)
364  {
365  return node->getNodeKind() == Cmp;
366  }
367  static inline bool classof(const SVFBaseNode*node)
368  {
369  return node->getNodeKind() == Cmp;
370  }
372 
374  inline const PAGNode* getOpVer(u32_t pos) const
375  {
376  OPVers::const_iterator it = opVers.find(pos);
377  assert(it!=opVers.end() && "version is nullptr, did not rename?");
378  return it->second;
379  }
380  inline void setOpVer(u32_t pos, const PAGNode* node)
381  {
382  opVers[pos] = node;
383  }
384  inline const PAGNode* getRes() const
385  {
386  return res;
387  }
388  inline u32_t getOpVerNum() const
389  {
390  return opVers.size();
391  }
392  inline OPVers::const_iterator opVerBegin() const
393  {
394  return opVers.begin();
395  }
396  inline OPVers::const_iterator opVerEnd() const
397  {
398  return opVers.end();
399  }
401 
402  const NodeBS getDefSVFVars() const override;
403 
404  const SVFValue* getValue() const override;
405  const std::string toString() const override;
406 };
407 
408 
413 {
414 public:
416 protected:
417  const PAGNode* res;
419 
420 private:
423  void operator=(const BinaryOPVFGNode &);
424 
425 public:
429 
430  static inline bool classof(const BinaryOPVFGNode *)
431  {
432  return true;
433  }
434  static inline bool classof(const VFGNode *node)
435  {
436  return node->getNodeKind() == BinaryOp;
437  }
438  static inline bool classof(const GenericVFGNodeTy *node)
439  {
440  return node->getNodeKind() == BinaryOp;
441  }
442  static inline bool classof(const SVFBaseNode*node)
443  {
444  return node->getNodeKind() == BinaryOp;
445  }
447 
449  inline const PAGNode* getOpVer(u32_t pos) const
450  {
451  OPVers::const_iterator it = opVers.find(pos);
452  assert(it!=opVers.end() && "version is nullptr, did not rename?");
453  return it->second;
454  }
455  inline void setOpVer(u32_t pos, const PAGNode* node)
456  {
457  opVers[pos] = node;
458  }
459  inline const PAGNode* getRes() const
460  {
461  return res;
462  }
463  inline u32_t getOpVerNum() const
464  {
465  return opVers.size();
466  }
467  inline OPVers::const_iterator opVerBegin() const
468  {
469  return opVers.begin();
470  }
471  inline OPVers::const_iterator opVerEnd() const
472  {
473  return opVers.end();
474  }
476 
477  const NodeBS getDefSVFVars() const override;
478 
479  const SVFValue* getValue() const override;
480  const std::string toString() const override;
481 };
482 
486 class UnaryOPVFGNode: public VFGNode
487 {
488 public:
490 protected:
491  const PAGNode* res;
493 
494 private:
497  void operator=(const UnaryOPVFGNode &);
498 
499 public:
501  UnaryOPVFGNode(NodeID id, const PAGNode *r) : VFGNode(id, UnaryOp), res(r) { }
503 
504  static inline bool classof(const UnaryOPVFGNode *)
505  {
506  return true;
507  }
508  static inline bool classof(const VFGNode *node)
509  {
510  return node->getNodeKind() == UnaryOp;
511  }
512  static inline bool classof(const GenericVFGNodeTy *node)
513  {
514  return node->getNodeKind() == UnaryOp;
515  }
516  static inline bool classof(const SVFBaseNode*node)
517  {
518  return node->getNodeKind() == UnaryOp;
519  }
521 
523  inline const PAGNode* getOpVer(u32_t pos) const
524  {
525  OPVers::const_iterator it = opVers.find(pos);
526  assert(it!=opVers.end() && "version is nullptr, did not rename?");
527  return it->second;
528  }
529  inline void setOpVer(u32_t pos, const PAGNode* node)
530  {
531  opVers[pos] = node;
532  }
533  inline const PAGNode* getRes() const
534  {
535  return res;
536  }
537  inline const PAGNode* getOpVar() const
538  {
539  assert(getOpVerNum()==1 && "UnaryNode can only have one operand!");
540  return getOpVer(0);
541  }
542  inline u32_t getOpVerNum() const
543  {
544  return opVers.size();
545  }
546  inline OPVers::const_iterator opVerBegin() const
547  {
548  return opVers.begin();
549  }
550  inline OPVers::const_iterator opVerEnd() const
551  {
552  return opVers.end();
553  }
555 
556  const NodeBS getDefSVFVars() const override;
557 
558  virtual const std::string toString() const override;
559 };
560 
561 /*
562 * Branch VFGNode including if/else and switch statements
563 */
564 class BranchVFGNode: public VFGNode
565 {
566 private:
569  void operator=(const BranchVFGNode &);
571 public:
575 
576  static inline bool classof(const BranchVFGNode *)
577  {
578  return true;
579  }
580  static inline bool classof(const VFGNode *node)
581  {
582  return node->getNodeKind() == Branch;
583  }
584  static inline bool classof(const GenericVFGNodeTy *node)
585  {
586  return node->getNodeKind() == Branch;
587  }
588  static inline bool classof(const SVFBaseNode*node)
589  {
590  return node->getNodeKind() == Branch;
591  }
593 
595  const BranchStmt* getBranchStmt() const
596  {
597  return brstmt;
598  }
602  {
603  return brstmt->getNumSuccessors();
604  }
606  {
607  return brstmt->getSuccessors();
608  }
609  const ICFGNode* getSuccessor (u32_t i) const
610  {
611  return brstmt->getSuccessor(i);
612  }
614 
615  const NodeBS getDefSVFVars() const override;
616 
617  virtual const std::string toString() const override;
618 };
619 
623 class GepVFGNode: public StmtVFGNode
624 {
625 private:
628  void operator=(const GepVFGNode &);
629 
630 public:
632  GepVFGNode(NodeID id,const GepStmt* edge): StmtVFGNode(id,edge,Gep)
633  {
634 
635  }
637 
638  static inline bool classof(const GepVFGNode *)
639  {
640  return true;
641  }
642  static inline bool classof(const StmtVFGNode *node)
643  {
644  return node->getNodeKind() == Gep;
645  }
646  static inline bool classof(const VFGNode *node)
647  {
648  return node->getNodeKind() == Gep;
649  }
650  static inline bool classof(const GenericVFGNodeTy *node)
651  {
652  return node->getNodeKind() == Gep;
653  }
654  static inline bool classof(const SVFBaseNode*node)
655  {
656  return node->getNodeKind() == Gep;
657  }
659 
660  const NodeBS getDefSVFVars() const override;
661 
662  const std::string toString() const override;
663 };
664 
665 /*
666  * ICFG Node stands for a top level pointer ssa phi node or a formal parameter or a return parameter
667  */
668 class PHIVFGNode : public VFGNode
669 {
670 
671 public:
673 protected:
674  const PAGNode* res;
676 
677 public:
679  PHIVFGNode(NodeID id, const PAGNode* r,VFGNodeK k = TPhi);
680 
682  inline bool isPTANode() const
683  {
684  return res->isPointer();
685  }
686 
688 
689  inline const PAGNode* getOpVer(u32_t pos) const
690  {
691  OPVers::const_iterator it = opVers.find(pos);
692  assert(it!=opVers.end() && "version is nullptr, did not rename?");
693  return it->second;
694  }
695  inline void setOpVer(u32_t pos, const PAGNode* node)
696  {
697  opVers[pos] = node;
698  }
699  inline const PAGNode* getRes() const
700  {
701  return res;
702  }
703  inline u32_t getOpVerNum() const
704  {
705  return opVers.size();
706  }
707  inline OPVers::const_iterator opVerBegin() const
708  {
709  return opVers.begin();
710  }
711  inline OPVers::const_iterator opVerEnd() const
712  {
713  return opVers.end();
714  }
716 
718 
719  static inline bool classof(const PHIVFGNode *)
720  {
721  return true;
722  }
723  static inline bool classof(const VFGNode *node)
724  {
725  return isPHIVFGNodeKinds(node->getNodeKind());
726  }
727  static inline bool classof(const GenericVFGNodeTy *node)
728  {
729  return isPHIVFGNodeKinds(node->getNodeKind());
730  }
731  static inline bool classof(const SVFBaseNode*node)
732  {
733  return isPHIVFGNodeKinds(node->getNodeKind());
734  }
736 
737  const NodeBS getDefSVFVars() const override;
738 
739  const SVFValue* getValue() const override;
740  const std::string toString() const override;
741 };
742 
743 
744 /*
745  * Intra LLVM PHI Node
746  */
748 {
749 
750 public:
752 
753 private:
755 public:
758  {
759  }
760 
761  inline const ICFGNode* getOpIncomingBB(u32_t pos) const
762  {
763  OPIncomingBBs::const_iterator it = opIncomingBBs.find(pos);
764  assert(it!=opIncomingBBs.end() && "version is nullptr, did not rename?");
765  return it->second;
766  }
767  inline void setOpVerAndBB(u32_t pos, const PAGNode* node, const ICFGNode* bb)
768  {
769  opVers[pos] = node;
770  opIncomingBBs[pos] = bb;
771  }
772 
774 
775  static inline bool classof(const IntraPHIVFGNode*)
776  {
777  return true;
778  }
779  static inline bool classof(const PHIVFGNode *node)
780  {
781  return node->getNodeKind() == TIntraPhi;
782  }
783  static inline bool classof(const VFGNode *node)
784  {
785  return node->getNodeKind() == TIntraPhi;
786  }
787  static inline bool classof(const GenericVFGNodeTy *node)
788  {
789  return node->getNodeKind() == TIntraPhi;
790  }
791  static inline bool classof(const SVFBaseNode*node)
792  {
793  return node->getNodeKind() == TIntraPhi;
794  }
796 
797  const std::string toString() const override;
798 };
799 
800 
802 {
803 private:
806  void operator=(const AddrVFGNode &);
807 
808 public:
810  AddrVFGNode(NodeID id, const AddrStmt* edge): StmtVFGNode(id, edge,Addr)
811  {
812 
813  }
815 
816  static inline bool classof(const AddrVFGNode *)
817  {
818  return true;
819  }
820  static inline bool classof(const StmtVFGNode *node)
821  {
822  return node->getNodeKind() == Addr;
823  }
824  static inline bool classof(const VFGNode *node)
825  {
826  return node->getNodeKind() == Addr;
827  }
828  static inline bool classof(const GenericVFGNodeTy *node)
829  {
830  return node->getNodeKind() == Addr;
831  }
832  static inline bool classof(const SVFBaseNode*node)
833  {
834  return node->getNodeKind() == Addr;
835  }
837 
838  const NodeBS getDefSVFVars() const override;
839 
840  const std::string toString() const override;
841 };
842 
843 
844 class ArgumentVFGNode : public VFGNode
845 {
846 
847 protected:
848  const PAGNode* param;
849 
850 public:
853  {
854  }
855 
857  inline bool isPTANode() const
858  {
859  return param->isPointer();
860  }
861 
863 
864  static inline bool classof(const ArgumentVFGNode *)
865  {
866  return true;
867  }
868  static inline bool classof(const VFGNode *node)
869  {
870  return isArgumentVFGNodeKinds(node->getNodeKind());
871  }
872  static inline bool classof(const GenericVFGNodeTy *node)
873  {
874  return isArgumentVFGNodeKinds(node->getNodeKind());
875  }
876  static inline bool classof(const SVFBaseNode*node)
877  {
878  return isArgumentVFGNodeKinds(node->getNodeKind());
879  }
881 
882  const SVFValue* getValue() const override;
883  const std::string toString() const override;
884 };
885 
886 /*
887  * ICFG Node stands for actual parameter node (top level pointers)
888  */
890 {
891 private:
892  const CallICFGNode* cs;
893 public:
896  ArgumentVFGNode(id, n, AParm), cs(c)
897  {
898  }
899 
901  inline const CallICFGNode* getCallSite() const
902  {
903  return cs;
904  }
905 
907  inline const PAGNode* getParam() const
908  {
909  return param;
910  }
911 
913 
914  static inline bool classof(const ActualParmVFGNode *)
915  {
916  return true;
917  }
918  static inline bool classof(const ArgumentVFGNode *node)
919  {
920  return node->getNodeKind() == AParm;
921  }
922  static inline bool classof(const VFGNode *node)
923  {
924  return node->getNodeKind() == AParm;
925  }
926  static inline bool classof(const GenericVFGNodeTy *node)
927  {
928  return node->getNodeKind() == AParm;
929  }
930  static inline bool classof(const SVFBaseNode*node)
931  {
932  return node->getNodeKind() == AParm;
933  }
935 
936  const NodeBS getDefSVFVars() const override;
937 
938  const std::string toString() const override;
939 };
940 
941 
942 /*
943  * ICFG Node stands for formal parameter node (top level pointers)
944  */
946 {
947 private:
948  const SVFFunction* fun;
950 
951 public:
954  ArgumentVFGNode(id, n, FParm), fun(f)
955  {
956  }
957 
959  inline const PAGNode* getParam() const
960  {
961  return param;
962  }
963 
965  inline const SVFFunction* getFun() const override
966  {
967  return fun;
968  }
970  inline void addCallPE(const CallPE* call)
971  {
972  callPEs.insert(call);
973  }
976  inline CallPESet::const_iterator callPEBegin() const
977  {
978  return callPEs.begin();
979  }
980  inline CallPESet::const_iterator callPEEnd() const
981  {
982  return callPEs.end();
983  }
985 
987 
988  static inline bool classof(const FormalParmVFGNode *)
989  {
990  return true;
991  }
992  static inline bool classof(const VFGNode *node)
993  {
994  return node->getNodeKind() == FParm;
995  }
996  static inline bool classof(const ArgumentVFGNode *node)
997  {
998  return node->getNodeKind() == FParm;
999  }
1000  static inline bool classof(const GenericVFGNodeTy *node)
1001  {
1002  return node->getNodeKind() == FParm;
1003  }
1004  static inline bool classof(const SVFBaseNode*node)
1005  {
1006  return node->getNodeKind() == FParm;
1007  }
1009 
1010  const NodeBS getDefSVFVars() const override;
1011 
1012  const std::string toString() const override;
1013 };
1014 
1019 {
1020 private:
1022 
1025  void operator=(const ActualRetVFGNode &);
1026 
1027 public:
1030  ArgumentVFGNode(id, n, ARet), cs(c)
1031  {
1032  }
1034  inline const CallICFGNode* getCallSite() const
1035  {
1036  return cs;
1037  }
1039  inline const SVFFunction* getCaller() const
1040  {
1041  return cs->getCaller();
1042  }
1044  inline const PAGNode* getRev() const
1045  {
1046  return param;
1047  }
1049 
1050  static inline bool classof(const ActualRetVFGNode *)
1051  {
1052  return true;
1053  }
1054  static inline bool classof(const ArgumentVFGNode *node)
1055  {
1056  return node->getNodeKind() == ARet;
1057  }
1058  static inline bool classof(const VFGNode *node)
1059  {
1060  return node->getNodeKind() == ARet;
1061  }
1062  static inline bool classof(const GenericVFGNodeTy *node)
1063  {
1064  return node->getNodeKind() == ARet;
1065  }
1066  static inline bool classof(const SVFBaseNode*node)
1067  {
1068  return node->getNodeKind() == ARet;
1069  }
1071 
1072  const NodeBS getDefSVFVars() const override;
1073 
1074  const std::string toString() const override;
1075 };
1076 
1081 {
1082 private:
1085 
1088  void operator=(const FormalRetVFGNode &);
1089 
1090 public:
1092  FormalRetVFGNode(NodeID id, const PAGNode* n, const SVFFunction* f);
1093 
1095  inline const PAGNode* getRet() const
1096  {
1097  return param;
1098  }
1100  inline const SVFFunction* getFun() const override
1101  {
1102  return fun;
1103  }
1105  inline void addRetPE(const RetPE* retPE)
1106  {
1107  retPEs.insert(retPE);
1108  }
1110  inline RetPESet::const_iterator retPEBegin() const
1111  {
1112  return retPEs.begin();
1113  }
1114  inline RetPESet::const_iterator retPEEnd() const
1115  {
1116  return retPEs.end();
1117  }
1119 
1120  static inline bool classof(const FormalRetVFGNode )
1121  {
1122  return true;
1123  }
1124  static inline bool classof(const VFGNode *node)
1125  {
1126  return node->getNodeKind() == FRet;
1127  }
1128  static inline bool classof(const ArgumentVFGNode *node)
1129  {
1130  return node->getNodeKind() == FRet;
1131  }
1132  static inline bool classof(const GenericVFGNodeTy *node)
1133  {
1134  return node->getNodeKind() == FRet;
1135  }
1136  static inline bool classof(const SVFBaseNode*node)
1137  {
1138  return node->getNodeKind() == FRet;
1139  }
1141 
1142  const NodeBS getDefSVFVars() const override;
1143 
1144  const std::string toString() const override;
1145 };
1146 
1147 /*
1148  * Inter LLVM PHI node (formal parameter)
1149  */
1151 {
1152 
1153 public:
1155  InterPHIVFGNode(NodeID id, const FormalParmVFGNode* fp) : PHIVFGNode(id, fp->getParam(), TInterPhi),fun(fp->getFun()),callInst(nullptr) {}
1157  InterPHIVFGNode(NodeID id, const ActualRetVFGNode* ar) : PHIVFGNode(id, ar->getRev(), TInterPhi), fun(ar->getCaller()),callInst(ar->getCallSite()) {}
1158 
1159  inline bool isFormalParmPHI() const
1160  {
1161  return (fun!=nullptr) && (callInst == nullptr);
1162  }
1163 
1164  inline bool isActualRetPHI() const
1165  {
1166  return (fun!=nullptr) && (callInst != nullptr);
1167  }
1168 
1169  inline const SVFFunction* getFun() const override
1170  {
1171  assert((isFormalParmPHI() || isActualRetPHI()) && "expect a formal parameter phi");
1172  return fun;
1173  }
1174 
1175  inline const CallICFGNode* getCallSite() const
1176  {
1177  assert(isActualRetPHI() && "expect a actual return phi");
1178  return callInst;
1179  }
1180 
1182 
1183  static inline bool classof(const InterPHIVFGNode*)
1184  {
1185  return true;
1186  }
1187  static inline bool classof(const PHIVFGNode *node)
1188  {
1189  return node->getNodeKind() == TInterPhi;
1190  }
1191  static inline bool classof(const VFGNode *node)
1192  {
1193  return node->getNodeKind() == TInterPhi;
1194  }
1195  static inline bool classof(const GenericVFGNodeTy *node)
1196  {
1197  return node->getNodeKind() == TInterPhi;
1198  }
1199  static inline bool classof(const SVFBaseNode*node)
1200  {
1201  return node->getNodeKind() == TInterPhi;
1202  }
1204 
1205  const std::string toString() const override;
1206 
1207 private:
1210 };
1211 
1212 
1213 
1217 class NullPtrVFGNode : public VFGNode
1218 {
1219 private:
1220  const PAGNode* node;
1221 public:
1224  {
1225 
1226  }
1228  inline bool isPTANode() const
1229  {
1230  return node->isPointer();
1231  }
1233  const PAGNode* getPAGNode() const
1234  {
1235  return node;
1236  }
1238 
1239  static inline bool classof(const NullPtrVFGNode *)
1240  {
1241  return true;
1242  }
1243  static inline bool classof(const VFGNode *node)
1244  {
1245  return node->getNodeKind() == NPtr;
1246  }
1247  static inline bool classof(const GenericVFGNodeTy *node)
1248  {
1249  return node->getNodeKind() == NPtr;
1250  }
1251  static inline bool classof(const SVFBaseNode*node)
1252  {
1253  return node->getNodeKind() == NPtr;
1254  }
1256 
1257  const NodeBS getDefSVFVars() const override;
1258 
1259  const std::string toString() const override;
1260 };
1261 
1262 } // End namespace SVF
1263 
1264 #endif /* INCLUDE_UTIL_VFGNODE_H_ */
cJSON * p
Definition: cJSON.cpp:2559
copy
Definition: cJSON.cpp:414
cJSON * n
Definition: cJSON.cpp:2558
const char *const string
Definition: cJSON.h:172
static bool classof(const ActualParmVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:914
const std::string toString() const override
Definition: VFG.cpp:288
const CallICFGNode * cs
Definition: VFGNode.h:892
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:930
ActualParmVFGNode(NodeID id, const PAGNode *n, const CallICFGNode *c)
Constructor.
Definition: VFGNode.h:895
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:926
const PAGNode * getParam() const
Return parameter.
Definition: VFGNode.h:907
const CallICFGNode * getCallSite() const
Return callsite.
Definition: VFGNode.h:901
static bool classof(const ArgumentVFGNode *node)
Definition: VFGNode.h:918
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:281
static bool classof(const VFGNode *node)
Definition: VFGNode.h:922
const CallICFGNode * getCallSite() const
Return callsite.
Definition: VFGNode.h:1034
static bool classof(const ArgumentVFGNode *node)
Definition: VFGNode.h:1054
ActualRetVFGNode(const ActualRetVFGNode &)
place holder
ActualRetVFGNode(NodeID id, const PAGNode *n, const CallICFGNode *c)
Constructor.
Definition: VFGNode.h:1029
void operator=(const ActualRetVFGNode &)
place holder
const PAGNode * getRev() const
Receive parameter at callsite.
Definition: VFGNode.h:1044
const std::string toString() const override
Definition: VFG.cpp:322
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:1062
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:315
static bool classof(const ActualRetVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:1050
const SVFFunction * getCaller() const
Receive parameter at callsite.
Definition: VFGNode.h:1039
ActualRetVFGNode()
place holder
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:1066
const CallICFGNode * cs
Definition: VFGNode.h:1021
static bool classof(const VFGNode *node)
Definition: VFGNode.h:1058
static bool classof(const VFGNode *node)
Definition: VFGNode.h:824
static bool classof(const StmtVFGNode *node)
Definition: VFGNode.h:820
static bool classof(const AddrVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:816
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:832
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:255
const std::string toString() const override
Definition: VFG.cpp:262
AddrVFGNode(NodeID id, const AddrStmt *edge)
Constructor.
Definition: VFGNode.h:810
AddrVFGNode(const AddrVFGNode &)
place holder
void operator=(const AddrVFGNode &)
place holder
AddrVFGNode()
place holder
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:828
ArgumentVFGNode(NodeID id, const PAGNode *p, VFGNodeK k)
Constructor.
Definition: VFGNode.h:852
const std::string toString() const override
Definition: VFG.cpp:272
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:872
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:876
static bool classof(const ArgumentVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:864
bool isPTANode() const
Whether this argument node is of pointer type (used for pointer analysis).
Definition: VFGNode.h:857
const SVFValue * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
Definition: VFG.cpp:1096
static bool classof(const VFGNode *node)
Definition: VFGNode.h:868
const PAGNode * param
Definition: VFGNode.h:848
const PAGNode * res
Definition: VFGNode.h:417
u32_t getOpVerNum() const
Definition: VFGNode.h:463
const SVFValue * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
Definition: VFG.cpp:1086
const PAGNode * getRes() const
Definition: VFGNode.h:459
BinaryOPVFGNode()
place holder
const PAGNode * getOpVer(u32_t pos) const
Operands at a BinaryNode.
Definition: VFGNode.h:449
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:442
void operator=(const BinaryOPVFGNode &)
place holder
static bool classof(const BinaryOPVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:430
void setOpVer(u32_t pos, const PAGNode *node)
Definition: VFGNode.h:455
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:135
Map< u32_t, const PAGNode * > OPVers
Definition: VFGNode.h:415
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:438
BinaryOPVFGNode(const BinaryOPVFGNode &)
place holder
const std::string toString() const override
Definition: VFG.cpp:142
OPVers::const_iterator opVerBegin() const
Definition: VFGNode.h:467
static bool classof(const VFGNode *node)
Definition: VFGNode.h:434
OPVers::const_iterator opVerEnd() const
Definition: VFGNode.h:471
BinaryOPVFGNode(NodeID id, const PAGNode *r)
Constructor.
Definition: VFGNode.h:427
u32_t getNumSuccessors() const
std::vector< std::pair< const ICFGNode *, s32_t > > SuccAndCondPairVec
const ICFGNode * getSuccessor(u32_t i) const
const SuccAndCondPairVec & getSuccessors() const
virtual const std::string toString() const override
Definition: VFG.cpp:188
BranchVFGNode(NodeID id, const BranchStmt *r)
Constructor.
Definition: VFGNode.h:573
const BranchStmt::SuccAndCondPairVec & getSuccessors() const
Definition: VFGNode.h:605
void operator=(const BranchVFGNode &)
place holder
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:584
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:588
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:183
static bool classof(const VFGNode *node)
Definition: VFGNode.h:580
const BranchStmt * brstmt
Definition: VFGNode.h:570
static bool classof(const BranchVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:576
const BranchStmt * getBranchStmt() const
Return the branch statement.
Definition: VFGNode.h:595
u32_t getNumSuccessors() const
Definition: VFGNode.h:601
BranchVFGNode()
place holder
BranchVFGNode(const BranchVFGNode &)
place holder
const ICFGNode * getSuccessor(u32_t i) const
Definition: VFGNode.h:609
const SVFFunction * getCaller() const
Return callsite.
Definition: ICFGNode.h:470
CmpVFGNode(const CmpVFGNode &)
place holder
Map< u32_t, const PAGNode * > OPVers
Definition: VFGNode.h:340
static bool classof(const VFGNode *node)
Definition: VFGNode.h:359
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:367
void setOpVer(u32_t pos, const PAGNode *node)
Definition: VFGNode.h:380
const PAGNode * getOpVer(u32_t pos) const
Operands at a BinaryNode.
Definition: VFGNode.h:374
const SVFValue * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
Definition: VFG.cpp:1081
OPVers::const_iterator opVerBegin() const
Definition: VFGNode.h:392
const PAGNode * res
Definition: VFGNode.h:342
const std::string toString() const override
Definition: VFG.cpp:118
const PAGNode * getRes() const
Definition: VFGNode.h:384
OPVers opVers
Definition: VFGNode.h:343
static bool classof(const CmpVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:355
u32_t getOpVerNum() const
Definition: VFGNode.h:388
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:111
CmpVFGNode()
place holder
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:363
void operator=(const CmpVFGNode &)
place holder
OPVers::const_iterator opVerEnd() const
Definition: VFGNode.h:396
CmpVFGNode(NodeID id, const PAGNode *r)
Constructor.
Definition: VFGNode.h:352
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:95
CopyVFGNode()
place holder
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:317
void operator=(const CopyVFGNode &)
place holder
CopyVFGNode(const CopyVFGNode &)
place holder
const std::string toString() const override
Definition: VFG.cpp:102
static bool classof(const CopyVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:305
static bool classof(const VFGNode *node)
Definition: VFGNode.h:313
CopyVFGNode(NodeID id, const CopyStmt *copy)
Constructor.
Definition: VFGNode.h:299
static bool classof(const StmtVFGNode *node)
Definition: VFGNode.h:309
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:321
FormalParmVFGNode(NodeID id, const PAGNode *n, const SVFFunction *f)
Constructor.
Definition: VFGNode.h:953
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:1000
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:298
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:1004
const PAGNode * getParam() const
Return parameter.
Definition: VFGNode.h:959
CallPESet::const_iterator callPEBegin() const
Definition: VFGNode.h:976
const std::string toString() const override
Definition: VFG.cpp:305
static bool classof(const ArgumentVFGNode *node)
Definition: VFGNode.h:996
const SVFFunction * fun
Definition: VFGNode.h:948
static bool classof(const VFGNode *node)
Definition: VFGNode.h:992
CallPESet::const_iterator callPEEnd() const
Definition: VFGNode.h:980
void addCallPE(const CallPE *call)
Return call edge.
Definition: VFGNode.h:970
const SVFFunction * getFun() const override
Return function.
Definition: VFGNode.h:965
static bool classof(const FormalParmVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:988
FormalRetVFGNode()
place holder
void addRetPE(const RetPE *retPE)
RetPE.
Definition: VFGNode.h:1105
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:1132
FormalRetVFGNode(const FormalRetVFGNode &)
place holder
void operator=(const FormalRetVFGNode &)
place holder
const PAGNode * getRet() const
Return value at callee.
Definition: VFGNode.h:1095
const SVFFunction * getFun() const override
Function.
Definition: VFGNode.h:1100
static bool classof(const ArgumentVFGNode *node)
Definition: VFGNode.h:1128
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:1136
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:333
const std::string toString() const override
Definition: VFG.cpp:340
static bool classof(const VFGNode *node)
Definition: VFGNode.h:1124
RetPESet::const_iterator retPEBegin() const
RetPE iterators.
Definition: VFGNode.h:1110
RetPESet::const_iterator retPEEnd() const
Definition: VFGNode.h:1114
const SVFFunction * fun
Definition: VFGNode.h:1083
static bool classof(const FormalRetVFGNode)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:1120
NodeType * getSrcNode() const
Definition: GenericGraph.h:97
NodeID getDstID() const
Definition: GenericGraph.h:85
NodeID getSrcID() const
get methods of the components
Definition: GenericGraph.h:81
NodeType * getDstNode() const
Definition: GenericGraph.h:101
GepVFGNode()
place holder
GepVFGNode(const GepVFGNode &)
place holder
GepVFGNode(NodeID id, const GepStmt *edge)
Constructor.
Definition: VFGNode.h:632
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:650
static bool classof(const GepVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:638
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:654
static bool classof(const VFGNode *node)
Definition: VFGNode.h:646
static bool classof(const StmtVFGNode *node)
Definition: VFGNode.h:642
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:197
void operator=(const GepVFGNode &)
place holder
const std::string toString() const override
Definition: VFG.cpp:204
virtual const SVFFunction * getFun() const
Return the function of this ICFGNode.
Definition: ICFGNode.h:76
const CallICFGNode * getCallSite() const
Definition: VFGNode.h:1175
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:1199
const SVFFunction * fun
Definition: VFGNode.h:1208
bool isFormalParmPHI() const
Definition: VFGNode.h:1159
const CallICFGNode * callInst
Definition: VFGNode.h:1209
static bool classof(const VFGNode *node)
Definition: VFGNode.h:1191
const SVFFunction * getFun() const override
Get the function of this SVFGNode.
Definition: VFGNode.h:1169
InterPHIVFGNode(NodeID id, const FormalParmVFGNode *fp)
Constructor interPHI for formal parameter.
Definition: VFGNode.h:1155
static bool classof(const PHIVFGNode *node)
Definition: VFGNode.h:1187
bool isActualRetPHI() const
Definition: VFGNode.h:1164
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:1195
static bool classof(const InterPHIVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:1183
InterPHIVFGNode(NodeID id, const ActualRetVFGNode *ar)
Constructor interPHI for actual return.
Definition: VFGNode.h:1157
const std::string toString() const override
Definition: VFG.cpp:351
const std::string toString() const override
Definition: VFG.cpp:238
static bool classof(const IntraPHIVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:775
static bool classof(const VFGNode *node)
Definition: VFGNode.h:783
const ICFGNode * getOpIncomingBB(u32_t pos) const
Definition: VFGNode.h:761
IntraPHIVFGNode(NodeID id, const PAGNode *r)
Constructor.
Definition: VFGNode.h:757
Map< u32_t, const ICFGNode * > OPIncomingBBs
Definition: VFGNode.h:751
OPIncomingBBs opIncomingBBs
Definition: VFGNode.h:754
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:787
void setOpVerAndBB(u32_t pos, const PAGNode *node, const ICFGNode *bb)
Definition: VFGNode.h:767
static bool classof(const PHIVFGNode *node)
Definition: VFGNode.h:779
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:791
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:231
static bool classof(const LoadVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:215
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:227
static bool classof(const StmtVFGNode *node)
Definition: VFGNode.h:219
LoadVFGNode(NodeID id, const LoadStmt *edge)
Constructor.
Definition: VFGNode.h:209
void operator=(const LoadVFGNode &)
place holder
static bool classof(const VFGNode *node)
Definition: VFGNode.h:223
const std::string toString() const override
Definition: VFG.cpp:64
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:57
LoadVFGNode()
place holder
LoadVFGNode(const LoadVFGNode &)
place holder
const PAGNode * getPAGNode() const
Return corresponding PAGNode.
Definition: VFGNode.h:1233
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:1251
bool isPTANode() const
Whether this node is of pointer type (used for pointer analysis).
Definition: VFGNode.h:1228
NullPtrVFGNode(NodeID id, const PAGNode *n)
Constructor.
Definition: VFGNode.h:1223
const std::string toString() const override
Definition: VFG.cpp:369
static bool classof(const VFGNode *node)
Definition: VFGNode.h:1243
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:1247
static bool classof(const NullPtrVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:1239
const PAGNode * node
Definition: VFGNode.h:1220
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:362
OPVers opVers
Definition: VFGNode.h:675
bool isPTANode() const
Whether this phi node is of pointer type (used for pointer analysis).
Definition: VFGNode.h:682
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:727
OPVers::const_iterator opVerBegin() const
Definition: VFGNode.h:707
void setOpVer(u32_t pos, const PAGNode *node)
Definition: VFGNode.h:695
const PAGNode * getOpVer(u32_t pos) const
Operands at a llvm PHINode.
Definition: VFGNode.h:689
Map< u32_t, const PAGNode * > OPVers
Definition: VFGNode.h:672
static bool classof(const VFGNode *node)
Definition: VFGNode.h:723
const PAGNode * res
Definition: VFGNode.h:674
static bool classof(const PHIVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:719
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:213
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:731
const std::string toString() const override
Definition: VFG.cpp:220
u32_t getOpVerNum() const
Definition: VFGNode.h:703
const PAGNode * getRes() const
Definition: VFGNode.h:699
OPVers::const_iterator opVerEnd() const
Definition: VFGNode.h:711
PHIVFGNode(NodeID id, const PAGNode *r, VFGNodeK k=TPhi)
Constructor.
Definition: VFG.cpp:428
const SVFValue * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
Definition: VFG.cpp:1091
static bool isArgumentVFGNodeKinds(GNodeK n)
Definition: GenericGraph.h:347
NodeID id
Node ID.
Definition: GenericGraph.h:290
static bool isVFGNodeKinds(GNodeK n)
Definition: GenericGraph.h:339
static bool isPHIVFGNodeKinds(GNodeK n)
Definition: GenericGraph.h:363
GNodeK getNodeKind() const
Get node kind.
Definition: GenericGraph.h:266
static bool isStmtVFGNodeKinds(GNodeK n)
Definition: GenericGraph.h:355
bool isPTAEdge() const
Whether src and dst nodes are both of pointer type.
virtual bool isPointer() const
Whether it is a pointer.
Definition: SVFVariables.h:106
StmtVFGNode(NodeID id, const PAGEdge *e, VFGNodeK k)
Constructor.
Definition: VFGNode.h:135
NodeID getPAGDstNodeID() const
Definition: VFGNode.h:157
static bool classof(const VFGNode *node)
Definition: VFGNode.h:179
const PAGEdge * getPAGEdge() const
Definition: VFGNode.h:147
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:183
NodeID getPAGSrcNodeID() const
Definition: VFGNode.h:152
PAGNode * getPAGSrcNode() const
Definition: VFGNode.h:162
bool isPTANode() const
Whether this node is used for pointer analysis. Both src and dst PAGNodes are of ptr type.
Definition: VFGNode.h:140
PAGNode * getPAGDstNode() const
Definition: VFGNode.h:167
const SVFValue * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
Definition: VFG.cpp:1076
const std::string toString() const override
Definition: VFG.cpp:48
const PAGEdge * pagEdge
Definition: VFGNode.h:131
static bool classof(const StmtVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:175
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:187
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:272
StoreVFGNode(const StoreVFGNode &)
place holder
static bool classof(const VFGNode *node)
Definition: VFGNode.h:268
static bool classof(const StoreVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:260
void operator=(const StoreVFGNode &)
place holder
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:73
StoreVFGNode()
place holder
const std::string toString() const override
Definition: VFG.cpp:86
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:276
static bool classof(const StmtVFGNode *node)
Definition: VFGNode.h:264
StoreVFGNode(NodeID id, const StoreStmt *edge)
Constructor.
Definition: VFGNode.h:254
static bool classof(const UnaryOPVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: VFGNode.h:504
static bool classof(const VFGNode *node)
Definition: VFGNode.h:508
const PAGNode * getOpVer(u32_t pos) const
Operands at a UnaryNode.
Definition: VFGNode.h:523
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:512
void operator=(const UnaryOPVFGNode &)
place holder
void setOpVer(u32_t pos, const PAGNode *node)
Definition: VFGNode.h:529
const PAGNode * res
Definition: VFGNode.h:491
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition: VFG.cpp:159
UnaryOPVFGNode(const UnaryOPVFGNode &)
place holder
OPVers::const_iterator opVerBegin() const
Definition: VFGNode.h:546
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:516
UnaryOPVFGNode(NodeID id, const PAGNode *r)
Constructor.
Definition: VFGNode.h:501
virtual const std::string toString() const override
Definition: VFG.cpp:166
const PAGNode * getOpVar() const
Definition: VFGNode.h:537
UnaryOPVFGNode()
place holder
const PAGNode * getRes() const
Definition: VFGNode.h:533
u32_t getOpVerNum() const
Definition: VFGNode.h:542
OPVers::const_iterator opVerEnd() const
Definition: VFGNode.h:550
Map< u32_t, const PAGNode * > OPVers
Definition: VFGNode.h:489
static bool classof(const SVFBaseNode *node)
Definition: VFGNode.h:115
virtual const std::string toString() const
Definition: VFG.cpp:40
virtual const ICFGNode * getICFGNode() const
Return corresponding ICFG node.
Definition: VFGNode.h:67
Set< const RetPE * > RetPESet
Definition: VFGNode.h:57
VFGEdge::VFGEdgeSetTy::const_iterator const_iterator
Definition: VFGNode.h:55
static bool classof(const GenericVFGNodeTy *node)
Definition: VFGNode.h:109
Set< const CallPE * > CallPESet
Definition: VFGNode.h:56
const ICFGNode * icfgNode
Definition: VFGNode.h:121
VFGNode(NodeID i, VFGNodeK k)
Constructor.
Definition: VFGNode.h:61
GNodeK VFGNodeK
Definition: VFGNode.h:52
VFGEdge::VFGEdgeSetTy::iterator iterator
Definition: VFGNode.h:54
virtual void setICFGNode(const ICFGNode *node)
Set corresponding ICFG node.
Definition: VFGNode.h:73
static bool classof(const VFGNode *)
Definition: VFGNode.h:104
friend OutStream & operator<<(OutStream &o, const VFGNode &node)
Overloading operator << for dumping ICFG node ID.
Definition: VFGNode.h:95
virtual const SVFFunction * getFun() const
Get the function of this SVFGNode.
Definition: VFGNode.h:79
virtual const NodeBS getDefSVFVars() const =0
Return the left hand side SVF Vars.
virtual const SVFValue * getValue() const
Return the corresponding LLVM value, if possible, nullptr otherwise.
Definition: VFGNode.h:85
for isBitcode
Definition: BasicTypes.h:68
GenericNode< VFGNode, VFGEdge > GenericVFGNodeTy
Definition: VFGNode.h:45
u32_t NodeID
Definition: GeneralType.h:55
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
Definition: GeneralType.h:101
std::ostream OutStream
Definition: GeneralType.h:45
unsigned u32_t
Definition: GeneralType.h:46
std::unordered_set< Key, Hash, KeyEqual, Allocator > Set
Definition: GeneralType.h:96