Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVFVariables.h
Go to the documentation of this file.
1//===- SVFSymbols.h -- SVF Variables------------------------//
2//
3// SVF: Static Value-Flow Analysis
4//
5// Copyright (C) <2013-> <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 * SVFVariables.h
25 *
26 * Created on: Nov 11, 2013
27 * Author: Yulei Sui
28 */
29
30#ifndef INCLUDE_SVFIR_SVFVARIABLE_H_
31#define INCLUDE_SVFIR_SVFVARIABLE_H_
32
33#include "Graphs/GenericGraph.h"
35#include "SVFIR/SVFStatements.h"
36
37namespace SVF
38{
39
40class SVFVar;
41/*
42 * SVFIR program variables (PAGNodes)
43 */
46{
47 friend class SVFIRWriter;
48 friend class SVFIRReader;
49 friend class IRGraph;
50 friend class SVFIR;
51 friend class VFG;
52
53public:
63 typedef GNodeK PNODEK;
65
66protected:
67 const SVFValue* value;
70 bool isPtr;
72
75
76public:
78 SVFVar(const SVFValue* val, NodeID i, PNODEK k);
80 virtual ~SVFVar() {}
81
83
84 inline const SVFValue* getValue() const
85 {
86 assert(this->getNodeKind() != DummyValNode &&
87 this->getNodeKind() != DummyObjNode &&
88 "dummy node do not have value!");
90 "blackhole and constant obj do not have value");
91 assert(value && "value is null (GepObjNode whose basenode is a DummyObj?)");
92 return value;
93 }
94
96 inline virtual const SVFType* getType() const
97 {
98 return value ? value->getType() : nullptr;
99 }
100
101 inline bool hasValue() const
102 {
103 return value != nullptr;
104 }
106 virtual inline bool isPointer() const
107 {
108 return isPtr;
109 }
113
115 virtual bool isIsolatedNode() const;
116
118 // TODO: (Optimization) Should it return const reference instead of value?
119 virtual const std::string getValueName() const = 0;
120
123 virtual inline const SVFFunction* getFunction() const
124 {
125 // Return cached function if available
126 if(func) return func;
127
128 // If we have an associated LLVM value, check its parent function
129 if (value)
130 {
131 // For instructions, return the function containing the parent basic block
132 if (auto inst = SVFUtil::dyn_cast<SVFInstruction>(value))
133 {
134 return inst->getParent()->getParent();
135 }
136 // For function arguments, return their parent function
137 else if (auto arg = SVFUtil::dyn_cast<SVFArgument>(value))
138 {
139 return arg->getParent();
140 }
141 }
142
143 // Return nullptr for globals/constants with no parent function
144 return nullptr;
145 }
146
158 inline bool hasIncomingEdges(SVFStmt::PEDGEK kind) const
159 {
160 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
161 if (it != InEdgeKindToSetMap.end())
162 return (!it->second.empty());
163 else
164 return false;
165 }
167 inline bool hasOutgoingEdges(SVFStmt::PEDGEK kind) const
168 {
169 SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
170 if (it != OutEdgeKindToSetMap.end())
171 return (!it->second.empty());
172 else
173 return false;
174 }
175
177 inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
178 {
179 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
180 assert(it!=InEdgeKindToSetMap.end() && "The node does not have such kind of edge");
181 return it->second.begin();
182 }
183
185 inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd(SVFStmt::PEDGEK kind) const
186 {
187 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
188 assert(it!=InEdgeKindToSetMap.end() && "The node does not have such kind of edge");
189 return it->second.end();
190 }
191
193 inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
194 {
195 SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
196 assert(it!=OutEdgeKindToSetMap.end() && "The node does not have such kind of edge");
197 return it->second.begin();
198 }
199
201 inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
202 {
203 SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
204 assert(it!=OutEdgeKindToSetMap.end() && "The node does not have such kind of edge");
205 return it->second.end();
206 }
208
209 static inline bool classof(const SVFVar *)
210 {
211 return true;
212 }
213
214 static inline bool classof(const GenericPAGNodeTy * node)
215 {
216 return isSVFVarKind(node->getNodeKind());
217 }
218
219 static inline bool classof(const SVFBaseNode* node)
220 {
221 return isSVFVarKind(node->getNodeKind());
222 }
223
224private:
226
228 {
229 GEdgeKind kind = inEdge->getEdgeKind();
230 InEdgeKindToSetMap[kind].insert(inEdge);
232 }
233
235 {
236 GEdgeKind kind = outEdge->getEdgeKind();
237 OutEdgeKindToSetMap[kind].insert(outEdge);
239 }
241 inline bool hasIncomingVariantGepEdge() const
242 {
243 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(SVFStmt::Gep);
244 if (it != InEdgeKindToSetMap.end())
245 {
246 for(auto gep : it->second)
247 {
248 if(SVFUtil::cast<GepStmt>(gep)->isVariantFieldGep())
249 return true;
250 }
251 }
252 return false;
253 }
254
255public:
256 virtual const std::string toString() const;
257
259 void dump() const;
260
262
264 friend OutStream& operator<< (OutStream &o, const SVFVar &node)
265 {
266 o << node.toString();
267 return o;
268 }
270};
271
272
273
274/*
275 * Value (Pointer) variable
276 */
277class ValVar: public SVFVar
278{
279 friend class SVFIRWriter;
280 friend class SVFIRReader;
281
282private:
283 const ICFGNode* icfgNode; // icfgnode related to valvar
284protected:
287
288public:
290
291 static inline bool classof(const ValVar*)
292 {
293 return true;
294 }
295 static inline bool classof(const SVFVar* node)
296 {
297 return isValVarKinds(node->getNodeKind());
298 }
299 static inline bool classof(const GenericPAGNodeTy* node)
300 {
301 return isValVarKinds(node->getNodeKind());
302 }
303 static inline bool classof(const SVFBaseNode* node)
304 {
305 return isValVarKinds(node->getNodeKind());
306 }
308
310 ValVar(const SVFValue* val, NodeID i, PNODEK ty = ValNode, const ICFGNode* node = nullptr)
311 : SVFVar(val, i, ty), icfgNode(node)
312 {
313 }
315 inline const std::string getValueName() const
316 {
317 if (value)
318 return value->getName();
319 return "";
320 }
321
322 const ICFGNode* getICFGNode() const
323 {
324 return icfgNode;
325 }
326
327 virtual const std::string toString() const;
328};
329
330/*
331 * Memory Object variable
332 */
333class ObjVar: public SVFVar
334{
335 friend class SVFIRWriter;
336 friend class SVFIRReader;
337
338protected:
339 const MemObj* mem;
344 SVFVar(val, i, ty), mem(m)
345 {
346 }
347public:
349
350 static inline bool classof(const ObjVar*)
351 {
352 return true;
353 }
354 static inline bool classof(const SVFVar* node)
355 {
356 return isObjVarKinds(node->getNodeKind());
357 }
358 static inline bool classof(const GenericPAGNodeTy* node)
359 {
360 return isObjVarKinds(node->getNodeKind());
361 }
362 static inline bool classof(const SVFBaseNode* node)
363 {
364 return isObjVarKinds(node->getNodeKind());
365 }
367
369 const MemObj* getMemObj() const
370 {
371 return mem;
372 }
373
375 virtual const std::string getValueName() const
376 {
377 if (value)
378 return value->getName();
379 return "";
380 }
382 inline virtual const SVFType* getType() const
383 {
384 return mem->getType();
385 }
386
387 virtual const std::string toString() const;
388};
389
390
391/*
392 * Gep Value (Pointer) variable, this variable can be dynamic generated for field sensitive analysis
393 * e.g. memcpy, temp gep value variable needs to be created
394 * Each Gep Value variable is connected to base value variable via gep edge
395 */
396class GepValVar: public ValVar
397{
398 friend class SVFIRWriter;
399 friend class SVFIRReader;
400
401private:
402 AccessPath ap; // AccessPath
403 NodeID base; // base node id
405
408
409public:
411
412 static inline bool classof(const GepValVar *)
413 {
414 return true;
415 }
416 static inline bool classof(const ValVar * node)
417 {
418 return node->getNodeKind() == SVFVar::GepValNode;
419 }
420 static inline bool classof(const SVFVar *node)
421 {
422 return node->getNodeKind() == SVFVar::GepValNode;
423 }
424 static inline bool classof(const GenericPAGNodeTy *node)
425 {
426 return node->getNodeKind() == SVFVar::GepValNode;
427 }
429
432 const SVFType* ty)
434 {
435 }
436
439 {
441 }
442
444 inline NodeID getBaseNode(void) const
445 {
446 return base;
447 }
448
450 inline const std::string getValueName() const
451 {
452 if (value)
453 return value->getName() + "_" +
454 std::to_string(getConstantFieldIdx());
455 return "offset_" + std::to_string(getConstantFieldIdx());
456 }
457
458 inline const SVFType* getType() const
459 {
460 return gepValType;
461 }
462
463 virtual const std::string toString() const;
464};
465
466
467/*
468 * Gep Obj variable, this is dynamic generated for field sensitive analysis
469 * Each gep obj variable is one field of a MemObj (base)
470 */
471class GepObjVar: public ObjVar
472{
473 friend class SVFIRWriter;
474 friend class SVFIRReader;
475
476private:
479
481 // only for reading from file when we don't have MemObj*
483
484public:
486
487 static inline bool classof(const GepObjVar*)
488 {
489 return true;
490 }
491 static inline bool classof(const ObjVar* node)
492 {
493 return node->getNodeKind() == SVFVar::GepObjNode;
494 }
495 static inline bool classof(const SVFVar* node)
496 {
497 return node->getNodeKind() == SVFVar::GepObjNode;
498 }
499 static inline bool classof(const GenericPAGNodeTy* node)
500 {
501 return node->getNodeKind() == SVFVar::GepObjNode;
502 }
503 static inline bool classof(const SVFBaseNode* node)
504 {
505 return node->getNodeKind() == SVFVar::GepObjNode;
506 }
508
513 {
514 base = mem->getId();
515 }
516
519 {
520 return apOffset;
521 }
522
524 inline void setBaseNode(NodeID bs)
525 {
526 this->base = bs;
527 }
528
530 inline NodeID getBaseNode(void) const
531 {
532 return base;
533 }
534
536 inline virtual const SVFType* getType() const
537 {
539 }
540
542 inline const std::string getValueName() const
543 {
544 if (value)
545 return value->getName() + "_" + std::to_string(apOffset);
546 return "offset_" + std::to_string(apOffset);
547 }
548
549 virtual const std::string toString() const;
550};
551
552/*
553 * Field-insensitive Gep Obj variable, this is dynamic generated for field sensitive analysis
554 * Each field-insensitive gep obj node represents all fields of a MemObj (base)
555 */
556class BaseObjVar : public ObjVar
557{
558 friend class SVFIRWriter;
559 friend class SVFIRReader;
560
561protected:
564
565public:
567
568 static inline bool classof(const BaseObjVar*)
569 {
570 return true;
571 }
572 static inline bool classof(const ObjVar* node)
573 {
574 return isBaseObjVarKinds(node->getNodeKind());
575 }
576 static inline bool classof(const SVFVar* node)
577 {
578 return isBaseObjVarKinds(node->getNodeKind());
579 }
580 static inline bool classof(const GenericPAGNodeTy* node)
581 {
582 return isBaseObjVarKinds(node->getNodeKind());
583 }
584 static inline bool classof(const SVFBaseNode* node)
585 {
586 return isBaseObjVarKinds(node->getNodeKind());
587 }
589
593 : ObjVar(val, i, mem, ty)
594 {
595 }
596
598 inline const std::string getValueName() const
599 {
600 if (value)
601 return value->getName() + " (base object)";
602 return " (base object)";
603 }
604
605 virtual const std::string toString() const;
606};
607
608
616{
617
618 friend class SVFIRWriter;
619 friend class SVFIRReader;
620
621protected:
624
625public:
627
628 static inline bool classof(const HeapObjVar*)
629 {
630 return true;
631 }
632 static inline bool classof(const BaseObjVar* node)
633 {
634 return node->getNodeKind() == HeapObjNode;
635 }
636 static inline bool classof(const ObjVar* node)
637 {
638 return node->getNodeKind() == HeapObjNode;
639 }
640 static inline bool classof(const SVFVar* node)
641 {
642 return node->getNodeKind() == HeapObjNode;
643 }
644 static inline bool classof(const GenericPAGNodeTy* node)
645 {
646 return node->getNodeKind() == HeapObjNode;
647 }
648 static inline bool classof(const SVFBaseNode* node)
649 {
650 return node->getNodeKind() == HeapObjNode;
651 }
653
656 const MemObj* mem, PNODEK ty = HeapObjNode);
657
659 inline const std::string getValueName() const
660 {
661 return " (heap base object)";
662 }
663
664 virtual const std::string toString() const;
665};
666
667
677{
678
679 friend class SVFIRWriter;
680 friend class SVFIRReader;
681
682protected:
685
686public:
688
689 static inline bool classof(const StackObjVar*)
690 {
691 return true;
692 }
693 static inline bool classof(const BaseObjVar* node)
694 {
695 return node->getNodeKind() == StackObjNode;
696 }
697 static inline bool classof(const ObjVar* node)
698 {
699 return node->getNodeKind() == StackObjNode;
700 }
701 static inline bool classof(const SVFVar* node)
702 {
703 return node->getNodeKind() == StackObjNode;
704 }
705 static inline bool classof(const GenericPAGNodeTy* node)
706 {
707 return node->getNodeKind() == StackObjNode;
708 }
709 static inline bool classof(const SVFBaseNode* node)
710 {
711 return node->getNodeKind() == StackObjNode;
712 }
714
717 const MemObj* mem, PNODEK ty = StackObjNode);
718
720 inline const std::string getValueName() const
721 {
722 return " (stack base object)";
723 }
724
725 virtual const std::string toString() const;
726};
727
728
729class CallGraphNode;
730
731class FunValVar : public ValVar
732{
733 friend class SVFIRWriter;
734 friend class SVFIRReader;
735private:
737
738public:
740
741 static inline bool classof(const FunValVar*)
742 {
743 return true;
744 }
745 static inline bool classof(const ValVar* node)
746 {
747 return node->getNodeKind() == FunValNode;
748 }
749 static inline bool classof(const SVFVar* node)
750 {
751 return node->getNodeKind() == FunValNode;
752 }
753 static inline bool classof(const GenericPAGNodeTy* node)
754 {
755 return node->getNodeKind() == FunValNode;
756 }
757 static inline bool classof(const SVFBaseNode* node)
758 {
759 return node->getNodeKind() == FunValNode;
760 }
762
763 inline const CallGraphNode* getCallGraphNode() const
764 {
765 return callGraphNode;
766 }
767
771
772 virtual const std::string toString() const;
773};
774
775class FunObjVar : public BaseObjVar
776{
777 friend class SVFIRWriter;
778 friend class SVFIRReader;
779
780private:
782
783private:
786
787public:
789
790 static inline bool classof(const FunObjVar*)
791 {
792 return true;
793 }
794 static inline bool classof(const BaseObjVar* node)
795 {
796 return node->getNodeKind() == FunObjNode;
797 }
798 static inline bool classof(const ObjVar* node)
799 {
800 return node->getNodeKind() == FunObjNode;
801 }
802 static inline bool classof(const SVFVar* node)
803 {
804 return node->getNodeKind() == FunObjNode;
805 }
806 static inline bool classof(const GenericPAGNodeTy* node)
807 {
808 return node->getNodeKind() == FunObjNode;
809 }
810 static inline bool classof(const SVFBaseNode* node)
811 {
812 return node->getNodeKind() == FunObjNode;
813 }
815
819
820 inline const CallGraphNode* getCallGraphNode() const
821 {
822 return callGraphNode;
823 }
824
825 virtual bool isIsolatedNode() const;
826
827 virtual const std::string toString() const;
828};
829
830class GlobalValVar : public ValVar
831{
832 friend class SVFIRWriter;
833 friend class SVFIRReader;
834
835public:
837
838 static inline bool classof(const GlobalValVar*)
839 {
840 return true;
841 }
842 static inline bool classof(const ValVar* node)
843 {
844 return node->getNodeKind() == GlobalValNode;
845 }
846 static inline bool classof(const SVFVar* node)
847 {
848 return node->getNodeKind() == GlobalValNode;
849 }
850 static inline bool classof(const GenericPAGNodeTy* node)
851 {
852 return node->getNodeKind() == GlobalValNode;
853 }
854 static inline bool classof(const SVFBaseNode* node)
855 {
856 return node->getNodeKind() == GlobalValNode;
857 }
859
863 : ValVar(val, i, ty, icn)
864 {
865 }
866
867 virtual const std::string toString() const;
868};
869
871{
872 friend class SVFIRWriter;
873 friend class SVFIRReader;
874
875public:
877
878 static inline bool classof(const ConstantDataValVar*)
879 {
880 return true;
881 }
882 static inline bool classof(const ValVar* node)
883 {
884 return isConstantDataValVar(node->getNodeKind());
885 }
886 static inline bool classof(const SVFVar* node)
887 {
888 return isConstantDataValVar(node->getNodeKind());
889 }
890 static inline bool classof(const GenericPAGNodeTy* node)
891 {
892 return isConstantDataValVar(node->getNodeKind());
893 }
894 static inline bool classof(const SVFBaseNode* node)
895 {
896 return isConstantDataValVar(node->getNodeKind());
897 }
899
903 : ValVar(val, i, ty, icn)
904 {
905
906 }
907
908 virtual const std::string toString() const;
909};
910
912{
913 friend class SVFIRWriter;
914 friend class SVFIRReader;
915
916public:
918
919 static inline bool classof(const BlackHoleVar*)
920 {
921 return true;
922 }
923 static inline bool classof(const ConstantDataValVar* node)
924 {
925 return node->getNodeKind() == BlackHoleNode;
926 }
927 static inline bool classof(const ValVar* node)
928 {
929 return node->getNodeKind() == BlackHoleNode;
930 }
931 static inline bool classof(const SVFVar* node)
932 {
933 return node->getNodeKind() == BlackHoleNode;
934 }
935 static inline bool classof(const GenericPAGNodeTy* node)
936 {
937 return node->getNodeKind() == BlackHoleNode;
938 }
939 static inline bool classof(const SVFBaseNode* node)
940 {
941 return node->getNodeKind() == BlackHoleNode;
942 }
944
951
952 virtual const std::string toString() const
953 {
954 return "BlackHoleVar";
955 }
956};
957
959{
960 friend class SVFIRWriter;
961 friend class SVFIRReader;
962private:
963 double dval;
964
965public:
967
968 static inline bool classof(const ConstantFPValVar*)
969 {
970 return true;
971 }
972 static inline bool classof(const ConstantDataValVar* node)
973 {
974 return node->getNodeKind() == ConstantFPValNode;
975 }
976 static inline bool classof(const ValVar* node)
977 {
978 return node->getNodeKind() == ConstantFPValNode;
979 }
980 static inline bool classof(const SVFVar* node)
981 {
982 return node->getNodeKind() == ConstantFPValNode;
983 }
984 static inline bool classof(const GenericPAGNodeTy* node)
985 {
986 return node->getNodeKind() == ConstantFPValNode;
987 }
988 static inline bool classof(const SVFBaseNode* node)
989 {
990 return node->getNodeKind() == ConstantFPValNode;
991 }
993
994 inline double getFPValue() const
995 {
996 return dval;
997 }
998
1003 {
1004
1005 }
1006
1007 virtual const std::string toString() const;
1008};
1009
1011{
1012 friend class SVFIRWriter;
1013 friend class SVFIRReader;
1014private:
1017
1018public:
1020
1021 static inline bool classof(const ConstantIntValVar*)
1022 {
1023 return true;
1024 }
1025 static inline bool classof(const ConstantDataValVar* node)
1026 {
1027 return node->getNodeKind() == ConstantIntValNode;
1028 }
1029 static inline bool classof(const ValVar* node)
1030 {
1031 return node->getNodeKind() == ConstantIntValNode;
1032 }
1033 static inline bool classof(const SVFVar* node)
1034 {
1035 return node->getNodeKind() == ConstantIntValNode;
1036 }
1037 static inline bool classof(const GenericPAGNodeTy* node)
1038 {
1039 return node->getNodeKind() == ConstantIntValNode;
1040 }
1041 static inline bool classof(const SVFBaseNode* node)
1042 {
1043 return node->getNodeKind() == ConstantIntValNode;
1044 }
1046
1048 {
1049 return sval;
1050 }
1051
1052
1054 {
1055 return zval;
1056 }
1057
1065 virtual const std::string toString() const;
1066};
1067
1069{
1070 friend class SVFIRWriter;
1071 friend class SVFIRReader;
1072
1073public:
1075
1076 static inline bool classof(const ConstantNullPtrValVar*)
1077 {
1078 return true;
1079 }
1080 static inline bool classof(const ConstantDataValVar* node)
1081 {
1082 return node->getNodeKind() == ConstantNullptrValNode;
1083 }
1084 static inline bool classof(const ValVar* node)
1085 {
1086 return node->getNodeKind() == ConstantNullptrValNode;
1087 }
1088 static inline bool classof(const SVFVar* node)
1089 {
1090 return node->getNodeKind() == ConstantNullptrValNode;
1091 }
1092 static inline bool classof(const GenericPAGNodeTy* node)
1093 {
1094 return node->getNodeKind() == ConstantNullptrValNode;
1095 }
1096 static inline bool classof(const SVFBaseNode* node)
1097 {
1098 return node->getNodeKind() == ConstantNullptrValNode;
1099 }
1101
1109
1110 virtual const std::string toString() const;
1111};
1112
1114{
1115 friend class SVFIRWriter;
1116 friend class SVFIRReader;
1117
1118private:
1121
1122public:
1124
1125 static inline bool classof(const GlobalObjVar*)
1126 {
1127 return true;
1128 }
1129 static inline bool classof(const BaseObjVar* node)
1130 {
1131 return node->getNodeKind() == GlobalObjNode;
1132 }
1133 static inline bool classof(const ObjVar* node)
1134 {
1135 return node->getNodeKind() == GlobalObjNode;
1136 }
1137 static inline bool classof(const SVFVar* node)
1138 {
1139 return node->getNodeKind() == GlobalObjNode;
1140 }
1141 static inline bool classof(const GenericPAGNodeTy* node)
1142 {
1143 return node->getNodeKind() == GlobalObjNode;
1144 }
1145 static inline bool classof(const SVFBaseNode* node)
1146 {
1147 return node->getNodeKind() == GlobalObjNode;
1148 }
1150
1154 {
1155
1156 }
1157
1158
1159 virtual const std::string toString() const;
1160};
1161
1163{
1164 friend class SVFIRWriter;
1165 friend class SVFIRReader;
1166
1167protected:
1170
1171public:
1173 static inline bool classof(const ConstantDataObjVar*)
1174 {
1175 return true;
1176 }
1177 static inline bool classof(const BaseObjVar* node)
1178 {
1179 return isConstantDataObjVarKinds(node->getNodeKind());
1180 }
1181 static inline bool classof(const SVFVar* node)
1182 {
1183 return isConstantDataObjVarKinds(node->getNodeKind());
1184 }
1185 static inline bool classof(const ObjVar* node)
1186 {
1187 return isConstantDataObjVarKinds(node->getNodeKind());
1188 }
1189 static inline bool classof(const GenericPAGNodeTy* node)
1190 {
1191 return isConstantDataObjVarKinds(node->getNodeKind());
1192 }
1193
1194 static inline bool classof(const SVFBaseNode* node)
1195 {
1196 return isConstantDataObjVarKinds(node->getNodeKind());
1197 }
1199
1205
1206 virtual const std::string toString() const;
1207};
1208
1210{
1211 friend class SVFIRWriter;
1212 friend class SVFIRReader;
1213
1214private:
1217
1218private:
1219 float dval;
1220
1221public:
1223 static inline bool classof(const ConstantFPObjVar*)
1224 {
1225 return true;
1226 }
1227 static inline bool classof(const ConstantDataObjVar* node)
1228 {
1229 return node->getNodeKind() == SVFVar::ConstantFPObjNode;
1230 }
1231 static inline bool classof(const BaseObjVar* node)
1232 {
1233 return node->getNodeKind() == SVFVar::ConstantFPObjNode;
1234 }
1235
1236 static inline bool classof(const SVFVar* node)
1237 {
1238 return node->getNodeKind() == SVFVar::ConstantFPObjNode;
1239 }
1240
1241 static inline bool classof(const ObjVar* node)
1242 {
1243 return node->getNodeKind() == SVFVar::ConstantFPObjNode;
1244 }
1245
1246 static inline bool classof(const GenericPAGNodeTy* node)
1247 {
1248 return node->getNodeKind() == SVFVar::ConstantFPObjNode;
1249 }
1250
1251 static inline bool classof(const SVFBaseNode* node)
1252 {
1253 return node->getNodeKind() == SVFVar::ConstantFPObjNode;
1254 }
1256
1260 {
1261 }
1262
1263 inline double getFPValue() const
1264 {
1265 return dval;
1266 }
1267
1268
1269 virtual const std::string toString() const;
1270};
1271
1273{
1274 friend class SVFIRWriter;
1275 friend class SVFIRReader;
1276
1277private:
1280
1281private:
1284
1285public:
1287 static inline bool classof(const ConstantIntObjVar*)
1288 {
1289 return true;
1290 }
1291
1292 static inline bool classof(const ConstantDataObjVar* node)
1293 {
1294 return node->getNodeKind() == SVFVar::ConstantIntObjNode;
1295 }
1296
1297 static inline bool classof(const BaseObjVar* node)
1298 {
1299 return node->getNodeKind() == SVFVar::ConstantIntObjNode;
1300 }
1301
1302 static inline bool classof(const SVFVar* node)
1303 {
1304 return node->getNodeKind() == SVFVar::ConstantIntObjNode;
1305 }
1306 static inline bool classof(const ObjVar* node)
1307 {
1308 return node->getNodeKind() == SVFVar::ConstantIntObjNode;
1309 }
1310 static inline bool classof(const GenericPAGNodeTy* node)
1311 {
1312 return node->getNodeKind() == SVFVar::ConstantIntObjNode;
1313 }
1314
1315 static inline bool classof(const SVFBaseNode* node)
1316 {
1317 return node->getNodeKind() == SVFVar::ConstantIntObjNode;
1318 }
1319
1321 {
1322 return sval;
1323 }
1324
1325
1327 {
1328 return zval;
1329 }
1331
1337
1338
1339 virtual const std::string toString() const;
1340};
1341
1343{
1344 friend class SVFIRWriter;
1345 friend class SVFIRReader;
1346
1347private:
1350
1351public:
1353 static inline bool classof(const ConstantNullPtrObjVar*)
1354 {
1355 return true;
1356 }
1357
1358 static inline bool classof(const ConstantDataObjVar* node)
1359 {
1361 }
1362
1363 static inline bool classof(const BaseObjVar* node)
1364 {
1366 }
1367
1368 static inline bool classof(const SVFVar* node)
1369 {
1371 }
1372 static inline bool classof(const ObjVar* node)
1373 {
1375 }
1376 static inline bool classof(const GenericPAGNodeTy* node)
1377 {
1379 }
1380
1381 static inline bool classof(const SVFBaseNode* node)
1382 {
1384 }
1386
1392
1393
1394 virtual const std::string toString() const;
1395};
1396/*
1397 * Unique Return node of a procedure
1398 */
1399class RetPN: public ValVar
1400{
1401 friend class SVFIRWriter;
1402 friend class SVFIRReader;
1403
1404private:
1406private:
1409
1410public:
1412 static inline bool classof(const RetPN*)
1413 {
1414 return true;
1415 }
1416 static inline bool classof(const SVFVar* node)
1417 {
1418 return node->getNodeKind() == SVFVar::RetNode;
1419 }
1420 static inline bool classof(const ValVar* node)
1421 {
1422 return node->getNodeKind() == SVFVar::RetNode;
1423 }
1424 static inline bool classof(const GenericPAGNodeTy* node)
1425 {
1426 return node->getNodeKind() == SVFVar::RetNode;
1427 }
1428 static inline bool classof(const SVFBaseNode* node)
1429 {
1430 return node->getNodeKind() == SVFVar::RetNode;
1431 }
1433
1434
1436 RetPN(const CallGraphNode* node, NodeID i);
1437
1438 inline const CallGraphNode* getCallGraphNode() const
1439 {
1440 return callGraphNode;
1441 }
1442
1443 virtual const SVFFunction* getFunction() const;
1444
1446 const std::string getValueName() const;
1447
1448 virtual const std::string toString() const;
1449};
1450
1451/*
1452 * Unique vararg node of a procedure
1453 */
1454class VarArgPN: public ValVar
1455{
1456 friend class SVFIRWriter;
1457 friend class SVFIRReader;
1458private:
1460
1461private:
1464
1465public:
1467 static inline bool classof(const VarArgPN*)
1468 {
1469 return true;
1470 }
1471 static inline bool classof(const SVFVar* node)
1472 {
1473 return node->getNodeKind() == SVFVar::VarargNode;
1474 }
1475 static inline bool classof(const ValVar* node)
1476 {
1477 return node->getNodeKind() == SVFVar::VarargNode;
1478 }
1479 static inline bool classof(const GenericPAGNodeTy* node)
1480 {
1481 return node->getNodeKind() == SVFVar::VarargNode;
1482 }
1483 static inline bool classof(const SVFBaseNode* node)
1484 {
1485 return node->getNodeKind() == SVFVar::VarargNode;
1486 }
1488
1491
1492 virtual const SVFFunction* getFunction() const;
1493
1495 const std::string getValueName() const;
1496
1497 virtual const std::string toString() const;
1498};
1499
1500/*
1501 * Dummy variable without any LLVM value
1502 */
1503class DummyValVar: public ValVar
1504{
1505 friend class SVFIRWriter;
1506 friend class SVFIRReader;
1507
1508public:
1510 static inline bool classof(const DummyValVar*)
1511 {
1512 return true;
1513 }
1514 static inline bool classof(const SVFVar* node)
1515 {
1516 return node->getNodeKind() == SVFVar::DummyValNode;
1517 }
1518 static inline bool classof(const ValVar* node)
1519 {
1520 return node->getNodeKind() == SVFVar::DummyValNode;
1521 }
1522 static inline bool classof(const GenericPAGNodeTy* node)
1523 {
1524 return node->getNodeKind() == SVFVar::DummyValNode;
1525 }
1526 static inline bool classof(const SVFBaseNode* node)
1527 {
1528 return node->getNodeKind() == SVFVar::DummyValNode;
1529 }
1531
1534
1536 inline const std::string getValueName() const
1537 {
1538 return "dummyVal";
1539 }
1540
1541 virtual const std::string toString() const;
1542};
1543
1544/*
1545 * Dummy object variable
1546 */
1548{
1549 friend class SVFIRWriter;
1550 friend class SVFIRReader;
1551
1552private:
1555
1556public:
1558 static inline bool classof(const DummyObjVar*)
1559 {
1560 return true;
1561 }
1562 static inline bool classof(const BaseObjVar* node)
1563 {
1564 return node->getNodeKind() == SVFVar::DummyObjNode;
1565 }
1566 static inline bool classof(const SVFVar* node)
1567 {
1568 return node->getNodeKind() == SVFVar::DummyObjNode;
1569 }
1570 static inline bool classof(const ObjVar* node)
1571 {
1572 return node->getNodeKind() == SVFVar::DummyObjNode;
1573 }
1574 static inline bool classof(const GenericPAGNodeTy* node)
1575 {
1576 return node->getNodeKind() == SVFVar::DummyObjNode;
1577 }
1578
1579 static inline bool classof(const SVFBaseNode* node)
1580 {
1581 return node->getNodeKind() == SVFVar::DummyObjNode;
1582 }
1584
1587 : BaseObjVar(nullptr, i, m, ty)
1588 {
1589 }
1590
1592 inline const std::string getValueName() const
1593 {
1594 return "dummyObj";
1595 }
1596
1597 virtual const std::string toString() const;
1598};
1599
1600} // End namespace SVF
1601
1602#endif /* INCLUDE_SVFIR_SVFVARIABLE_H_ */
APOffset getConstantStructFldIdx() const
Get methods.
Definition AccessPath.h:100
const std::string getValueName() const
Return name of a LLVM value.
virtual const std::string toString() const
BaseObjVar(NodeID i, PNODEK ty=BaseObjNode)
Constructor to create empty ObjVar (for SVFIRReader/deserialization)
static bool classof(const ObjVar *node)
static bool classof(const SVFBaseNode *node)
static bool classof(const BaseObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
BaseObjVar(const SVFValue *val, NodeID i, const MemObj *mem, PNODEK ty=BaseObjNode)
Constructor.
static bool classof(const SVFVar *node)
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const ConstantDataValVar *node)
static bool classof(const SVFVar *node)
static bool classof(const SVFBaseNode *node)
static bool classof(const GenericPAGNodeTy *node)
BlackHoleVar(NodeID i, PNODEK ty=BlackHoleNode)
Constructor.
static bool classof(const ValVar *node)
static bool classof(const BlackHoleVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
virtual const std::string toString() const
ConstantDataObjVar(NodeID i)
Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
ConstantDataObjVar(const SVFValue *val, NodeID i, const MemObj *m, PNODEK ty=ConstantDataObjNode)
Constructor.
static bool classof(const ObjVar *node)
virtual const std::string toString() const
static bool classof(const SVFVar *node)
static bool classof(const ConstantDataObjVar *)
static bool classof(const BaseObjVar *node)
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFBaseNode *node)
static bool classof(const GenericPAGNodeTy *node)
ConstantDataValVar(const SVFValue *val, NodeID i, const ICFGNode *icn, PNODEK ty=ConstantDataValNode)
Constructor.
static bool classof(const SVFBaseNode *node)
static bool classof(const SVFVar *node)
static bool classof(const ConstantDataValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const ValVar *node)
virtual const std::string toString() const
ConstantFPObjVar(const SVFValue *val, double dv, NodeID i, const MemObj *m, PNODEK ty=ConstantFPObjNode)
Constructor.
static bool classof(const SVFVar *node)
static bool classof(const ObjVar *node)
static bool classof(const ConstantFPObjVar *)
static bool classof(const BaseObjVar *node)
static bool classof(const GenericPAGNodeTy *node)
ConstantFPObjVar(NodeID i)
Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
virtual const std::string toString() const
static bool classof(const SVFBaseNode *node)
static bool classof(const ConstantDataObjVar *node)
double getFPValue() const
static bool classof(const ValVar *node)
static bool classof(const ConstantDataValVar *node)
static bool classof(const SVFBaseNode *node)
static bool classof(const SVFVar *node)
static bool classof(const GenericPAGNodeTy *node)
ConstantFPValVar(const SVFValue *val, double dv, NodeID i, const ICFGNode *icn, PNODEK ty=ConstantFPValNode)
Constructor.
virtual const std::string toString() const
static bool classof(const ConstantFPValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
double getFPValue() const
static bool classof(const ConstantDataObjVar *node)
u64_t getZExtValue() const
virtual const std::string toString() const
static bool classof(const ObjVar *node)
s64_t getSExtValue() const
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFVar *node)
static bool classof(const ConstantIntObjVar *)
static bool classof(const SVFBaseNode *node)
static bool classof(const BaseObjVar *node)
ConstantIntObjVar(NodeID i)
Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
ConstantIntObjVar(const SVFValue *val, s64_t sv, u64_t zv, NodeID i, const MemObj *m, PNODEK ty=ConstantIntObjNode)
Constructor.
s64_t getSExtValue() const
static bool classof(const SVFBaseNode *node)
ConstantIntValVar(const SVFValue *val, s64_t sv, u64_t zv, NodeID i, const ICFGNode *icn, PNODEK ty=ConstantIntValNode)
Constructor.
static bool classof(const SVFVar *node)
static bool classof(const ValVar *node)
static bool classof(const ConstantIntValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
u64_t getZExtValue() const
virtual const std::string toString() const
static bool classof(const ConstantDataValVar *node)
static bool classof(const GenericPAGNodeTy *node)
virtual const std::string toString() const
static bool classof(const ObjVar *node)
ConstantNullPtrObjVar(NodeID i)
Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
static bool classof(const GenericPAGNodeTy *node)
ConstantNullPtrObjVar(const SVFValue *val, NodeID i, const MemObj *m, PNODEK ty=ConstantNullptrObjNode)
Constructor.
static bool classof(const ConstantDataObjVar *node)
static bool classof(const SVFVar *node)
static bool classof(const ConstantNullPtrObjVar *)
static bool classof(const BaseObjVar *node)
static bool classof(const SVFBaseNode *node)
static bool classof(const ConstantDataValVar *node)
virtual const std::string toString() const
static bool classof(const SVFVar *node)
static bool classof(const ConstantNullPtrValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const ValVar *node)
ConstantNullPtrValVar(const SVFValue *val, NodeID i, const ICFGNode *icn, PNODEK ty=ConstantNullptrValNode)
Constructor.
static bool classof(const SVFBaseNode *node)
virtual const std::string toString() const
DummyObjVar(NodeID i, const MemObj *m, PNODEK ty=DummyObjNode)
Constructor.
static bool classof(const DummyObjVar *)
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFBaseNode *node)
static bool classof(const SVFVar *node)
static bool classof(const ObjVar *node)
static bool classof(const BaseObjVar *node)
DummyObjVar(NodeID i)
Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
const std::string getValueName() const
Return name of this node.
static bool classof(const DummyValVar *)
const std::string getValueName() const
Return name of this node.
DummyValVar(NodeID i)
Constructor.
static bool classof(const ValVar *node)
virtual const std::string toString() const
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFVar *node)
static bool classof(const SVFBaseNode *node)
virtual const std::string toString() const
FunObjVar(NodeID i, PNODEK ty=FunObjNode)
Constructor to create empty ObjVar (for SVFIRReader/deserialization)
virtual bool isIsolatedNode() const
Whether this is an isolated node on the SVFIR graph.
static bool classof(const SVFVar *node)
static bool classof(const BaseObjVar *node)
const CallGraphNode * getCallGraphNode() const
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFBaseNode *node)
static bool classof(const FunObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
const CallGraphNode * callGraphNode
static bool classof(const ObjVar *node)
static bool classof(const FunValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
virtual const std::string toString() const
const CallGraphNode * callGraphNode
static bool classof(const SVFVar *node)
const CallGraphNode * getCallGraphNode() const
static bool classof(const SVFBaseNode *node)
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const ValVar *node)
bool addIncomingEdge(EdgeType *inEdge)
Add incoming and outgoing edges.
bool addOutgoingEdge(EdgeType *outEdge)
APOffset getConstantFieldIdx() const
offset of the mem object
GepObjVar(NodeID i, PNODEK ty=GepObjNode)
Constructor to create empty GepObjVar (for SVFIRReader/deserialization)
NodeID getBaseNode(void) const
Return the base object from which this GEP node came from.
void setBaseNode(NodeID bs)
Set the base object from which this GEP node came from.
virtual const SVFType * getType() const
Return the type of this gep object.
const std::string getValueName() const
Return name of a LLVM value.
virtual const std::string toString() const
static bool classof(const GepObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const ObjVar *node)
static bool classof(const GenericPAGNodeTy *node)
GepObjVar(const MemObj *mem, NodeID i, const APOffset &apOffset, PNODEK ty=GepObjNode)
Constructor.
static bool classof(const SVFVar *node)
static bool classof(const SVFBaseNode *node)
APOffset apOffset
AccessPath ap
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const GepValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
const SVFType * getType() const
Return type of the value.
const SVFType * gepValType
static bool classof(const SVFVar *node)
GepValVar(NodeID baseID, const SVFValue *val, NodeID i, const AccessPath &ap, const SVFType *ty)
Constructor.
GepValVar(NodeID i)
Constructor to create empty GeValVar (for SVFIRReader/deserialization)
virtual const std::string toString() const
NodeID getBaseNode(void) const
Return the base object from which this GEP node came from.
APOffset getConstantFieldIdx() const
offset of the base value variable
const std::string getValueName() const
Return name of a LLVM value.
static bool classof(const ValVar *node)
static bool classof(const BaseObjVar *node)
GlobalObjVar(NodeID i, PNODEK ty=GlobalObjNode)
Constructor to create empty ObjVar (for SVFIRReader/deserialization)
static bool classof(const GenericPAGNodeTy *node)
virtual const std::string toString() const
static bool classof(const SVFVar *node)
GlobalObjVar(const SVFValue *val, NodeID i, const MemObj *mem, PNODEK ty=GlobalObjNode)
Constructor.
static bool classof(const GlobalObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const SVFBaseNode *node)
static bool classof(const ObjVar *node)
static bool classof(const GlobalValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
virtual const std::string toString() const
static bool classof(const ValVar *node)
static bool classof(const SVFBaseNode *node)
static bool classof(const GenericPAGNodeTy *node)
GlobalValVar(const SVFValue *val, NodeID i, const ICFGNode *icn, PNODEK ty=GlobalValNode)
Constructor.
static bool classof(const SVFVar *node)
Class representing a heap object variable in the SVFIR.
static bool classof(const HeapObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const SVFVar *node)
static bool classof(const SVFBaseNode *node)
static bool classof(const GenericPAGNodeTy *node)
const std::string getValueName() const
Return name of a LLVM value.
HeapObjVar(NodeID i, PNODEK ty=HeapObjNode)
Constructor to create heap object var.
static bool classof(const ObjVar *node)
virtual const std::string toString() const
static bool classof(const BaseObjVar *node)
const SVFType * getType() const
Get obj type.
SymID getId() const
Get the memory object id.
ObjVar(NodeID i, PNODEK ty=ObjNode)
Constructor to create an empty ObjVar (for SVFIRReader/deserialization)
virtual const std::string toString() const
const MemObj * mem
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFVar *node)
static bool classof(const SVFBaseNode *node)
ObjVar(const SVFValue *val, NodeID i, const MemObj *m, PNODEK ty=ObjNode)
Constructor.
const MemObj * getMemObj() const
Return memory object.
static bool classof(const ObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
virtual const std::string getValueName() const
Return name of a LLVM value.
virtual const SVFType * getType() const
Return type of the value.
const std::string getValueName() const
Return name of a LLVM value.
static bool classof(const SVFVar *node)
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const ValVar *node)
const CallGraphNode * callGraphNode
virtual const std::string toString() const
static bool classof(const SVFBaseNode *node)
RetPN(NodeID i)
Constructor to create empty RetPN (for SVFIRReader/deserialization)
static bool classof(const RetPN *)
const CallGraphNode * getCallGraphNode() const
virtual const SVFFunction * getFunction() const
static bool isObjVarKinds(GNodeK n)
static bool isConstantDataValVar(GNodeK n)
static bool isConstantDataObjVarKinds(GNodeK n)
static bool isValVarKinds(GNodeK n)
GNodeK getNodeKind() const
Get node kind.
NodeID getId() const
Get ID.
static bool isSVFVarKind(GNodeK n)
static bool isBaseObjVarKinds(GNodeK n)
GenericNode< SVFVar, SVFStmt >::GEdgeSetTy SVFStmtSetTy
PAGEdgeToSetMapTy KindToSVFStmtMapTy
const std::string & getName() const
Definition SVFValue.h:243
virtual const SVFType * getType() const
Definition SVFValue.h:256
SVFStmt::SVFStmtSetTy & getOutgoingEdges(SVFStmt::PEDGEK kind)
Get outgoing SVFIR statements (edges)
bool isConstDataOrAggDataButNotNullPtr() const
SVFStmt::KindToSVFStmtMapTy InEdgeKindToSetMap
const SVFValue * getValue() const
Get/has methods of the components.
bool hasValue() const
void addOutEdge(SVFStmt *outEdge)
friend OutStream & operator<<(OutStream &o, const SVFVar &node)
Overloading operator << for dumping SVFVar value.
SVFStmt::KindToSVFStmtMapTy OutEdgeKindToSetMap
virtual bool isPointer() const
Whether it is a pointer.
virtual const SVFType * getType() const
Return type of the value.
SVFVar(NodeID i, PNODEK k)
function containing this variable
virtual const std::string getValueName() const =0
Get name of the LLVM value.
bool hasIncomingVariantGepEdge() const
Has incoming VariantGepEdges.
bool hasIncomingEdges(SVFStmt::PEDGEK kind) const
Has incoming SVFIR statements (edges)
SVFStmt::SVFStmtSetTy & getIncomingEdges(SVFStmt::PEDGEK kind)
Get incoming SVFIR statements (edges)
GNodeK PNODEK
SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
Get incoming SVFStmt iterator.
void addInEdge(SVFStmt *inEdge)
add methods of the components
bool hasOutgoingEdges(SVFStmt::PEDGEK kind) const
Has outgoing SVFIR statements (edges)
SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
Get outgoing SVFStmt iterator.
virtual const SVFFunction * getFunction() const
void dump() const
Dump to console for debugging.
SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
Get outgoing SVFStmt iterator.
const SVFValue * value
value of this SVFIR node
const SVFFunction * func
whether it is a pointer (top-level or address-taken)
virtual ~SVFVar()
Destructor.
static bool classof(const SVFVar *)
virtual bool isIsolatedNode() const
Whether this is an isolated node on the SVFIR graph.
static bool classof(const SVFBaseNode *node)
virtual const std::string toString() const
s64_t GEdgeKind
SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd(SVFStmt::PEDGEK kind) const
Get incoming SVFStmt iterator.
static bool classof(const GenericPAGNodeTy *node)
Represents a stack-allocated object variable in the SVFIR (SVF Intermediate Representation) @inherits...
StackObjVar(NodeID i, PNODEK ty=StackObjNode)
Constructor to create stack object var.
static bool classof(const SVFBaseNode *node)
const std::string getValueName() const
Return name of a LLVM value.
static bool classof(const SVFVar *node)
static bool classof(const ObjVar *node)
static bool classof(const BaseObjVar *node)
static bool classof(const GenericPAGNodeTy *node)
virtual const std::string toString() const
static bool classof(const StackObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static SymbolTableInfo * SymbolInfo()
Singleton design here to make sure we only have one instance during any analysis.
static bool isBlkObjOrConstantObj(NodeID id)
const SVFType * getFlatternedElemType(const SVFType *baseType, u32_t flatten_idx)
Return the type of a flattened element given a flattened index.
Definition VFG.h:51
const ICFGNode * getICFGNode() const
static bool classof(const GenericPAGNodeTy *node)
virtual const std::string toString() const
ValVar(NodeID i, PNODEK ty=ValNode)
Constructor to create an empty ValVar (for SVFIRReader/deserialization)
static bool classof(const SVFVar *node)
static bool classof(const SVFBaseNode *node)
static bool classof(const ValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
const ICFGNode * icfgNode
const std::string getValueName() const
Return name of a LLVM value.
ValVar(const SVFValue *val, NodeID i, PNODEK ty=ValNode, const ICFGNode *node=nullptr)
Constructor.
const CallGraphNode * callGraphNode
const std::string getValueName() const
Return name of a LLVM value.
static bool classof(const SVFVar *node)
static bool classof(const ValVar *node)
virtual const std::string toString() const
static bool classof(const SVFBaseNode *node)
VarArgPN(const CallGraphNode *node, NodeID i)
Constructor.
static bool classof(const GenericPAGNodeTy *node)
virtual const SVFFunction * getFunction() const
static bool classof(const VarArgPN *)
VarArgPN(NodeID i)
Constructor to create empty VarArgPN (for SVFIRReader/deserialization)
for isBitcode
Definition BasicTypes.h:68
unsigned long long u64_t
Definition GeneralType.h:48
GenericNode< SVFVar, SVFStmt > GenericPAGNodeTy
u32_t NodeID
Definition GeneralType.h:55
s64_t APOffset
Definition GeneralType.h:60
std::ostream OutStream
Definition GeneralType.h:45
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74
signed long long s64_t
Definition GeneralType.h:49