Static Value-Flow Analysis
Loading...
Searching...
No Matches
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
38namespace SVF
39{
40
47{
48
49public:
53
54 typedef VFGEdge::VFGEdgeSetTy::iterator iterator;
55 typedef VFGEdge::VFGEdgeSetTy::const_iterator const_iterator;
58
59public:
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 FunObjVar* getFun() const
80 {
81 return icfgNode->getFun();
82 }
83
85 virtual const SVFVar* 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 SVFValue* node)
116 {
117 return isVFGNodeKinds(node->getNodeKind());
118 }
119
120protected:
122};
123
127class StmtVFGNode : public VFGNode
128{
129
130private:
132
133public:
136 {
137 }
138
140 inline bool isPTANode() const
141 {
142 return svfStmt->isPTAEdge();
143 }
144
147 inline const SVFStmt* getSVFStmt() const
148 {
149 return svfStmt;
150 }
151
152 inline NodeID getSrcNodeID() const
153 {
154 return svfStmt->getSrcID();
155 }
156
157 inline NodeID getDstNodeID() const
158 {
159 return svfStmt->getDstID();
160 }
161
162 inline SVFVar* getSrcNode() const
163 {
164 return svfStmt->getSrcNode();
165 }
166
167 inline SVFVar* getDstNode() const
168 {
169 return svfStmt->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 SVFValue*node)
188 {
189 return isStmtVFGNodeKinds(node->getNodeKind());
190 }
192
193 const SVFVar* getValue() const override;
194 const std::string toString() const override;
195};
196
201{
202private:
205 void operator=(const LoadVFGNode &);
206
207public:
210 {
211
212 }
213 inline const ValVar* getSrcNode() const
214 {
215 return SVFUtil::cast<ValVar>(StmtVFGNode::getSrcNode());
216 }
217 inline const ValVar* getDstNode() const
218 {
219 return SVFUtil::cast<ValVar>(StmtVFGNode::getDstNode());
220 }
221 inline const ValVar* getRHSVar() const
222 {
223 return getSrcNode();
224 }
225 inline const ValVar* getLHSVar() const
226 {
227 return getDstNode();
228 }
230
231 static inline bool classof(const LoadVFGNode *)
232 {
233 return true;
234 }
235 static inline bool classof(const StmtVFGNode *node)
236 {
237 return node->getNodeKind() == Load;
238 }
239 static inline bool classof(const VFGNode *node)
240 {
241 return node->getNodeKind() == Load;
242 }
243 static inline bool classof(const GenericVFGNodeTy *node)
244 {
245 return node->getNodeKind() == Load;
246 }
247 static inline bool classof(const SVFValue*node)
248 {
249 return node->getNodeKind() == Load;
250 }
252
253 const NodeBS getDefSVFVars() const override;
254
255 const std::string toString() const override;
256};
257
262{
263private:
266 void operator=(const StoreVFGNode &);
267
268public:
271 {
272
273 }
274 inline const ValVar* getSrcNode() const
275 {
276 return SVFUtil::cast<ValVar>(StmtVFGNode::getSrcNode());
277 }
278 inline const ValVar* getDstNode() const
279 {
280 return SVFUtil::cast<ValVar>(StmtVFGNode::getDstNode());
281 }
282 inline const ValVar* getRHSVar() const
283 {
284 return getSrcNode();
285 }
286 inline const ValVar* getLHSVar() const
287 {
288 return getDstNode();
289 }
291
292 static inline bool classof(const StoreVFGNode *)
293 {
294 return true;
295 }
296 static inline bool classof(const StmtVFGNode *node)
297 {
298 return node->getNodeKind() == Store;
299 }
300 static inline bool classof(const VFGNode *node)
301 {
302 return node->getNodeKind() == Store;
303 }
304 static inline bool classof(const GenericVFGNodeTy *node)
305 {
306 return node->getNodeKind() == Store;
307 }
308 static inline bool classof(const SVFValue*node)
309 {
310 return node->getNodeKind() == Store;
311 }
313
314 const NodeBS getDefSVFVars() const override;
315
316 const std::string toString() const override;
317};
318
323{
324private:
327 void operator=(const CopyVFGNode &);
328
329public:
332 {
333
334 }
335 inline const ValVar* getSrcNode() const
336 {
337 return SVFUtil::cast<ValVar>(StmtVFGNode::getSrcNode());
338 }
339 inline const ValVar* getDstNode() const
340 {
341 return SVFUtil::cast<ValVar>(StmtVFGNode::getDstNode());
342 }
343 inline const ValVar* getRHSVar() const
344 {
345 return getSrcNode();
346 }
347 inline const ValVar* getLHSVar() const
348 {
349 return getDstNode();
350 }
352
353 static inline bool classof(const CopyVFGNode *)
354 {
355 return true;
356 }
357 static inline bool classof(const StmtVFGNode *node)
358 {
359 return node->getNodeKind() == Copy;
360 }
361 static inline bool classof(const VFGNode *node)
362 {
363 return node->getNodeKind() == Copy;
364 }
365 static inline bool classof(const GenericVFGNodeTy *node)
366 {
367 return node->getNodeKind() == Copy;
368 }
369 static inline bool classof(const SVFValue*node)
370 {
371 return node->getNodeKind() == Copy;
372 }
374
375 const NodeBS getDefSVFVars() const override;
376
377 const std::string toString() const override;
378};
379
380
385class CmpVFGNode: public VFGNode
386{
387public:
389protected:
390 const ValVar* res;
392
393private:
396 void operator=(const CmpVFGNode &);
397
398public:
402
403 static inline bool classof(const CmpVFGNode *)
404 {
405 return true;
406 }
407 static inline bool classof(const VFGNode *node)
408 {
409 return node->getNodeKind() == Cmp;
410 }
411 static inline bool classof(const GenericVFGNodeTy *node)
412 {
413 return node->getNodeKind() == Cmp;
414 }
415 static inline bool classof(const SVFValue*node)
416 {
417 return node->getNodeKind() == Cmp;
418 }
420
422 inline const ValVar* getOpVer(u32_t pos) const
423 {
424 OPVers::const_iterator it = opVers.find(pos);
425 assert(it!=opVers.end() && "version is nullptr, did not rename?");
426 return it->second;
427 }
428 inline void setOpVer(u32_t pos, const ValVar* node)
429 {
430 opVers[pos] = node;
431 }
432 inline const ValVar* getRes() const
433 {
434 return res;
435 }
436 inline u32_t getOpVerNum() const
437 {
438 return opVers.size();
439 }
440 inline OPVers::const_iterator opVerBegin() const
441 {
442 return opVers.begin();
443 }
444 inline OPVers::const_iterator opVerEnd() const
445 {
446 return opVers.end();
447 }
449
450 const NodeBS getDefSVFVars() const override;
451
452 const SVFVar* getValue() const override;
453
454
455 const std::string toString() const override;
456};
457
458
463{
464public:
466protected:
467 const ValVar* res;
469
470private:
474
475public:
479
480 static inline bool classof(const BinaryOPVFGNode *)
481 {
482 return true;
483 }
484 static inline bool classof(const VFGNode *node)
485 {
486 return node->getNodeKind() == BinaryOp;
487 }
488 static inline bool classof(const GenericVFGNodeTy *node)
489 {
490 return node->getNodeKind() == BinaryOp;
491 }
492 static inline bool classof(const SVFValue*node)
493 {
494 return node->getNodeKind() == BinaryOp;
495 }
497
499 inline const ValVar* getOpVer(u32_t pos) const
500 {
501 OPVers::const_iterator it = opVers.find(pos);
502 assert(it!=opVers.end() && "version is nullptr, did not rename?");
503 return it->second;
504 }
505 inline void setOpVer(u32_t pos, const ValVar* node)
506 {
507 opVers[pos] = node;
508 }
509 inline const ValVar* getRes() const
510 {
511 return res;
512 }
513 inline u32_t getOpVerNum() const
514 {
515 return opVers.size();
516 }
517 inline OPVers::const_iterator opVerBegin() const
518 {
519 return opVers.begin();
520 }
521 inline OPVers::const_iterator opVerEnd() const
522 {
523 return opVers.end();
524 }
526
527 const NodeBS getDefSVFVars() const override;
528
529 const SVFVar* getValue() const override;
530 const std::string toString() const override;
531};
532
537{
538public:
540protected:
541 const ValVar* res;
543
544private:
547 void operator=(const UnaryOPVFGNode &);
548
549public:
553
554 static inline bool classof(const UnaryOPVFGNode *)
555 {
556 return true;
557 }
558 static inline bool classof(const VFGNode *node)
559 {
560 return node->getNodeKind() == UnaryOp;
561 }
562 static inline bool classof(const GenericVFGNodeTy *node)
563 {
564 return node->getNodeKind() == UnaryOp;
565 }
566 static inline bool classof(const SVFValue*node)
567 {
568 return node->getNodeKind() == UnaryOp;
569 }
571
573 inline const ValVar* getOpVer(u32_t pos) const
574 {
575 OPVers::const_iterator it = opVers.find(pos);
576 assert(it!=opVers.end() && "version is nullptr, did not rename?");
577 return it->second;
578 }
579 inline void setOpVer(u32_t pos, const ValVar* node)
580 {
581 opVers[pos] = node;
582 }
583 inline const ValVar* getRes() const
584 {
585 return res;
586 }
587 inline const ValVar* getOpVar() const
588 {
589 assert(getOpVerNum()==1 && "UnaryNode can only have one operand!");
590 return getOpVer(0);
591 }
592 inline u32_t getOpVerNum() const
593 {
594 return opVers.size();
595 }
596 inline OPVers::const_iterator opVerBegin() const
597 {
598 return opVers.begin();
599 }
600 inline OPVers::const_iterator opVerEnd() const
601 {
602 return opVers.end();
603 }
605
606 const NodeBS getDefSVFVars() const override;
607
608 virtual const std::string toString() const override;
609};
610
611/*
612* Branch VFGNode including if/else and switch statements
613*/
615{
616private:
619 void operator=(const BranchVFGNode &);
621public:
625
626 static inline bool classof(const BranchVFGNode *)
627 {
628 return true;
629 }
630 static inline bool classof(const VFGNode *node)
631 {
632 return node->getNodeKind() == Branch;
633 }
634 static inline bool classof(const GenericVFGNodeTy *node)
635 {
636 return node->getNodeKind() == Branch;
637 }
638 static inline bool classof(const SVFValue*node)
639 {
640 return node->getNodeKind() == Branch;
641 }
643
646 {
647 return brstmt;
648 }
652 {
653 return brstmt->getNumSuccessors();
654 }
656 {
657 return brstmt->getSuccessors();
658 }
660 {
661 return brstmt->getSuccessor(i);
662 }
664
665 const NodeBS getDefSVFVars() const override;
666
667 virtual const std::string toString() const override;
668};
669
674{
675private:
678 void operator=(const GepVFGNode &);
679
680public:
683 {
684
685 }
686 inline const ValVar* getSrcNode() const
687 {
688 return SVFUtil::cast<ValVar>(StmtVFGNode::getSrcNode());
689 }
690 inline const ValVar* getDstNode() const
691 {
692 return SVFUtil::cast<ValVar>(StmtVFGNode::getDstNode());
693 }
694 inline const ValVar* getRHSVar() const
695 {
696 return getSrcNode();
697 }
698 inline const ValVar* getLHSVar() const
699 {
700 return getDstNode();
701 }
703
704 static inline bool classof(const GepVFGNode *)
705 {
706 return true;
707 }
708 static inline bool classof(const StmtVFGNode *node)
709 {
710 return node->getNodeKind() == Gep;
711 }
712 static inline bool classof(const VFGNode *node)
713 {
714 return node->getNodeKind() == Gep;
715 }
716 static inline bool classof(const GenericVFGNodeTy *node)
717 {
718 return node->getNodeKind() == Gep;
719 }
720 static inline bool classof(const SVFValue*node)
721 {
722 return node->getNodeKind() == Gep;
723 }
725
726 const NodeBS getDefSVFVars() const override;
727
728 const std::string toString() const override;
729};
730
731/*
732 * ICFG Node stands for a top level pointer ssa phi node or a formal parameter or a return parameter
733 */
734class PHIVFGNode : public VFGNode
735{
736
737public:
739protected:
740 const ValVar* res;
742
743public:
745 PHIVFGNode(NodeID id, const ValVar* r,VFGNodeK k = TPhi);
746
748 inline bool isPTANode() const
749 {
750 return res->isPointer();
751 }
752
754
755 inline const ValVar* getOpVer(u32_t pos) const
756 {
757 OPVers::const_iterator it = opVers.find(pos);
758 assert(it!=opVers.end() && "version is nullptr, did not rename?");
759 return it->second;
760 }
761 inline void setOpVer(u32_t pos, const ValVar* node)
762 {
763 opVers[pos] = node;
764 }
765 inline const ValVar* getRes() const
766 {
767 return res;
768 }
769 inline u32_t getOpVerNum() const
770 {
771 return opVers.size();
772 }
773 inline OPVers::const_iterator opVerBegin() const
774 {
775 return opVers.begin();
776 }
777 inline OPVers::const_iterator opVerEnd() const
778 {
779 return opVers.end();
780 }
782
784
785 static inline bool classof(const PHIVFGNode *)
786 {
787 return true;
788 }
789 static inline bool classof(const VFGNode *node)
790 {
791 return isPHIVFGNodeKinds(node->getNodeKind());
792 }
793 static inline bool classof(const GenericVFGNodeTy *node)
794 {
795 return isPHIVFGNodeKinds(node->getNodeKind());
796 }
797 static inline bool classof(const SVFValue*node)
798 {
799 return isPHIVFGNodeKinds(node->getNodeKind());
800 }
802
803 const NodeBS getDefSVFVars() const override;
804
805 const SVFVar* getValue() const override;
806 const std::string toString() const override;
807};
808
809
810/*
811 * Intra LLVM PHI Node
812 */
814{
815
816public:
818
819private:
821public:
824 {
825 }
826
827 inline const ICFGNode* getOpIncomingBB(u32_t pos) const
828 {
829 OPIncomingBBs::const_iterator it = opIncomingBBs.find(pos);
830 assert(it!=opIncomingBBs.end() && "version is nullptr, did not rename?");
831 return it->second;
832 }
833 inline void setOpVerAndBB(u32_t pos, const ValVar* node, const ICFGNode* bb)
834 {
835 opVers[pos] = node;
836 opIncomingBBs[pos] = bb;
837 }
838
840
841 static inline bool classof(const IntraPHIVFGNode*)
842 {
843 return true;
844 }
845 static inline bool classof(const PHIVFGNode *node)
846 {
847 return node->getNodeKind() == TIntraPhi;
848 }
849 static inline bool classof(const VFGNode *node)
850 {
851 return node->getNodeKind() == TIntraPhi;
852 }
853 static inline bool classof(const GenericVFGNodeTy *node)
854 {
855 return node->getNodeKind() == TIntraPhi;
856 }
857 static inline bool classof(const SVFValue*node)
858 {
859 return node->getNodeKind() == TIntraPhi;
860 }
862
863 const std::string toString() const override;
864};
865
866
868{
869private:
872 void operator=(const AddrVFGNode &);
873
874public:
877 {
878
879 }
880 inline const ObjVar* getSrcNode() const
881 {
882 return SVFUtil::cast<ObjVar>(StmtVFGNode::getSrcNode());
883 }
884 inline const ValVar* getDstNode() const
885 {
886 return SVFUtil::cast<ValVar>(StmtVFGNode::getDstNode());
887 }
888 inline const ValVar* getLHSVar() const
889 {
890 return getDstNode();
891 }
892 inline const ObjVar* getRHSVar() const
893 {
894 return getSrcNode();
895 }
897
898 static inline bool classof(const AddrVFGNode *)
899 {
900 return true;
901 }
902 static inline bool classof(const StmtVFGNode *node)
903 {
904 return node->getNodeKind() == Addr;
905 }
906 static inline bool classof(const VFGNode *node)
907 {
908 return node->getNodeKind() == Addr;
909 }
910 static inline bool classof(const GenericVFGNodeTy *node)
911 {
912 return node->getNodeKind() == Addr;
913 }
914 static inline bool classof(const SVFValue*node)
915 {
916 return node->getNodeKind() == Addr;
917 }
919
920 const NodeBS getDefSVFVars() const override;
921
922 const std::string toString() const override;
923};
924
925
927{
928
929protected:
930 const ValVar* param;
931
932public:
935 {
936 }
937
939 inline bool isPTANode() const
940 {
941 return param->isPointer();
942 }
943
945
946 static inline bool classof(const ArgumentVFGNode *)
947 {
948 return true;
949 }
950 static inline bool classof(const VFGNode *node)
951 {
952 return isArgumentVFGNodeKinds(node->getNodeKind());
953 }
954 static inline bool classof(const GenericVFGNodeTy *node)
955 {
956 return isArgumentVFGNodeKinds(node->getNodeKind());
957 }
958 static inline bool classof(const SVFValue*node)
959 {
960 return isArgumentVFGNodeKinds(node->getNodeKind());
961 }
963
964 const SVFVar* getValue() const override;
965 const std::string toString() const override;
966};
967
968/*
969 * ICFG Node stands for actual parameter node (top level pointers)
970 */
972{
973private:
975public:
979 {
980 }
981
983 inline const CallICFGNode* getCallSite() const
984 {
985 return cs;
986 }
987
989 inline const ValVar* getParam() const
990 {
991 return param;
992 }
993
995
996 static inline bool classof(const ActualParmVFGNode *)
997 {
998 return true;
999 }
1000 static inline bool classof(const ArgumentVFGNode *node)
1001 {
1002 return node->getNodeKind() == AParm;
1003 }
1004 static inline bool classof(const VFGNode *node)
1005 {
1006 return node->getNodeKind() == AParm;
1007 }
1008 static inline bool classof(const GenericVFGNodeTy *node)
1009 {
1010 return node->getNodeKind() == AParm;
1011 }
1012 static inline bool classof(const SVFValue*node)
1013 {
1014 return node->getNodeKind() == AParm;
1015 }
1017
1018 const NodeBS getDefSVFVars() const override;
1019
1020 const std::string toString() const override;
1021};
1022
1023
1024/*
1025 * ICFG Node stands for formal parameter node (top level pointers)
1026 */
1028{
1029private:
1032
1033public:
1037 {
1038 }
1039
1041 inline const ValVar* getParam() const
1042 {
1043 return param;
1044 }
1045
1047 inline const FunObjVar* getFun() const override
1048 {
1049 return fun;
1050 }
1052 inline void addCallPE(const CallPE* call)
1053 {
1054 callPEs.insert(call);
1055 }
1058 inline CallPESet::const_iterator callPEBegin() const
1059 {
1060 return callPEs.begin();
1061 }
1062 inline CallPESet::const_iterator callPEEnd() const
1063 {
1064 return callPEs.end();
1065 }
1067
1069
1070 static inline bool classof(const FormalParmVFGNode *)
1071 {
1072 return true;
1073 }
1074 static inline bool classof(const VFGNode *node)
1075 {
1076 return node->getNodeKind() == FParm;
1077 }
1078 static inline bool classof(const ArgumentVFGNode *node)
1079 {
1080 return node->getNodeKind() == FParm;
1081 }
1082 static inline bool classof(const GenericVFGNodeTy *node)
1083 {
1084 return node->getNodeKind() == FParm;
1085 }
1086 static inline bool classof(const SVFValue*node)
1087 {
1088 return node->getNodeKind() == FParm;
1089 }
1091
1092 const NodeBS getDefSVFVars() const override;
1093
1094 const std::string toString() const override;
1095};
1096
1101{
1102private:
1104
1108
1109public:
1113 {
1114 }
1116 inline const CallICFGNode* getCallSite() const
1117 {
1118 return cs;
1119 }
1121 inline const FunObjVar* getCaller() const
1122 {
1123 return cs->getCaller();
1124 }
1126 inline const ValVar* getRev() const
1127 {
1128 return param;
1129 }
1131
1132 static inline bool classof(const ActualRetVFGNode *)
1133 {
1134 return true;
1135 }
1136 static inline bool classof(const ArgumentVFGNode *node)
1137 {
1138 return node->getNodeKind() == ARet;
1139 }
1140 static inline bool classof(const VFGNode *node)
1141 {
1142 return node->getNodeKind() == ARet;
1143 }
1144 static inline bool classof(const GenericVFGNodeTy *node)
1145 {
1146 return node->getNodeKind() == ARet;
1147 }
1148 static inline bool classof(const SVFValue*node)
1149 {
1150 return node->getNodeKind() == ARet;
1151 }
1153
1154 const NodeBS getDefSVFVars() const override;
1155
1156 const std::string toString() const override;
1157};
1158
1163{
1164private:
1167
1171
1172public:
1174 FormalRetVFGNode(NodeID id, const ValVar* n, const FunObjVar* f);
1175
1177 inline const ValVar* getRet() const
1178 {
1179 return param;
1180 }
1182 inline const FunObjVar* getFun() const override
1183 {
1184 return fun;
1185 }
1187 inline void addRetPE(const RetPE* retPE)
1188 {
1189 retPEs.insert(retPE);
1190 }
1192 inline RetPESet::const_iterator retPEBegin() const
1193 {
1194 return retPEs.begin();
1195 }
1196 inline RetPESet::const_iterator retPEEnd() const
1197 {
1198 return retPEs.end();
1199 }
1201
1202 static inline bool classof(const FormalRetVFGNode )
1203 {
1204 return true;
1205 }
1206 static inline bool classof(const VFGNode *node)
1207 {
1208 return node->getNodeKind() == FRet;
1209 }
1210 static inline bool classof(const ArgumentVFGNode *node)
1211 {
1212 return node->getNodeKind() == FRet;
1213 }
1214 static inline bool classof(const GenericVFGNodeTy *node)
1215 {
1216 return node->getNodeKind() == FRet;
1217 }
1218 static inline bool classof(const SVFValue*node)
1219 {
1220 return node->getNodeKind() == FRet;
1221 }
1223
1224 const NodeBS getDefSVFVars() const override;
1225
1226 const std::string toString() const override;
1227};
1228
1229/*
1230 * Inter LLVM PHI node (formal parameter)
1231 */
1233{
1234
1235public:
1239 InterPHIVFGNode(NodeID id, const ActualRetVFGNode* ar) : PHIVFGNode(id, ar->getRev(), TInterPhi), fun(ar->getCaller()),callInst(ar->getCallSite()) {}
1240
1241 inline bool isFormalParmPHI() const
1242 {
1243 return (fun!=nullptr) && (callInst == nullptr);
1244 }
1245
1246 inline bool isActualRetPHI() const
1247 {
1248 return (fun!=nullptr) && (callInst != nullptr);
1249 }
1250
1251 inline const FunObjVar* getFun() const override
1252 {
1253 assert((isFormalParmPHI() || isActualRetPHI()) && "expect a formal parameter phi");
1254 return fun;
1255 }
1256
1257 inline const CallICFGNode* getCallSite() const
1258 {
1259 assert(isActualRetPHI() && "expect a actual return phi");
1260 return callInst;
1261 }
1262
1264
1265 static inline bool classof(const InterPHIVFGNode*)
1266 {
1267 return true;
1268 }
1269 static inline bool classof(const PHIVFGNode *node)
1270 {
1271 return node->getNodeKind() == TInterPhi;
1272 }
1273 static inline bool classof(const VFGNode *node)
1274 {
1275 return node->getNodeKind() == TInterPhi;
1276 }
1277 static inline bool classof(const GenericVFGNodeTy *node)
1278 {
1279 return node->getNodeKind() == TInterPhi;
1280 }
1281 static inline bool classof(const SVFValue*node)
1282 {
1283 return node->getNodeKind() == TInterPhi;
1284 }
1286
1287 const std::string toString() const override;
1288
1289private:
1292};
1293
1294
1295
1300{
1301private:
1302 const SVFVar* node;
1303public:
1306 {
1307
1308 }
1310 inline bool isPTANode() const
1311 {
1312 return node->isPointer();
1313 }
1315 const SVFVar* getSVFVar() const
1316 {
1317 return node;
1318 }
1320
1321 static inline bool classof(const NullPtrVFGNode *)
1322 {
1323 return true;
1324 }
1325 static inline bool classof(const VFGNode *node)
1326 {
1327 return node->getNodeKind() == NPtr;
1328 }
1329 static inline bool classof(const GenericVFGNodeTy *node)
1330 {
1331 return node->getNodeKind() == NPtr;
1332 }
1333 static inline bool classof(const SVFValue*node)
1334 {
1335 return node->getNodeKind() == NPtr;
1336 }
1338
1339 const NodeBS getDefSVFVars() const override;
1340
1341 const std::string toString() const override;
1342};
1343
1344} // End namespace SVF
1345
1346#endif /* INCLUDE_UTIL_VFGNODE_H_ */
cJSON * p
Definition cJSON.cpp:2559
copy
Definition cJSON.cpp:414
cJSON * n
Definition cJSON.cpp:2558
ActualParmVFGNode(NodeID id, const ValVar *n, const CallICFGNode *c)
Constructor.
Definition VFGNode.h:977
static bool classof(const SVFValue *node)
Definition VFGNode.h:1012
static bool classof(const ActualParmVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:996
const std::string toString() const override
Definition VFG.cpp:272
const CallICFGNode * cs
Definition VFGNode.h:974
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:1008
const ValVar * getParam() const
Return parameter.
Definition VFGNode.h:989
static bool classof(const ArgumentVFGNode *node)
Definition VFGNode.h:1000
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:265
static bool classof(const VFGNode *node)
Definition VFGNode.h:1004
const CallICFGNode * getCallSite() const
Return callsite.
Definition VFGNode.h:983
static bool classof(const ArgumentVFGNode *node)
Definition VFGNode.h:1136
const CallICFGNode * getCallSite() const
Return callsite.
Definition VFGNode.h:1116
const FunObjVar * getCaller() const
Receive parameter at callsite.
Definition VFGNode.h:1121
ActualRetVFGNode(const ActualRetVFGNode &)
place holder
void operator=(const ActualRetVFGNode &)
place holder
const std::string toString() const override
Definition VFG.cpp:306
ActualRetVFGNode(NodeID id, const ValVar *n, const CallICFGNode *c)
Constructor.
Definition VFGNode.h:1111
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:1144
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:299
static bool classof(const ActualRetVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:1132
static bool classof(const SVFValue *node)
Definition VFGNode.h:1148
ActualRetVFGNode()
place holder
const ValVar * getRev() const
Receive parameter at callsite.
Definition VFGNode.h:1126
const CallICFGNode * cs
Definition VFGNode.h:1103
static bool classof(const VFGNode *node)
Definition VFGNode.h:1140
const ValVar * getLHSVar() const
Definition VFGNode.h:888
static bool classof(const VFGNode *node)
Definition VFGNode.h:906
static bool classof(const StmtVFGNode *node)
Definition VFGNode.h:902
static bool classof(const AddrVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:898
static bool classof(const SVFValue *node)
Definition VFGNode.h:914
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:239
const ValVar * getDstNode() const
Definition VFGNode.h:884
const std::string toString() const override
Definition VFG.cpp:246
AddrVFGNode(NodeID id, const AddrStmt *edge)
Constructor.
Definition VFGNode.h:876
AddrVFGNode(const AddrVFGNode &)
place holder
const ObjVar * getSrcNode() const
Definition VFGNode.h:880
void operator=(const AddrVFGNode &)
place holder
AddrVFGNode()
place holder
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:910
const ObjVar * getRHSVar() const
Definition VFGNode.h:892
const std::string toString() const override
Definition VFG.cpp:256
static bool classof(const SVFValue *node)
Definition VFGNode.h:958
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:954
const ValVar * param
Definition VFGNode.h:930
static bool classof(const ArgumentVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:946
bool isPTANode() const
Whether this argument node is of pointer type (used for pointer analysis).
Definition VFGNode.h:939
ArgumentVFGNode(NodeID id, const ValVar *p, VFGNodeK k)
Constructor.
Definition VFGNode.h:934
static bool classof(const VFGNode *node)
Definition VFGNode.h:950
const SVFVar * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
Definition VFG.cpp:1080
u32_t getOpVerNum() const
Definition VFGNode.h:513
BinaryOPVFGNode()
place holder
BinaryOPVFGNode(NodeID id, const ValVar *r)
Constructor.
Definition VFGNode.h:477
const ValVar * getOpVer(u32_t pos) const
Operands at a BinaryNode.
Definition VFGNode.h:499
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:480
static bool classof(const SVFValue *node)
Definition VFGNode.h:492
Map< u32_t, const ValVar * > OPVers
Definition VFGNode.h:465
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:131
const ValVar * getRes() const
Definition VFGNode.h:509
const SVFVar * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
Definition VFG.cpp:1070
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:488
BinaryOPVFGNode(const BinaryOPVFGNode &)
place holder
void setOpVer(u32_t pos, const ValVar *node)
Definition VFGNode.h:505
const std::string toString() const override
Definition VFG.cpp:138
const ValVar * res
Definition VFGNode.h:467
OPVers::const_iterator opVerBegin() const
Definition VFGNode.h:517
static bool classof(const VFGNode *node)
Definition VFGNode.h:484
OPVers::const_iterator opVerEnd() const
Definition VFGNode.h:521
u32_t getNumSuccessors() const
const ICFGNode * getSuccessor(u32_t i) const
std::vector< std::pair< const ICFGNode *, s32_t > > SuccAndCondPairVec
const SuccAndCondPairVec & getSuccessors() const
virtual const std::string toString() const override
Definition VFG.cpp:178
const BranchStmt::SuccAndCondPairVec & getSuccessors() const
Definition VFGNode.h:655
const BranchStmt * getBranchStmt() const
Return the branch statement.
Definition VFGNode.h:645
BranchVFGNode(NodeID id, const BranchStmt *r)
Constructor.
Definition VFGNode.h:623
void operator=(const BranchVFGNode &)
place holder
static bool classof(const SVFValue *node)
Definition VFGNode.h:638
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:634
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:173
static bool classof(const VFGNode *node)
Definition VFGNode.h:630
const ICFGNode * getSuccessor(u32_t i) const
Definition VFGNode.h:659
const BranchStmt * brstmt
Definition VFGNode.h:620
static bool classof(const BranchVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:626
u32_t getNumSuccessors() const
Definition VFGNode.h:651
BranchVFGNode()
place holder
BranchVFGNode(const BranchVFGNode &)
place holder
const FunObjVar * getCaller() const
Return callsite.
Definition ICFGNode.h:452
CmpVFGNode(const CmpVFGNode &)
place holder
static bool classof(const VFGNode *node)
Definition VFGNode.h:407
static bool classof(const SVFValue *node)
Definition VFGNode.h:415
void setOpVer(u32_t pos, const ValVar *node)
Definition VFGNode.h:428
Map< u32_t, const ValVar * > OPVers
Definition VFGNode.h:388
OPVers::const_iterator opVerBegin() const
Definition VFGNode.h:440
const ValVar * res
Definition VFGNode.h:390
const std::string toString() const override
Definition VFG.cpp:117
OPVers opVers
Definition VFGNode.h:391
const ValVar * getOpVer(u32_t pos) const
Operands at a BinaryNode.
Definition VFGNode.h:422
static bool classof(const CmpVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:403
u32_t getOpVerNum() const
Definition VFGNode.h:436
const ValVar * getRes() const
Definition VFGNode.h:432
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:110
CmpVFGNode()
place holder
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:411
void operator=(const CmpVFGNode &)
place holder
OPVers::const_iterator opVerEnd() const
Definition VFGNode.h:444
const SVFVar * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
Definition VFG.cpp:1065
CmpVFGNode(NodeID id, const ValVar *r)
Constructor.
Definition VFGNode.h:400
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:94
CopyVFGNode()
place holder
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:365
static bool classof(const SVFValue *node)
Definition VFGNode.h:369
void operator=(const CopyVFGNode &)
place holder
const ValVar * getRHSVar() const
Definition VFGNode.h:343
CopyVFGNode(const CopyVFGNode &)
place holder
const ValVar * getDstNode() const
Definition VFGNode.h:339
const ValVar * getSrcNode() const
Definition VFGNode.h:335
const std::string toString() const override
Definition VFG.cpp:101
static bool classof(const CopyVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:353
static bool classof(const VFGNode *node)
Definition VFGNode.h:361
CopyVFGNode(NodeID id, const CopyStmt *copy)
Constructor.
Definition VFGNode.h:331
static bool classof(const StmtVFGNode *node)
Definition VFGNode.h:357
const ValVar * getLHSVar() const
Definition VFGNode.h:347
const ValVar * getParam() const
Return parameter.
Definition VFGNode.h:1041
const FunObjVar * getFun() const override
Return function.
Definition VFGNode.h:1047
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:1082
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:282
FormalParmVFGNode(NodeID id, const ValVar *n, const FunObjVar *f)
Constructor.
Definition VFGNode.h:1035
static bool classof(const SVFValue *node)
Definition VFGNode.h:1086
CallPESet::const_iterator callPEBegin() const
Definition VFGNode.h:1058
const std::string toString() const override
Definition VFG.cpp:289
const FunObjVar * fun
Definition VFGNode.h:1030
static bool classof(const ArgumentVFGNode *node)
Definition VFGNode.h:1078
static bool classof(const VFGNode *node)
Definition VFGNode.h:1074
CallPESet::const_iterator callPEEnd() const
Definition VFGNode.h:1062
void addCallPE(const CallPE *call)
Return call edge.
Definition VFGNode.h:1052
static bool classof(const FormalParmVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:1070
FormalRetVFGNode()
place holder
static bool classof(const SVFValue *node)
Definition VFGNode.h:1218
void addRetPE(const RetPE *retPE)
RetPE.
Definition VFGNode.h:1187
const FunObjVar * fun
Definition VFGNode.h:1165
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:1214
const FunObjVar * getFun() const override
Function.
Definition VFGNode.h:1182
FormalRetVFGNode(const FormalRetVFGNode &)
place holder
void operator=(const FormalRetVFGNode &)
place holder
static bool classof(const ArgumentVFGNode *node)
Definition VFGNode.h:1210
const ValVar * getRet() const
Return value at callee.
Definition VFGNode.h:1177
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:317
const std::string toString() const override
Definition VFG.cpp:324
static bool classof(const VFGNode *node)
Definition VFGNode.h:1206
RetPESet::const_iterator retPEBegin() const
RetPE iterators.
Definition VFGNode.h:1192
RetPESet::const_iterator retPEEnd() const
Definition VFGNode.h:1196
static bool classof(const FormalRetVFGNode)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:1202
NodeType * getSrcNode() const
NodeType * getDstNode() const
NodeID getDstID() const
NodeID getSrcID() const
get methods of the components
GepVFGNode()
place holder
GepVFGNode(const GepVFGNode &)
place holder
GepVFGNode(NodeID id, const GepStmt *edge)
Constructor.
Definition VFGNode.h:682
static bool classof(const SVFValue *node)
Definition VFGNode.h:720
const ValVar * getRHSVar() const
Definition VFGNode.h:694
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:716
static bool classof(const GepVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:704
const ValVar * getDstNode() const
Definition VFGNode.h:690
static bool classof(const VFGNode *node)
Definition VFGNode.h:712
static bool classof(const StmtVFGNode *node)
Definition VFGNode.h:708
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:187
void operator=(const GepVFGNode &)
place holder
const ValVar * getSrcNode() const
Definition VFGNode.h:686
const std::string toString() const override
Definition VFG.cpp:194
const ValVar * getLHSVar() const
Definition VFGNode.h:698
virtual const FunObjVar * getFun() const
Return the function of this ICFGNode.
Definition ICFGNode.h:74
bool isFormalParmPHI() const
Definition VFGNode.h:1241
const CallICFGNode * callInst
Definition VFGNode.h:1291
static bool classof(const VFGNode *node)
Definition VFGNode.h:1273
static bool classof(const SVFValue *node)
Definition VFGNode.h:1281
InterPHIVFGNode(NodeID id, const FormalParmVFGNode *fp)
Constructor interPHI for formal parameter.
Definition VFGNode.h:1237
static bool classof(const PHIVFGNode *node)
Definition VFGNode.h:1269
const FunObjVar * getFun() const override
Get the function of this SVFGNode.
Definition VFGNode.h:1251
bool isActualRetPHI() const
Definition VFGNode.h:1246
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:1277
const FunObjVar * fun
Definition VFGNode.h:1290
static bool classof(const InterPHIVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:1265
InterPHIVFGNode(NodeID id, const ActualRetVFGNode *ar)
Constructor interPHI for actual return.
Definition VFGNode.h:1239
const CallICFGNode * getCallSite() const
Definition VFGNode.h:1257
const std::string toString() const override
Definition VFG.cpp:335
const std::string toString() const override
Definition VFG.cpp:225
const ICFGNode * getOpIncomingBB(u32_t pos) const
Definition VFGNode.h:827
static bool classof(const IntraPHIVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:841
static bool classof(const VFGNode *node)
Definition VFGNode.h:849
Map< u32_t, const ICFGNode * > OPIncomingBBs
Definition VFGNode.h:817
static bool classof(const SVFValue *node)
Definition VFGNode.h:857
OPIncomingBBs opIncomingBBs
Definition VFGNode.h:820
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:853
void setOpVerAndBB(u32_t pos, const ValVar *node, const ICFGNode *bb)
Definition VFGNode.h:833
static bool classof(const PHIVFGNode *node)
Definition VFGNode.h:845
IntraPHIVFGNode(NodeID id, const ValVar *r)
Constructor.
Definition VFGNode.h:823
const ValVar * getSrcNode() const
Definition VFGNode.h:213
const ValVar * getLHSVar() const
Definition VFGNode.h:225
static bool classof(const LoadVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:231
const ValVar * getRHSVar() const
Definition VFGNode.h:221
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:243
static bool classof(const StmtVFGNode *node)
Definition VFGNode.h:235
LoadVFGNode(NodeID id, const LoadStmt *edge)
Constructor.
Definition VFGNode.h:209
void operator=(const LoadVFGNode &)
place holder
static bool classof(const SVFValue *node)
Definition VFGNode.h:247
static bool classof(const VFGNode *node)
Definition VFGNode.h:239
const std::string toString() const override
Definition VFG.cpp:63
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:56
const ValVar * getDstNode() const
Definition VFGNode.h:217
LoadVFGNode()
place holder
LoadVFGNode(const LoadVFGNode &)
place holder
static bool classof(const SVFValue *node)
Definition VFGNode.h:1333
const SVFVar * getSVFVar() const
Return corresponding SVFVar.
Definition VFGNode.h:1315
bool isPTANode() const
Whether this node is of pointer type (used for pointer analysis).
Definition VFGNode.h:1310
const SVFVar * node
Definition VFGNode.h:1302
NullPtrVFGNode(NodeID id, const SVFVar *n)
Constructor.
Definition VFGNode.h:1305
const std::string toString() const override
Definition VFG.cpp:353
static bool classof(const VFGNode *node)
Definition VFGNode.h:1325
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:1329
static bool classof(const NullPtrVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:1321
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:346
OPVers opVers
Definition VFGNode.h:741
bool isPTANode() const
Whether this phi node is of pointer type (used for pointer analysis).
Definition VFGNode.h:748
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:793
OPVers::const_iterator opVerBegin() const
Definition VFGNode.h:773
static bool classof(const VFGNode *node)
Definition VFGNode.h:789
Map< u32_t, const ValVar * > OPVers
Definition VFGNode.h:738
static bool classof(const PHIVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:785
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:203
const std::string toString() const override
Definition VFG.cpp:210
u32_t getOpVerNum() const
Definition VFGNode.h:769
const ValVar * res
Definition VFGNode.h:740
static bool classof(const SVFValue *node)
Definition VFGNode.h:797
OPVers::const_iterator opVerEnd() const
Definition VFGNode.h:777
const ValVar * getRes() const
Definition VFGNode.h:765
const SVFVar * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
Definition VFG.cpp:1075
const ValVar * getOpVer(u32_t pos) const
Operands at a llvm PHINode.
Definition VFGNode.h:755
void setOpVer(u32_t pos, const ValVar *node)
Definition VFGNode.h:761
virtual bool isPTAEdge() const
Whether src and dst nodes are both of pointer type.
static bool isArgumentVFGNodeKinds(GNodeK n)
Definition SVFValue.h:292
GNodeK getNodeKind() const
Get node kind.
Definition SVFValue.h:169
NodeID id
Node ID.
Definition SVFValue.h:209
static bool isPHIVFGNodeKinds(GNodeK n)
Definition SVFValue.h:308
static bool isVFGNodeKinds(GNodeK n)
Definition SVFValue.h:284
static bool isStmtVFGNodeKinds(GNodeK n)
Definition SVFValue.h:300
virtual bool isPointer() const
Check if this variable represents a pointer.
NodeID getSrcNodeID() const
Definition VFGNode.h:152
static bool classof(const VFGNode *node)
Definition VFGNode.h:179
SVFVar * getDstNode() const
Definition VFGNode.h:167
SVFVar * getSrcNode() const
Definition VFGNode.h:162
StmtVFGNode(NodeID id, const SVFStmt *e, VFGNodeK k)
Constructor.
Definition VFGNode.h:135
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:183
const SVFVar * getValue() const override
Return the corresponding LLVM value, if possible, nullptr otherwise.
Definition VFG.cpp:1060
const SVFStmt * getSVFStmt() const
Definition VFGNode.h:147
const SVFStmt * svfStmt
Definition VFGNode.h:131
bool isPTANode() const
Whether this node is used for pointer analysis. Both src and dst SVFVars are of ptr type.
Definition VFGNode.h:140
const std::string toString() const override
Definition VFG.cpp:47
NodeID getDstNodeID() const
Definition VFGNode.h:157
static bool classof(const SVFValue *node)
Definition VFGNode.h:187
static bool classof(const StmtVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:175
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:304
StoreVFGNode(const StoreVFGNode &)
place holder
static bool classof(const VFGNode *node)
Definition VFGNode.h:300
const ValVar * getLHSVar() const
Definition VFGNode.h:286
static bool classof(const StoreVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:292
void operator=(const StoreVFGNode &)
place holder
const ValVar * getRHSVar() const
Definition VFGNode.h:282
const ValVar * getDstNode() const
Definition VFGNode.h:278
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:72
StoreVFGNode()
place holder
const std::string toString() const override
Definition VFG.cpp:85
static bool classof(const StmtVFGNode *node)
Definition VFGNode.h:296
StoreVFGNode(NodeID id, const StoreStmt *edge)
Constructor.
Definition VFGNode.h:270
static bool classof(const SVFValue *node)
Definition VFGNode.h:308
const ValVar * getSrcNode() const
Definition VFGNode.h:274
static bool classof(const UnaryOPVFGNode *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFGNode.h:554
static bool classof(const VFGNode *node)
Definition VFGNode.h:558
static bool classof(const GenericVFGNodeTy *node)
Definition VFGNode.h:562
void operator=(const UnaryOPVFGNode &)
place holder
static bool classof(const SVFValue *node)
Definition VFGNode.h:566
Map< u32_t, const ValVar * > OPVers
Definition VFGNode.h:539
const NodeBS getDefSVFVars() const override
Return the left hand side SVF Vars.
Definition VFG.cpp:152
const ValVar * getOpVar() const
Definition VFGNode.h:587
const ValVar * getOpVer(u32_t pos) const
Operands at a UnaryNode.
Definition VFGNode.h:573
UnaryOPVFGNode(const UnaryOPVFGNode &)
place holder
const ValVar * getRes() const
Definition VFGNode.h:583
OPVers::const_iterator opVerBegin() const
Definition VFGNode.h:596
const ValVar * res
Definition VFGNode.h:541
virtual const std::string toString() const override
Definition VFG.cpp:159
UnaryOPVFGNode(NodeID id, const ValVar *r)
Constructor.
Definition VFGNode.h:551
UnaryOPVFGNode()
place holder
u32_t getOpVerNum() const
Definition VFGNode.h:592
OPVers::const_iterator opVerEnd() const
Definition VFGNode.h:600
void setOpVer(u32_t pos, const ValVar *node)
Definition VFGNode.h:579
virtual const std::string toString() const
Definition VFG.cpp:39
Set< const RetPE * > RetPESet
Definition VFGNode.h:57
virtual const SVFVar * getValue() const
Return the corresponding LLVM value, if possible, nullptr otherwise.
Definition VFGNode.h:85
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
virtual const FunObjVar * getFun() const
Get the function of this SVFGNode.
Definition VFGNode.h:79
friend OutStream & operator<<(OutStream &o, const VFGNode &node)
Overloading operator << for dumping ICFG node ID.
Definition VFGNode.h:95
VFGNode(NodeID i, VFGNodeK k)
Constructor.
Definition VFGNode.h:61
GNodeK VFGNodeK
Definition VFGNode.h:52
VFGEdge::VFGEdgeSetTy::iterator iterator
Definition VFGNode.h:54
static bool classof(const SVFValue *node)
Definition VFGNode.h:115
virtual void setICFGNode(const ICFGNode *node)
Set corresponding ICFG node.
Definition VFGNode.h:73
static bool classof(const VFGNode *)
Definition VFGNode.h:104
virtual const NodeBS getDefSVFVars() const =0
Return the left hand side SVF Vars.
virtual const ICFGNode * getICFGNode() const
Return corresponding ICFG node.
Definition VFGNode.h:67
for isBitcode
Definition BasicTypes.h:70
GenericNode< VFGNode, VFGEdge > GenericVFGNodeTy
Definition VFGNode.h:45
u32_t NodeID
Definition GeneralType.h:56
std::ostream OutStream
Definition GeneralType.h:46
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76
unsigned u32_t
Definition GeneralType.h:47