Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVFVariables.h
Go to the documentation of this file.
1//===- SVFVariables.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 * Refactored on: Nov 30, 2024
29 * Author: Xiao Cheng, Yulei Sui
30 */
31
32#ifndef INCLUDE_SVFIR_SVFVARIABLE_H_
33#define INCLUDE_SVFIR_SVFVARIABLE_H_
34
35#include "Graphs/GenericGraph.h"
36#include "SVFIR/ObjTypeInfo.h"
37#include "SVFIR/SVFStatements.h"
38
39namespace SVF
40{
41
42class SVFVar;
43/*
44 * Program variables in SVFIR (based on PAG nodes)
45 * These represent variables in the program analysis graph
46 */
49{
50 friend class SVFIRWriter;
51 friend class SVFIRReader;
52 friend class SVFIRBuilder;
53 friend class IRGraph;
54 friend class SVFIR;
55 friend class VFG;
56
57public:
67 typedef GNodeK PNODEK;
69
70protected:
74
77
78
79public:
82
84 virtual ~SVFVar() {}
85
87 virtual inline bool isPointer() const
88 {
89 assert(type && "type is null?");
90 return type->isPointerTy();
91 }
92
95 {
96 return false;
97 }
98
100 virtual bool isIsolatedNode() const;
101
103 virtual const std::string getValueName() const = 0;
104
106 virtual inline const FunObjVar* getFunction() const
107 {
108 return nullptr;
109 }
110
112
117
122
123 inline bool hasIncomingEdges(SVFStmt::PEDGEK kind) const
124 {
125 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
126 if (it != InEdgeKindToSetMap.end())
127 return (!it->second.empty());
128 else
129 return false;
130 }
131
132 inline bool hasOutgoingEdges(SVFStmt::PEDGEK kind) const
133 {
134 SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
135 if (it != OutEdgeKindToSetMap.end())
136 return (!it->second.empty());
137 else
138 return false;
139 }
140
142 inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
143 {
144 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
145 assert(it!=InEdgeKindToSetMap.end() && "Edge kind not found");
146 return it->second.begin();
147 }
148
149 inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd(SVFStmt::PEDGEK kind) const
150 {
151 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
152 assert(it!=InEdgeKindToSetMap.end() && "Edge kind not found");
153 return it->second.end();
154 }
155
156 inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
157 {
158 SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
159 assert(it!=OutEdgeKindToSetMap.end() && "Edge kind not found");
160 return it->second.begin();
161 }
162
163 inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
164 {
165 SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
166 assert(it!=OutEdgeKindToSetMap.end() && "Edge kind not found");
167 return it->second.end();
168 }
170
172 static inline bool classof(const SVFVar *)
173 {
174 return true;
175 }
176
177 static inline bool classof(const GenericPAGNodeTy * node)
178 {
179 return isSVFVarKind(node->getNodeKind());
180 }
181
182 static inline bool classof(const SVFValue* node)
183 {
184 return isSVFVarKind(node->getNodeKind());
185 }
186
188 virtual bool ptrInUncalledFunction() const;
189
191 virtual bool isConstDataOrAggData() const
192 {
193 return false;
194 }
195
196
197private:
199
201 {
202 GEdgeKind kind = inEdge->getEdgeKind();
203 InEdgeKindToSetMap[kind].insert(inEdge);
205 }
206
208 {
209 GEdgeKind kind = outEdge->getEdgeKind();
210 OutEdgeKindToSetMap[kind].insert(outEdge);
212 }
213
215 inline bool hasIncomingVariantGepEdge() const
216 {
217 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(SVFStmt::Gep);
218 if (it != InEdgeKindToSetMap.end())
219 {
220 for(auto gep : it->second)
221 {
222 if(SVFUtil::cast<GepStmt>(gep)->isVariantFieldGep())
223 return true;
224 }
225 }
226 return false;
227 }
228
229public:
231 virtual const std::string toString() const;
232
234 void dump() const;
235
237 friend OutStream& operator<< (OutStream &o, const SVFVar &node)
238 {
239 o << node.toString();
240 return o;
241 }
242};
243
244
245
246/*
247 * Value (Pointer) variable
248 */
249class ValVar: public SVFVar
250{
251 friend class SVFIRWriter;
252 friend class SVFIRReader;
253
254private:
255 const ICFGNode* icfgNode; // icfgnode related to valvar
256protected:
259
260public:
262
263 static inline bool classof(const ValVar*)
264 {
265 return true;
266 }
267 static inline bool classof(const SVFVar* node)
268 {
269 return isValVarKinds(node->getNodeKind());
270 }
271 static inline bool classof(const GenericPAGNodeTy* node)
272 {
273 return isValVarKinds(node->getNodeKind());
274 }
275 static inline bool classof(const SVFValue* node)
276 {
277 return isValVarKinds(node->getNodeKind());
278 }
280
283 : SVFVar(i, svfType, ty), icfgNode(node)
284 {
285 }
287 inline const std::string getValueName() const
288 {
289 return getName();
290 }
291
292 const ICFGNode* getICFGNode() const
293 {
294 return icfgNode;
295 }
296
297 virtual const FunObjVar* getFunction() const;
298
299 virtual const std::string toString() const;
300};
301
302/*
303 * Memory Object variable
304 */
305class ObjVar: public SVFVar
306{
307 friend class SVFIRWriter;
308 friend class SVFIRReader;
309
310protected:
315 SVFVar(i, svfType, ty)
316 {
317 }
318public:
320
321 static inline bool classof(const ObjVar*)
322 {
323 return true;
324 }
325 static inline bool classof(const SVFVar* node)
326 {
327 return isObjVarKinds(node->getNodeKind());
328 }
329 static inline bool classof(const GenericPAGNodeTy* node)
330 {
331 return isObjVarKinds(node->getNodeKind());
332 }
333 static inline bool classof(const SVFValue* node)
334 {
335 return isObjVarKinds(node->getNodeKind());
336 }
338
340 virtual const std::string getValueName() const
341 {
342 return getName();
343 }
344
345 virtual const std::string toString() const;
346};
347
348
355class ArgValVar: public ValVar
356{
357 friend class SVFIRWriter;
358 friend class SVFIRReader;
359
360private:
363
364protected:
367
368public:
370
371 static inline bool classof(const ArgValVar*)
372 {
373 return true;
374 }
375 static inline bool classof(const ValVar* node)
376 {
377 return node->getNodeKind() == ArgValNode;
378 }
379 static inline bool classof(const SVFVar* node)
380 {
381 return node->getNodeKind() == ArgValNode;
382 }
383 static inline bool classof(const GenericPAGNodeTy* node)
384 {
385 return node->getNodeKind() == ArgValNode;
386 }
387 static inline bool classof(const SVFValue* node)
388 {
389 return node->getNodeKind() == ArgValNode;
390 }
392
394 ArgValVar(NodeID i, u32_t argNo, const ICFGNode* icn, const FunObjVar* callGraphNode,
395 const SVFType* svfType);
396
398 inline const std::string getValueName() const
399 {
400 return getName() + " (argument valvar)";
401 }
402
403 virtual const FunObjVar* getFunction() const;
404
405 const FunObjVar* getParent() const;
406
409 inline u32_t getArgNo() const
410 {
411 return argNo;
412 }
413
414 bool isArgOfUncalledFunction() const;
415
416 virtual bool isPointer() const;
417
418 virtual const std::string toString() const;
419};
420
421
422/*
423 * Gep Value (Pointer) variable, this variable can be dynamic generated for field sensitive analysis
424 * e.g. memcpy, temp gep value variable needs to be created
425 * Each Gep Value variable is connected to base value variable via gep edge
426 */
427class GepValVar: public ValVar
428{
429 friend class SVFIRWriter;
430 friend class SVFIRReader;
431
432private:
433 AccessPath ap; // AccessPath
434 const ValVar* base; // base node
436
439
440public:
442
443 static inline bool classof(const GepValVar *)
444 {
445 return true;
446 }
447 static inline bool classof(const ValVar * node)
448 {
449 return node->getNodeKind() == SVFVar::GepValNode;
450 }
451 static inline bool classof(const SVFVar *node)
452 {
453 return node->getNodeKind() == SVFVar::GepValNode;
454 }
455 static inline bool classof(const GenericPAGNodeTy *node)
456 {
457 return node->getNodeKind() == SVFVar::GepValNode;
458 }
459 static inline bool classof(const SVFValue* node)
460 {
461 return node->getNodeKind() == SVFVar::GepValNode;
462 }
464
466 GepValVar(const ValVar* baseNode, NodeID i, const AccessPath& ap,
467 const SVFType* ty, const ICFGNode* node);
468
471 {
473 }
474
476 inline const ValVar* getBaseNode(void) const
477 {
478 return base;
479 }
480
482 inline const std::string getValueName() const
483 {
484 return getName() + "_" +
485 std::to_string(getConstantFieldIdx());
486 }
487
488 virtual bool isPointer() const
489 {
490 return base->isPointer();
491 }
492
493 inline const SVFType* getType() const
494 {
495 return gepValType;
496 }
497
498 virtual const FunObjVar* getFunction() const
499 {
500 return base->getFunction();
501 }
502
503 virtual const std::string toString() const;
504
506 {
508 }
509 virtual inline bool ptrInUncalledFunction() const
510 {
511 return base->ptrInUncalledFunction();
512 }
513
514 virtual inline bool isConstDataOrAggData() const
515 {
516 return base->isConstDataOrAggData();
517 }
518};
519
520/*
521 * Base memory object variable (address-taken variables in LLVM-based languages)
522 */
523class BaseObjVar : public ObjVar
524{
525 friend class SVFIRWriter;
526 friend class SVFIRReader;
527 friend class SVFIRBuilder;
528private:
530
532
533protected:
536
537public:
539
540 static inline bool classof(const BaseObjVar*)
541 {
542 return true;
543 }
544 static inline bool classof(const ObjVar* node)
545 {
546 return isBaseObjVarKinds(node->getNodeKind());
547 }
548 static inline bool classof(const SVFVar* node)
549 {
550 return isBaseObjVarKinds(node->getNodeKind());
551 }
552 static inline bool classof(const GenericPAGNodeTy* node)
553 {
554 return isBaseObjVarKinds(node->getNodeKind());
555 }
556 static inline bool classof(const SVFValue* node)
557 {
558 return isBaseObjVarKinds(node->getNodeKind());
559 }
561
564 const SVFType* svfType, const ICFGNode* node, PNODEK ty = BaseObjNode)
565 : ObjVar(i, svfType, ty), typeInfo(ti), icfgNode(node)
566 {
567 }
568
569 virtual const BaseObjVar* getBaseMemObj() const
570 {
571 return this;
572 }
573
575 inline const ICFGNode* getICFGNode() const
576 {
577 return icfgNode;
578 }
579
581 inline const std::string getValueName() const
582 {
583 return getName() + " (base object)";
584 }
585
586 virtual const std::string toString() const;
587
589 inline NodeID getId() const
590 {
591 return id;
592 }
593
595 const SVFType* getType() const
596 {
597 return typeInfo->getType();
598 }
599
602 {
603 return typeInfo->getNumOfElements();
604 }
605
608 {
610 }
611
617
618
621 {
622 return getMaxFieldOffsetLimit() == 0;
623 }
624
630
631
637
639 bool isBlackHoleObj() const;
640
643 {
644 return typeInfo->getByteSizeOfObj();
645 }
646
649 {
651 }
652
653
655
656 bool isFunction() const
657 {
658 return typeInfo->isFunction();
659 }
660 bool isGlobalObj() const
661 {
662 return typeInfo->isGlobalObj();
663 }
664 bool isStaticObj() const
665 {
666 return typeInfo->isStaticObj();
667 }
668 bool isStack() const
669 {
670 return typeInfo->isStack();
671 }
672 bool isHeap() const
673 {
674 return typeInfo->isHeap();
675 }
676 bool isStruct() const
677 {
678 return typeInfo->isStruct();
679 }
680 bool isArray() const
681 {
682 return typeInfo->isArray();
683 }
684 bool isVarStruct() const
685 {
686 return typeInfo->isVarStruct();
687 }
688 bool isVarArray() const
689 {
690 return typeInfo->isVarArray();
691 }
692 bool isConstantStruct() const
693 {
694 return typeInfo->isConstantStruct();
695 }
696 bool isConstantArray() const
697 {
698 return typeInfo->isConstantArray();
699 }
701 {
703 }
704 virtual inline bool isConstDataOrAggData() const
705 {
707 }
709
711 void destroy()
712 {
713 delete typeInfo;
714 typeInfo = nullptr;
715 }
716
717 virtual const FunObjVar* getFunction() const;
718
719};
720
721
722/*
723 * Gep Obj variable, this is dynamic generated for field sensitive analysis
724 * Each gep obj variable is one field of a BaseObjVar (base)
725 */
726class GepObjVar: public ObjVar
727{
728 friend class SVFIRWriter;
729 friend class SVFIRReader;
730
731private:
733
735
737 // only for reading from file when we don't have BaseObjVar*
739
740public:
742
743 static inline bool classof(const GepObjVar*)
744 {
745 return true;
746 }
747 static inline bool classof(const ObjVar* node)
748 {
749 return node->getNodeKind() == SVFVar::GepObjNode;
750 }
751 static inline bool classof(const SVFVar* node)
752 {
753 return node->getNodeKind() == SVFVar::GepObjNode;
754 }
755 static inline bool classof(const GenericPAGNodeTy* node)
756 {
757 return node->getNodeKind() == SVFVar::GepObjNode;
758 }
759 static inline bool classof(const SVFValue* node)
760 {
761 return node->getNodeKind() == SVFVar::GepObjNode;
762 }
764
771
774 {
775 return apOffset;
776 }
777
779 inline NodeID getBaseNode(void) const
780 {
781 return base->getId();
782 }
783
784 inline const BaseObjVar* getBaseObj() const
785 {
786 return base;
787 }
788
790 inline virtual const SVFType* getType() const;
791
792
794 inline const std::string getValueName() const
795 {
796 return getName() + "_" + std::to_string(apOffset);
797 }
798
799 virtual const FunObjVar* getFunction() const
800 {
801 return base->getFunction();
802 }
803
804 virtual const std::string toString() const;
805
806 virtual inline bool ptrInUncalledFunction() const
807 {
808 return base->ptrInUncalledFunction();
809 }
810
811 virtual inline bool isConstDataOrAggData() const
812 {
813 return base->isConstDataOrAggData();
814 }
815
817 {
819 }
820
821 virtual bool isPointer() const
822 {
823 return base->isPointer();
824 }
825};
826
827
828
836{
837
838 friend class SVFIRWriter;
839 friend class SVFIRReader;
840
841protected:
843 HeapObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i, node, HeapObjNode) {}
844
845public:
847
848 static inline bool classof(const HeapObjVar*)
849 {
850 return true;
851 }
852 static inline bool classof(const BaseObjVar* node)
853 {
854 return node->getNodeKind() == HeapObjNode;
855 }
856 static inline bool classof(const ObjVar* node)
857 {
858 return node->getNodeKind() == HeapObjNode;
859 }
860 static inline bool classof(const SVFVar* node)
861 {
862 return node->getNodeKind() == HeapObjNode;
863 }
864 static inline bool classof(const GenericPAGNodeTy* node)
865 {
866 return node->getNodeKind() == HeapObjNode;
867 }
868 static inline bool classof(const SVFValue* node)
869 {
870 return node->getNodeKind() == HeapObjNode;
871 }
873
877 {
878 }
879
881 inline const std::string getValueName() const
882 {
883 return " (heap base object)";
884 }
885
886 virtual const std::string toString() const;
887};
888
889
899{
900
901 friend class SVFIRWriter;
902 friend class SVFIRReader;
903
904protected:
907
908public:
910
911 static inline bool classof(const StackObjVar*)
912 {
913 return true;
914 }
915 static inline bool classof(const BaseObjVar* node)
916 {
917 return node->getNodeKind() == StackObjNode;
918 }
919 static inline bool classof(const ObjVar* node)
920 {
921 return node->getNodeKind() == StackObjNode;
922 }
923 static inline bool classof(const SVFVar* node)
924 {
925 return node->getNodeKind() == StackObjNode;
926 }
927 static inline bool classof(const GenericPAGNodeTy* node)
928 {
929 return node->getNodeKind() == StackObjNode;
930 }
931 static inline bool classof(const SVFValue* node)
932 {
933 return node->getNodeKind() == StackObjNode;
934 }
936
940 {
941 }
942
944 inline const std::string getValueName() const
945 {
946 return " (stack base object)";
947 }
948
949 virtual const std::string toString() const;
950};
951
952
953class CallGraphNode;
954
955class FunObjVar : public BaseObjVar
956{
957 friend class SVFIRWriter;
958 friend class SVFIRReader;
959 friend class SVFIRBuilder;
960 friend class LLVMModuleSet;
961
962public:
966
967 typedef BasicBlockGraph::IDToNodeMapTy::const_iterator const_bb_iterator;
968
969
970private:
971 bool isDecl;
975 bool isNotRet;
981 std::vector<const ArgValVar*> allArgs;
983
984
985private:
987 FunObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i,node, FunObjNode) {}
988
989public:
991
992 static inline bool classof(const FunObjVar*)
993 {
994 return true;
995 }
996 static inline bool classof(const BaseObjVar* node)
997 {
998 return node->getNodeKind() == FunObjNode;
999 }
1000 static inline bool classof(const ObjVar* node)
1001 {
1002 return node->getNodeKind() == FunObjNode;
1003 }
1004 static inline bool classof(const SVFVar* node)
1005 {
1006 return node->getNodeKind() == FunObjNode;
1007 }
1008 static inline bool classof(const GenericPAGNodeTy* node)
1009 {
1010 return node->getNodeKind() == FunObjNode;
1011 }
1012 static inline bool classof(const SVFValue* node)
1013 {
1014 return node->getNodeKind() == FunObjNode;
1015 }
1017
1019 FunObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node);
1020
1021
1022 virtual ~FunObjVar()
1023 {
1024 delete loopAndDom;
1025 delete bbGraph;
1026 }
1027
1028 void initFunObjVar(bool decl, bool intrinc, bool addr, bool uncalled, bool notret, bool vararg, const SVFFunctionType *ft,
1030 const std::vector<const ArgValVar *> &allarg, const SVFBasicBlock *exit);
1031
1033 {
1034 realDefFun = real;
1035 }
1036
1037 virtual const FunObjVar*getFunction() const;
1038
1039 inline void addArgument(const ArgValVar *arg)
1040 {
1041 allArgs.push_back(arg);
1042 }
1043 inline bool isDeclaration() const
1044 {
1045 return isDecl;
1046 }
1047
1048 inline bool isIntrinsic() const
1049 {
1050 return intrinsic;
1051 }
1052
1053 inline bool hasAddressTaken() const
1054 {
1055 return isAddrTaken;
1056 }
1057
1058 inline bool isVarArg() const
1059 {
1060 return supVarArg;
1061 }
1062
1063 inline bool isUncalledFunction() const
1064 {
1065 return isUncalled;
1066 }
1067
1068 inline bool hasReturn() const
1069 {
1070 return !isNotRet;
1071 }
1072
1074 inline const SVFFunctionType* getFunctionType() const
1075 {
1076 return funcType;
1077 }
1078
1080 inline const SVFType* getReturnType() const
1081 {
1082 return funcType->getReturnType();
1083 }
1084
1086 {
1087 return loopAndDom;
1088 }
1089
1090 inline const std::vector<const SVFBasicBlock*>& getReachableBBs() const
1091 {
1092 return loopAndDom->getReachableBBs();
1093 }
1094
1095 inline void getExitBlocksOfLoop(const SVFBasicBlock* bb, BBList& exitbbs) const
1096 {
1098 }
1099
1100 inline bool hasLoopInfo(const SVFBasicBlock* bb) const
1101 {
1102 return loopAndDom->hasLoopInfo(bb);
1103 }
1104
1105 const LoopBBs& getLoopInfo(const SVFBasicBlock* bb) const
1106 {
1107 return loopAndDom->getLoopInfo(bb);
1108 }
1109
1110 inline const SVFBasicBlock* getLoopHeader(const BBList& lp) const
1111 {
1112 return loopAndDom->getLoopHeader(lp);
1113 }
1114
1115 inline bool loopContainsBB(const BBList& lp, const SVFBasicBlock* bb) const
1116 {
1117 return loopAndDom->loopContainsBB(lp,bb);
1118 }
1119
1121 {
1122 return loopAndDom->getDomTreeMap();
1123 }
1124
1126 {
1127 return loopAndDom->getDomFrontierMap();
1128 }
1129
1130 inline bool isLoopHeader(const SVFBasicBlock* bb) const
1131 {
1132 return loopAndDom->isLoopHeader(bb);
1133 }
1134
1135 inline bool dominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
1136 {
1138 }
1139
1140 inline bool postDominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
1141 {
1143 }
1144
1146 {
1147 if(realDefFun==nullptr)
1148 return this;
1149 return realDefFun;
1150 }
1151
1153 {
1154 this->bbGraph = graph;
1155 }
1156
1158 {
1159 return bbGraph;
1160 }
1161
1163 {
1164 return bbGraph;
1165 }
1166
1167 inline bool hasBasicBlock() const
1168 {
1169 return bbGraph && bbGraph->begin() != bbGraph->end();
1170 }
1171
1172 inline const SVFBasicBlock* getEntryBlock() const
1173 {
1174 assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1175 assert(bbGraph->begin()->second->getInEdges().size() == 0 && "the first basic block is not entry block");
1176 return bbGraph->begin()->second;
1177 }
1178
1179 inline const SVFBasicBlock* getExitBB() const
1180 {
1181 assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1182 assert(exitBlock && "must have an exitBlock");
1183 return exitBlock;
1184 }
1185
1187 {
1188 assert(!exitBlock && "have already set exit Basicblock!");
1189 exitBlock = bb;
1190 }
1191
1192
1193 u32_t inline arg_size() const
1194 {
1195 return allArgs.size();
1196 }
1197
1198 inline const ArgValVar* getArg(u32_t idx) const
1199 {
1200 assert (idx < allArgs.size() && "getArg() out of range!");
1201 return allArgs[idx];
1202 }
1203
1204 inline const SVFBasicBlock* front() const
1205 {
1206 return getEntryBlock();
1207 }
1208
1209 inline const SVFBasicBlock* back() const
1210 {
1211 assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1215 return std::prev(bbGraph->end())->second;
1216 }
1217
1219 {
1220 return bbGraph->begin();
1221 }
1222
1223 inline const_bb_iterator end() const
1224 {
1225 return bbGraph->end();
1226 }
1227
1228 virtual bool isIsolatedNode() const;
1229
1230 virtual const std::string toString() const;
1231};
1232class FunValVar : public ValVar
1233{
1234 friend class SVFIRWriter;
1235 friend class SVFIRReader;
1236private:
1238
1239public:
1241
1242 static inline bool classof(const FunValVar*)
1243 {
1244 return true;
1245 }
1246 static inline bool classof(const ValVar* node)
1247 {
1248 return node->getNodeKind() == FunValNode;
1249 }
1250 static inline bool classof(const SVFVar* node)
1251 {
1252 return node->getNodeKind() == FunValNode;
1253 }
1254 static inline bool classof(const GenericPAGNodeTy* node)
1255 {
1256 return node->getNodeKind() == FunValNode;
1257 }
1258 static inline bool classof(const SVFValue* node)
1259 {
1260 return node->getNodeKind() == FunValNode;
1261 }
1263
1264 inline virtual const FunObjVar* getFunction() const
1265 {
1266 return funObjVar->getFunction();
1267 }
1268
1270 FunValVar(NodeID i, const ICFGNode* icn, const FunObjVar* cgn, const SVFType* svfType);
1271
1272
1273 virtual bool isPointer() const
1274 {
1275 return true;
1276 }
1277
1278 virtual const std::string toString() const;
1279};
1280
1281
1282
1283class GlobalValVar : public ValVar
1284{
1285 friend class SVFIRWriter;
1286 friend class SVFIRReader;
1287
1288public:
1290
1291 static inline bool classof(const GlobalValVar*)
1292 {
1293 return true;
1294 }
1295 static inline bool classof(const ValVar* node)
1296 {
1297 return node->getNodeKind() == GlobalValNode;
1298 }
1299 static inline bool classof(const SVFVar* node)
1300 {
1301 return node->getNodeKind() == GlobalValNode;
1302 }
1303 static inline bool classof(const GenericPAGNodeTy* node)
1304 {
1305 return node->getNodeKind() == GlobalValNode;
1306 }
1307 static inline bool classof(const SVFValue* node)
1308 {
1309 return node->getNodeKind() == GlobalValNode;
1310 }
1312
1316 {
1317 type = svfType;
1318 }
1319
1320
1321 virtual const std::string toString() const;
1322};
1323
1325{
1326 friend class SVFIRWriter;
1327 friend class SVFIRReader;
1328
1329public:
1331
1332 static inline bool classof(const ConstAggValVar*)
1333 {
1334 return true;
1335 }
1336 static inline bool classof(const ValVar* node)
1337 {
1338 return node->getNodeKind() == ConstAggValNode;
1339 }
1340 static inline bool classof(const SVFVar* node)
1341 {
1342 return node->getNodeKind() == ConstAggValNode;
1343 }
1344 static inline bool classof(const GenericPAGNodeTy* node)
1345 {
1346 return node->getNodeKind() == ConstAggValNode;
1347 }
1348 static inline bool classof(const SVFValue* node)
1349 {
1350 return node->getNodeKind() == ConstAggValNode;
1351 }
1353
1357 {
1358 type = svfTy;
1359 }
1360
1361
1362 virtual bool isConstDataOrAggData() const
1363 {
1364 return true;
1365 }
1366
1368 {
1369 return true;
1370 }
1371
1372 virtual const std::string toString() const;
1373};
1374
1375
1377{
1378 friend class SVFIRWriter;
1379 friend class SVFIRReader;
1380
1381public:
1383
1384 static inline bool classof(const ConstDataValVar*)
1385 {
1386 return true;
1387 }
1388 static inline bool classof(const ValVar* node)
1389 {
1390 return isConstantDataValVar(node->getNodeKind());
1391 }
1392 static inline bool classof(const SVFVar* node)
1393 {
1394 return isConstantDataValVar(node->getNodeKind());
1395 }
1396 static inline bool classof(const GenericPAGNodeTy* node)
1397 {
1398 return isConstantDataValVar(node->getNodeKind());
1399 }
1400 static inline bool classof(const SVFValue* node)
1401 {
1402 return isConstantDataValVar(node->getNodeKind());
1403 }
1405
1409 : ValVar(i, svfType, icn, ty)
1410 {
1411
1412 }
1413
1414 virtual bool isConstDataOrAggData() const
1415 {
1416 return true;
1417 }
1418
1420 {
1421 return true;
1422 }
1423
1424 virtual const std::string toString() const;
1425};
1426
1428{
1429 friend class SVFIRWriter;
1430 friend class SVFIRReader;
1431
1432public:
1434
1435 static inline bool classof(const BlackHoleValVar*)
1436 {
1437 return true;
1438 }
1439 static inline bool classof(const ConstDataValVar* node)
1440 {
1441 return node->getNodeKind() == BlackHoleValNode;
1442 }
1443 static inline bool classof(const ValVar* node)
1444 {
1445 return node->getNodeKind() == BlackHoleValNode;
1446 }
1447 static inline bool classof(const SVFVar* node)
1448 {
1449 return node->getNodeKind() == BlackHoleValNode;
1450 }
1451 static inline bool classof(const GenericPAGNodeTy* node)
1452 {
1453 return node->getNodeKind() == BlackHoleValNode;
1454 }
1455 static inline bool classof(const SVFValue* node)
1456 {
1457 return node->getNodeKind() == BlackHoleValNode;
1458 }
1460
1467
1469 {
1470 return false;
1471 }
1472
1473 virtual const std::string toString() const
1474 {
1475 return "BlackHoleValVar";
1476 }
1477};
1478
1480{
1481 friend class SVFIRWriter;
1482 friend class SVFIRReader;
1483private:
1484 double dval;
1485
1486public:
1488
1489 static inline bool classof(const ConstFPValVar*)
1490 {
1491 return true;
1492 }
1493 static inline bool classof(const ConstDataValVar* node)
1494 {
1495 return node->getNodeKind() == ConstFPValNode;
1496 }
1497 static inline bool classof(const ValVar* node)
1498 {
1499 return node->getNodeKind() == ConstFPValNode;
1500 }
1501 static inline bool classof(const SVFVar* node)
1502 {
1503 return node->getNodeKind() == ConstFPValNode;
1504 }
1505 static inline bool classof(const GenericPAGNodeTy* node)
1506 {
1507 return node->getNodeKind() == ConstFPValNode;
1508 }
1509 static inline bool classof(const SVFValue* node)
1510 {
1511 return node->getNodeKind() == ConstFPValNode;
1512 }
1514
1515 inline double getFPValue() const
1516 {
1517 return dval;
1518 }
1519
1522 const ICFGNode* icn, const SVFType* svfType)
1524 {
1525 }
1526
1527 virtual const std::string toString() const;
1528};
1529
1531{
1532 friend class SVFIRWriter;
1533 friend class SVFIRReader;
1534private:
1537
1538public:
1540
1541 static inline bool classof(const ConstIntValVar*)
1542 {
1543 return true;
1544 }
1545 static inline bool classof(const ConstDataValVar* node)
1546 {
1547 return node->getNodeKind() == ConstIntValNode;
1548 }
1549 static inline bool classof(const ValVar* node)
1550 {
1551 return node->getNodeKind() == ConstIntValNode;
1552 }
1553 static inline bool classof(const SVFVar* node)
1554 {
1555 return node->getNodeKind() == ConstIntValNode;
1556 }
1557 static inline bool classof(const GenericPAGNodeTy* node)
1558 {
1559 return node->getNodeKind() == ConstIntValNode;
1560 }
1561 static inline bool classof(const SVFValue* node)
1562 {
1563 return node->getNodeKind() == ConstIntValNode;
1564 }
1566
1568 {
1569 return sval;
1570 }
1571
1572
1574 {
1575 return zval;
1576 }
1577
1584 virtual const std::string toString() const;
1585};
1586
1588{
1589 friend class SVFIRWriter;
1590 friend class SVFIRReader;
1591
1592public:
1594
1595 static inline bool classof(const ConstNullPtrValVar*)
1596 {
1597 return true;
1598 }
1599 static inline bool classof(const ConstDataValVar* node)
1600 {
1601 return node->getNodeKind() == ConstNullptrValNode;
1602 }
1603 static inline bool classof(const ValVar* node)
1604 {
1605 return node->getNodeKind() == ConstNullptrValNode;
1606 }
1607 static inline bool classof(const SVFVar* node)
1608 {
1609 return node->getNodeKind() == ConstNullptrValNode;
1610 }
1611 static inline bool classof(const GenericPAGNodeTy* node)
1612 {
1613 return node->getNodeKind() == ConstNullptrValNode;
1614 }
1615 static inline bool classof(const SVFValue* node)
1616 {
1617 return node->getNodeKind() == ConstNullptrValNode;
1618 }
1620
1627
1629 {
1630 return false;
1631 }
1632
1633 virtual const std::string toString() const;
1634};
1635
1637{
1638 friend class SVFIRWriter;
1639 friend class SVFIRReader;
1640
1641private:
1644
1645public:
1647
1648 static inline bool classof(const GlobalObjVar*)
1649 {
1650 return true;
1651 }
1652 static inline bool classof(const BaseObjVar* node)
1653 {
1654 return node->getNodeKind() == GlobalObjNode;
1655 }
1656 static inline bool classof(const ObjVar* node)
1657 {
1658 return node->getNodeKind() == GlobalObjNode;
1659 }
1660 static inline bool classof(const SVFVar* node)
1661 {
1662 return node->getNodeKind() == GlobalObjNode;
1663 }
1664 static inline bool classof(const GenericPAGNodeTy* node)
1665 {
1666 return node->getNodeKind() == GlobalObjNode;
1667 }
1668 static inline bool classof(const SVFValue* node)
1669 {
1670 return node->getNodeKind() == GlobalObjNode;
1671 }
1673
1677 {
1678
1679 }
1680
1681
1682 virtual const std::string toString() const;
1683};
1684
1686{
1687 friend class SVFIRWriter;
1688 friend class SVFIRReader;
1689
1690public:
1692
1693 static inline bool classof(const ConstAggObjVar*)
1694 {
1695 return true;
1696 }
1697 static inline bool classof(const BaseObjVar* node)
1698 {
1699 return node->getNodeKind() == ConstAggObjNode;
1700 }
1701
1702 static inline bool classof(const ObjVar* node)
1703 {
1704 return node->getNodeKind() == ConstAggObjNode;
1705 }
1706 static inline bool classof(const SVFVar* node)
1707 {
1708 return node->getNodeKind() == ConstAggObjNode;
1709 }
1710 static inline bool classof(const GenericPAGNodeTy* node)
1711 {
1712 return node->getNodeKind() == ConstAggObjNode;
1713 }
1714 static inline bool classof(const SVFValue* node)
1715 {
1716 return node->getNodeKind() == ConstAggObjNode;
1717 }
1719
1723 {
1724
1725 }
1726
1727 virtual bool isConstDataOrAggData() const
1728 {
1729 return true;
1730 }
1731
1733 {
1734 return true;
1735 }
1736
1737 virtual const std::string toString() const;
1738};
1739
1741{
1742 friend class SVFIRWriter;
1743 friend class SVFIRReader;
1744
1745protected:
1748
1749public:
1751 static inline bool classof(const ConstDataObjVar*)
1752 {
1753 return true;
1754 }
1755 static inline bool classof(const BaseObjVar* node)
1756 {
1757 return isConstantDataObjVarKinds(node->getNodeKind());
1758 }
1759 static inline bool classof(const SVFVar* node)
1760 {
1761 return isConstantDataObjVarKinds(node->getNodeKind());
1762 }
1763 static inline bool classof(const ObjVar* node)
1764 {
1765 return isConstantDataObjVarKinds(node->getNodeKind());
1766 }
1767 static inline bool classof(const GenericPAGNodeTy* node)
1768 {
1769 return isConstantDataObjVarKinds(node->getNodeKind());
1770 }
1771
1772 static inline bool classof(const SVFValue* node)
1773 {
1774 return isConstantDataObjVarKinds(node->getNodeKind());
1775 }
1777
1780 : BaseObjVar(i, ti, svfType, node, ty)
1781 {
1782 }
1783
1784 virtual bool isConstDataOrAggData() const
1785 {
1786 return true;
1787 }
1788
1790 {
1791 return true;
1792 }
1793
1794 virtual const std::string toString() const;
1795};
1796
1798{
1799 friend class SVFIRWriter;
1800 friend class SVFIRReader;
1801
1802private:
1805
1806private:
1807 float dval;
1808
1809public:
1811 static inline bool classof(const ConstFPObjVar*)
1812 {
1813 return true;
1814 }
1815 static inline bool classof(const ConstDataObjVar* node)
1816 {
1817 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1818 }
1819 static inline bool classof(const BaseObjVar* node)
1820 {
1821 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1822 }
1823
1824 static inline bool classof(const SVFVar* node)
1825 {
1826 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1827 }
1828
1829 static inline bool classof(const ObjVar* node)
1830 {
1831 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1832 }
1833
1834 static inline bool classof(const GenericPAGNodeTy* node)
1835 {
1836 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1837 }
1838
1839 static inline bool classof(const SVFValue* node)
1840 {
1841 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1842 }
1844
1848 {
1849 }
1850
1851 inline double getFPValue() const
1852 {
1853 return dval;
1854 }
1855
1856
1857 virtual const std::string toString() const;
1858};
1859
1861{
1862 friend class SVFIRWriter;
1863 friend class SVFIRReader;
1864
1865private:
1868
1869private:
1872
1873public:
1875 static inline bool classof(const ConstIntObjVar*)
1876 {
1877 return true;
1878 }
1879
1880 static inline bool classof(const ConstDataObjVar* node)
1881 {
1882 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1883 }
1884
1885 static inline bool classof(const BaseObjVar* node)
1886 {
1887 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1888 }
1889
1890 static inline bool classof(const SVFVar* node)
1891 {
1892 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1893 }
1894 static inline bool classof(const ObjVar* node)
1895 {
1896 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1897 }
1898 static inline bool classof(const GenericPAGNodeTy* node)
1899 {
1900 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1901 }
1902
1903 static inline bool classof(const SVFValue* node)
1904 {
1905 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1906 }
1907
1909 {
1910 return sval;
1911 }
1912
1913
1915 {
1916 return zval;
1917 }
1919
1925
1926
1927 virtual const std::string toString() const;
1928};
1929
1931{
1932 friend class SVFIRWriter;
1933 friend class SVFIRReader;
1934
1935private:
1938
1939public:
1941 static inline bool classof(const ConstNullPtrObjVar*)
1942 {
1943 return true;
1944 }
1945
1946 static inline bool classof(const ConstDataObjVar* node)
1947 {
1948 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1949 }
1950
1951 static inline bool classof(const BaseObjVar* node)
1952 {
1953 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1954 }
1955
1956 static inline bool classof(const SVFVar* node)
1957 {
1958 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1959 }
1960 static inline bool classof(const ObjVar* node)
1961 {
1962 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1963 }
1964 static inline bool classof(const GenericPAGNodeTy* node)
1965 {
1966 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1967 }
1968
1969 static inline bool classof(const SVFValue* node)
1970 {
1971 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1972 }
1974
1981 {
1982 return false;
1983 }
1984 virtual const std::string toString() const;
1985};
1986/*
1987 * Unique Return node of a procedure
1988 */
1989class RetValPN : public ValVar
1990{
1991 friend class SVFIRWriter;
1992 friend class SVFIRReader;
1993
1994private:
1996private:
1999
2000public:
2002 static inline bool classof(const RetValPN*)
2003 {
2004 return true;
2005 }
2006 static inline bool classof(const SVFVar* node)
2007 {
2008 return node->getNodeKind() == SVFVar::RetValNode;
2009 }
2010 static inline bool classof(const ValVar* node)
2011 {
2012 return node->getNodeKind() == SVFVar::RetValNode;
2013 }
2014 static inline bool classof(const GenericPAGNodeTy* node)
2015 {
2016 return node->getNodeKind() == SVFVar::RetValNode;
2017 }
2018 static inline bool classof(const SVFValue* node)
2019 {
2020 return node->getNodeKind() == SVFVar::RetValNode;
2021 }
2023
2024
2026 RetValPN(NodeID i, const FunObjVar* node, const SVFType* svfType, const ICFGNode* icn);
2027
2028 inline const FunObjVar* getCallGraphNode() const
2029 {
2030 return callGraphNode;
2031 }
2032
2033 virtual const FunObjVar* getFunction() const;
2034
2035 virtual bool isPointer() const;
2036
2038 const std::string getValueName() const;
2039
2040 virtual const std::string toString() const;
2041};
2042
2043/*
2044 * Unique vararg node of a procedure
2045 */
2046class VarArgValPN : public ValVar
2047{
2048 friend class SVFIRWriter;
2049 friend class SVFIRReader;
2050private:
2052
2053private:
2056
2057public:
2059 static inline bool classof(const VarArgValPN*)
2060 {
2061 return true;
2062 }
2063 static inline bool classof(const SVFVar* node)
2064 {
2065 return node->getNodeKind() == SVFVar::VarargValNode;
2066 }
2067 static inline bool classof(const ValVar* node)
2068 {
2069 return node->getNodeKind() == SVFVar::VarargValNode;
2070 }
2071 static inline bool classof(const GenericPAGNodeTy* node)
2072 {
2073 return node->getNodeKind() == SVFVar::VarargValNode;
2074 }
2075 static inline bool classof(const SVFValue* node)
2076 {
2077 return node->getNodeKind() == SVFVar::VarargValNode;
2078 }
2080
2082 VarArgValPN(NodeID i, const FunObjVar* node, const SVFType* svfType, const ICFGNode* icn)
2084 {
2085 }
2086
2087 virtual const FunObjVar* getFunction() const;
2088
2090 const std::string getValueName() const;
2091
2092 virtual bool isPointer() const
2093 {
2094 return true;
2095 }
2096 virtual const std::string toString() const;
2097};
2098
2099/*
2100 * Dummy variable without any LLVM value
2101 */
2102class DummyValVar: public ValVar
2103{
2104 friend class SVFIRWriter;
2105 friend class SVFIRReader;
2106
2107public:
2109 static inline bool classof(const DummyValVar*)
2110 {
2111 return true;
2112 }
2113 static inline bool classof(const SVFVar* node)
2114 {
2115 return node->getNodeKind() == SVFVar::DummyValNode;
2116 }
2117 static inline bool classof(const ValVar* node)
2118 {
2119 return node->getNodeKind() == SVFVar::DummyValNode;
2120 }
2121 static inline bool classof(const GenericPAGNodeTy* node)
2122 {
2123 return node->getNodeKind() == SVFVar::DummyValNode;
2124 }
2125 static inline bool classof(const SVFValue* node)
2126 {
2127 return node->getNodeKind() == SVFVar::DummyValNode;
2128 }
2130
2133 : ValVar(i, svfType, node, DummyValNode)
2134 {
2135 }
2136
2138 inline const std::string getValueName() const
2139 {
2140 return "dummyVal";
2141 }
2142
2143 virtual bool isPointer() const
2144 {
2145 return true;
2146 }
2147
2148 virtual const std::string toString() const;
2149};
2150
2151/*
2152 * Dummy object variable
2153 */
2155{
2156 friend class SVFIRWriter;
2157 friend class SVFIRReader;
2158
2159private:
2162
2163public:
2165 static inline bool classof(const DummyObjVar*)
2166 {
2167 return true;
2168 }
2169 static inline bool classof(const BaseObjVar* node)
2170 {
2171 return node->getNodeKind() == SVFVar::DummyObjNode;
2172 }
2173 static inline bool classof(const SVFVar* node)
2174 {
2175 return node->getNodeKind() == SVFVar::DummyObjNode;
2176 }
2177 static inline bool classof(const ObjVar* node)
2178 {
2179 return node->getNodeKind() == SVFVar::DummyObjNode;
2180 }
2181 static inline bool classof(const GenericPAGNodeTy* node)
2182 {
2183 return node->getNodeKind() == SVFVar::DummyObjNode;
2184 }
2185
2186 static inline bool classof(const SVFValue* node)
2187 {
2188 return node->getNodeKind() == SVFVar::DummyObjNode;
2189 }
2191
2197
2199 inline const std::string getValueName() const
2200 {
2201 return "dummyObj";
2202 }
2203
2204 virtual bool isPointer() const
2205 {
2206 return true;
2207 }
2208
2209 virtual const std::string toString() const;
2210};
2211
2212} // End namespace SVF
2213
2214#endif /* INCLUDE_SVFIR_SVFVARIABLE_H_ */
APOffset getConstantStructFldIdx() const
Get methods.
Definition AccessPath.h:99
Class representing a function argument variable in the SVFIR.
static bool classof(const SVFValue *node)
bool isArgOfUncalledFunction() const
u32_t getArgNo() const
const FunObjVar * cgNode
ArgValVar(NodeID i, PNODEK ty=ArgValNode)
Constructor to create function argument (for SVFIRReader/deserialization)
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFVar *node)
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
friend class SVFIRReader
virtual bool isPointer() const
Check if this variable represents a pointer.
const FunObjVar * getParent() const
friend class SVFIRWriter
static bool classof(const ValVar *node)
static bool classof(const ArgValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
const std::string getValueName() const
Return name of a LLVM value.
virtual const std::string toString() const
Get string representation.
bool isFunction() const
object attributes methods
void destroy()
Clean up memory.
bool isConstDataOrConstGlobal() const
u32_t getNumOfElements() const
Get the number of elements of this object.
const ICFGNode * icfgNode
virtual bool isConstDataOrAggData() const
Check if this variable represents constant/aggregate data.
bool isGlobalObj() const
bool isConstantStruct() const
bool isStack() const
void setNumOfElements(u32_t num)
Set the number of elements of this object.
void setFieldInsensitive()
Set the memory object to be field insensitive.
bool isHeap() const
bool isArray() const
bool isStaticObj() const
const std::string getValueName() const
Return name of a LLVM value.
virtual const std::string toString() const
Get string representation.
void setFieldSensitive()
Set the memory object to be field sensitive (up to max field limit)
static bool classof(const SVFValue *node)
bool isVarStruct() const
static bool classof(const ObjVar *node)
virtual const BaseObjVar * getBaseMemObj() const
NodeID getId() const
Get the memory object id.
u32_t getMaxFieldOffsetLimit() const
Get max field offset limit.
const ICFGNode * getICFGNode() const
Get the ICFGNode related to the creation of this object.
friend class SVFIRReader
bool isConstantByteSize() const
Check if byte size is a const value.
u32_t getByteSizeOfObj() const
Get the byte size of this object.
ObjTypeInfo * typeInfo
BaseObjVar(NodeID i, ObjTypeInfo *ti, const SVFType *svfType, const ICFGNode *node, PNODEK ty=BaseObjNode)
Constructor.
BaseObjVar(NodeID i, const ICFGNode *node, PNODEK ty=BaseObjNode)
ICFGNode related to the creation of this object.
bool isBlackHoleObj() const
Whether it is a black hole object.
friend class SVFIRWriter
bool isStruct() const
static bool classof(const BaseObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
bool isVarArray() const
static bool classof(const SVFVar *node)
bool isFieldInsensitive() const
Return true if its field limit is 0.
const SVFType * getType() const
Get obj type.
bool isConstantArray() const
static bool classof(const GenericPAGNodeTy *node)
virtual const std::string toString() const
Get string representation.
virtual bool isConstDataOrAggDataButNotNullPtr() const
Check if this variable represents constant data/metadata but not null pointer.
BlackHoleValVar(NodeID i, const SVFType *svfType, PNODEK ty=BlackHoleValNode)
Constructor.
static bool classof(const ValVar *node)
static bool classof(const GenericPAGNodeTy *node)
friend class SVFIRReader
static bool classof(const SVFVar *node)
static bool classof(const ConstDataValVar *node)
static bool classof(const BlackHoleValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
friend class SVFIRWriter
static bool classof(const SVFValue *node)
static bool classof(const BaseObjVar *node)
virtual const std::string toString() const
Get string representation.
static bool classof(const SVFVar *node)
virtual bool isConstDataOrAggData() const
Check if this variable represents constant/aggregate data.
static bool classof(const ObjVar *node)
static bool classof(const ConstAggObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const SVFValue *node)
static bool classof(const GenericPAGNodeTy *node)
friend class SVFIRReader
friend class SVFIRWriter
ConstAggObjVar(NodeID i, ObjTypeInfo *ti, const SVFType *svfType, const ICFGNode *node)
Constructor.
virtual bool isConstDataOrAggDataButNotNullPtr() const
Check if this variable represents constant data/metadata but not null pointer.
static bool classof(const GenericPAGNodeTy *node)
virtual bool isConstDataOrAggData() const
Check if this variable represents constant/aggregate data.
friend class SVFIRReader
static bool classof(const SVFVar *node)
static bool classof(const ValVar *node)
static bool classof(const ConstAggValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
virtual bool isConstDataOrAggDataButNotNullPtr() const
Check if this variable represents constant data/metadata but not null pointer.
friend class SVFIRWriter
virtual const std::string toString() const
Get string representation.
static bool classof(const SVFValue *node)
ConstAggValVar(NodeID i, const ICFGNode *icn, const SVFType *svfTy)
Constructor.
static bool classof(const ObjVar *node)
static bool classof(const SVFValue *node)
virtual const std::string toString() const
Get string representation.
static bool classof(const BaseObjVar *node)
virtual bool isConstDataOrAggDataButNotNullPtr() const
Check if this variable represents constant data/metadata but not null pointer.
static bool classof(const GenericPAGNodeTy *node)
friend class SVFIRReader
ConstDataObjVar(NodeID i, const ICFGNode *node)
Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
virtual bool isConstDataOrAggData() const
Check if this variable represents constant/aggregate data.
friend class SVFIRWriter
static bool classof(const ConstDataObjVar *)
static bool classof(const SVFVar *node)
ConstDataObjVar(NodeID i, ObjTypeInfo *ti, const SVFType *svfType, const ICFGNode *node, PNODEK ty=ConstDataObjNode)
Constructor.
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const ConstDataValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
virtual bool isConstDataOrAggDataButNotNullPtr() const
Check if this variable represents constant data/metadata but not null pointer.
static bool classof(const ValVar *node)
static bool classof(const SVFValue *node)
ConstDataValVar(NodeID i, const ICFGNode *icn, const SVFType *svfType, PNODEK ty=ConstDataValNode)
Constructor.
virtual const std::string toString() const
Get string representation.
friend class SVFIRReader
friend class SVFIRWriter
static bool classof(const SVFVar *node)
virtual bool isConstDataOrAggData() const
Check if this variable represents constant/aggregate data.
static bool classof(const ObjVar *node)
ConstFPObjVar(NodeID i, double dv, ObjTypeInfo *ti, const SVFType *svfType, const ICFGNode *node)
Constructor.
static bool classof(const BaseObjVar *node)
static bool classof(const ConstFPObjVar *)
virtual const std::string toString() const
Get string representation.
friend class SVFIRReader
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const ConstDataObjVar *node)
friend class SVFIRWriter
double getFPValue() const
static bool classof(const SVFValue *node)
ConstFPObjVar(NodeID i, const ICFGNode *node)
Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
static bool classof(const SVFVar *node)
virtual const std::string toString() const
Get string representation.
static bool classof(const ValVar *node)
static bool classof(const SVFValue *node)
static bool classof(const ConstDataValVar *node)
static bool classof(const SVFVar *node)
friend class SVFIRReader
static bool classof(const ConstFPValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const GenericPAGNodeTy *node)
double getFPValue() const
friend class SVFIRWriter
ConstFPValVar(NodeID i, double dv, const ICFGNode *icn, const SVFType *svfType)
Constructor.
ConstIntObjVar(NodeID i, s64_t sv, u64_t zv, ObjTypeInfo *ti, const SVFType *svfType, const ICFGNode *node)
Constructor.
virtual const std::string toString() const
Get string representation.
static bool classof(const SVFValue *node)
static bool classof(const SVFVar *node)
static bool classof(const ConstDataObjVar *node)
s64_t getSExtValue() const
static bool classof(const ConstIntObjVar *)
friend class SVFIRReader
static bool classof(const ObjVar *node)
u64_t getZExtValue() const
static bool classof(const GenericPAGNodeTy *node)
friend class SVFIRWriter
ConstIntObjVar(NodeID i, const ICFGNode *node)
Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
static bool classof(const BaseObjVar *node)
static bool classof(const ValVar *node)
u64_t getZExtValue() const
virtual const std::string toString() const
Get string representation.
static bool classof(const SVFValue *node)
s64_t getSExtValue() const
static bool classof(const ConstDataValVar *node)
friend class SVFIRReader
friend class SVFIRWriter
static bool classof(const ConstIntValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const SVFVar *node)
ConstIntValVar(NodeID i, s64_t sv, u64_t zv, const ICFGNode *icn, const SVFType *svfType)
Constructor.
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const BaseObjVar *node)
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const ConstNullPtrObjVar *)
static bool classof(const ConstDataObjVar *node)
static bool classof(const ObjVar *node)
static bool classof(const SVFVar *node)
virtual const std::string toString() const
Get string representation.
ConstNullPtrObjVar(NodeID i, ObjTypeInfo *ti, const SVFType *svfType, const ICFGNode *node)
Constructor.
static bool classof(const SVFValue *node)
ConstNullPtrObjVar(NodeID i, const ICFGNode *node)
Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
virtual bool isConstDataOrAggDataButNotNullPtr() const
Check if this variable represents constant data/metadata but not null pointer.
ConstNullPtrValVar(NodeID i, const ICFGNode *icn, const SVFType *svfType)
Constructor.
static bool classof(const ConstNullPtrValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const SVFValue *node)
virtual const std::string toString() const
Get string representation.
static bool classof(const SVFVar *node)
static bool classof(const GenericPAGNodeTy *node)
virtual bool isConstDataOrAggDataButNotNullPtr() const
Check if this variable represents constant data/metadata but not null pointer.
static bool classof(const ValVar *node)
static bool classof(const ConstDataValVar *node)
virtual const std::string toString() const
Get string representation.
virtual bool isPointer() const
Check if this variable represents a pointer.
static bool classof(const DummyObjVar *)
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFVar *node)
DummyObjVar(NodeID i, ObjTypeInfo *ti, const ICFGNode *node, const SVFType *svfType=SVFType::getSVFPtrType())
Constructor.
friend class SVFIRReader
DummyObjVar(NodeID i, const ICFGNode *node)
Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
static bool classof(const ObjVar *node)
friend class SVFIRWriter
static bool classof(const BaseObjVar *node)
static bool classof(const SVFValue *node)
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.
static bool classof(const ValVar *node)
virtual const std::string toString() const
Get string representation.
DummyValVar(NodeID i, const ICFGNode *node, const SVFType *svfType=SVFType::getSVFPtrType())
Constructor.
friend class SVFIRReader
virtual bool isPointer() const
Check if this variable represents a pointer.
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFVar *node)
friend class SVFIRWriter
static bool classof(const SVFValue *node)
BasicBlockGraph::IDToNodeMapTy::const_iterator const_bb_iterator
const BasicBlockGraph * getBasicBlockGraph() const
const ArgValVar * getArg(u32_t idx) const
virtual const std::string toString() const
Get string representation.
SVFLoopAndDomInfo::BBList BBList
BasicBlockGraph * getBasicBlockGraph()
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
virtual ~FunObjVar()
const SVFBasicBlock * getLoopHeader(const BBList &lp) const
u32_t arg_size() const
const Map< const SVFBasicBlock *, BBSet > & getDomFrontierMap() const
const FunObjVar * getDefFunForMultipleModule() const
void getExitBlocksOfLoop(const SVFBasicBlock *bb, BBList &exitbbs) const
virtual bool isIsolatedNode() const
Check if this node is isolated (no edges) in the SVFIR graph.
bool isAddrTaken
return true if this function is an intrinsic function (e.g., llvm.dbg), which does not reside in the ...
bool hasAddressTaken() const
const Map< const SVFBasicBlock *, BBSet > & getDomTreeMap() const
static bool classof(const SVFVar *node)
SVFLoopAndDomInfo::LoopBBs LoopBBs
bool isNotRet
return true if this function is never called
SVFLoopAndDomInfo * loopAndDom
FunctionType, which is different from the type (PointerType) of this SVF Function.
void addArgument(const ArgValVar *arg)
bool postDominate(const SVFBasicBlock *bbKey, const SVFBasicBlock *bbValue) const
const SVFType * getReturnType() const
Returns the FunctionType.
const LoopBBs & getLoopInfo(const SVFBasicBlock *bb) const
bool dominate(const SVFBasicBlock *bbKey, const SVFBasicBlock *bbValue) const
const_bb_iterator begin() const
FunObjVar(NodeID i, const ICFGNode *node)
a 'single' basic block having no successors and containing return instruction in a function
static bool classof(const BaseObjVar *node)
std::vector< const ArgValVar * > allArgs
the basic block graph of this function
const SVFBasicBlock * back() const
bool supVarArg
return true if this function never returns
const SVFBasicBlock * getEntryBlock() const
const SVFBasicBlock * exitBlock
all formal arguments of this function
SVFLoopAndDomInfo::BBSet BBSet
bool isUncalledFunction() const
static bool classof(const SVFValue *node)
friend class SVFIRReader
static bool classof(const GenericPAGNodeTy *node)
const SVFFunctionType * funcType
return true if this function supports variable arguments
const SVFFunctionType * getFunctionType() const
Returns the FunctionType.
bool isLoopHeader(const SVFBasicBlock *bb) const
bool intrinsic
return true if this function does not have a body
const SVFBasicBlock * front() const
static bool classof(const FunObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
const FunObjVar * realDefFun
the loop and dominate information
friend class SVFIRWriter
void setBasicBlockGraph(BasicBlockGraph *graph)
bool isUncalled
return true if this function is address-taken (for indirect call purposes)
bool isIntrinsic() const
const_bb_iterator end() const
bool loopContainsBB(const BBList &lp, const SVFBasicBlock *bb) const
void setExitBlock(SVFBasicBlock *bb)
SVFLoopAndDomInfo * getLoopAndDomInfo() const
bool isVarArg() const
static bool classof(const ObjVar *node)
void setRelDefFun(const FunObjVar *real)
void initFunObjVar(bool decl, bool intrinc, bool addr, bool uncalled, bool notret, bool vararg, const SVFFunctionType *ft, SVFLoopAndDomInfo *ld, const FunObjVar *real, BasicBlockGraph *bbg, const std::vector< const ArgValVar * > &allarg, const SVFBasicBlock *exit)
const std::vector< const SVFBasicBlock * > & getReachableBBs() const
const SVFBasicBlock * getExitBB() const
bool hasBasicBlock() const
BasicBlockGraph * bbGraph
the definition of a function across multiple modules
bool isDeclaration() const
bool hasReturn() const
bool hasLoopInfo(const SVFBasicBlock *bb) const
static bool classof(const FunValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const SVFValue *node)
virtual const std::string toString() const
Get string representation.
static bool classof(const SVFVar *node)
static bool classof(const GenericPAGNodeTy *node)
virtual bool isPointer() const
Check if this variable represents a pointer.
friend class SVFIRReader
static bool classof(const ValVar *node)
const FunObjVar * funObjVar
friend class SVFIRWriter
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
iterator begin()
Iterators.
bool addIncomingEdge(EdgeType *inEdge)
Add incoming and outgoing edges.
bool addOutgoingEdge(EdgeType *outEdge)
APOffset getConstantFieldIdx() const
offset of the mem object
const BaseObjVar * getBaseObj() const
virtual bool isConstDataOrAggDataButNotNullPtr() const
Check if this variable represents constant data/metadata but not null pointer.
const BaseObjVar * base
virtual bool isConstDataOrAggData() const
Check if this variable represents constant/aggregate data.
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.
const std::string getValueName() const
Return name of a LLVM value.
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
static bool classof(const SVFValue *node)
friend class SVFIRReader
virtual bool isPointer() const
Check if this variable represents a pointer.
virtual const std::string toString() const
Get string representation.
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)
friend class SVFIRWriter
static bool classof(const SVFVar *node)
virtual bool ptrInUncalledFunction() const
Check if this pointer is in an uncalled function.
GepObjVar(const BaseObjVar *baseObj, NodeID i, const APOffset &apOffset, PNODEK ty=GepObjNode)
Constructor.
APOffset apOffset
virtual const SVFType * getType() const
Return the type of this gep object.
const ValVar * getBaseNode(void) const
Return the base object from which this GEP node came from.
AccessPath ap
static bool classof(const GenericPAGNodeTy *node)
virtual bool isConstDataOrAggDataButNotNullPtr() const
Check if this variable represents constant data/metadata but not null pointer.
static bool classof(const SVFValue *node)
static bool classof(const GepValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
const SVFType * getType() const
const SVFType * gepValType
virtual bool ptrInUncalledFunction() const
Check if this pointer is in an uncalled function.
virtual bool isConstDataOrAggData() const
Check if this variable represents constant/aggregate data.
const ValVar * base
static bool classof(const SVFVar *node)
virtual bool isPointer() const
Check if this variable represents a pointer.
friend class SVFIRReader
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
GepValVar(NodeID i)
Constructor to create empty GeValVar (for SVFIRReader/deserialization)
friend class SVFIRWriter
virtual const std::string toString() const
Get string representation.
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)
GlobalObjVar(NodeID i, ObjTypeInfo *ti, const SVFType *svfType, const ICFGNode *node, PNODEK ty=GlobalObjNode)
Constructor.
static bool classof(const BaseObjVar *node)
static bool classof(const GenericPAGNodeTy *node)
friend class SVFIRReader
virtual const std::string toString() const
Get string representation.
static bool classof(const SVFVar *node)
static bool classof(const GlobalObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
friend class SVFIRWriter
static bool classof(const ObjVar *node)
static bool classof(const SVFValue *node)
GlobalObjVar(NodeID i, const ICFGNode *node)
Constructor to create empty ObjVar (for SVFIRReader/deserialization)
GlobalValVar(NodeID i, const ICFGNode *icn, const SVFType *svfType)
Constructor.
static bool classof(const GlobalValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
virtual const std::string toString() const
Get string representation.
static bool classof(const ValVar *node)
static bool classof(const GenericPAGNodeTy *node)
friend class SVFIRReader
static bool classof(const SVFValue *node)
friend class SVFIRWriter
static bool classof(const SVFVar *node)
Class representing a heap object variable in the SVFIR.
HeapObjVar(NodeID i, ObjTypeInfo *ti, const SVFType *svfType, const ICFGNode *node)
Constructor.
static bool classof(const HeapObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const SVFVar *node)
HeapObjVar(NodeID i, const ICFGNode *node)
Constructor to create heap object var.
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFValue *node)
const std::string getValueName() const
Return name of a LLVM value.
friend class SVFIRReader
static bool classof(const ObjVar *node)
virtual const std::string toString() const
Get string representation.
friend class SVFIRWriter
static bool classof(const BaseObjVar *node)
bool isConstantStruct()
bool isConstDataOrAggData()
u32_t getMaxFieldOffsetLimit()
Get max field offset limit.
bool isConstDataOrConstGlobal()
u32_t getNumOfElements() const
Get the number of elements of this object.
const SVFType * getType() const
Get LLVM type.
Definition ObjTypeInfo.h:98
bool isConstantByteSize() const
Check if byte size is a const value.
void setMaxFieldOffsetLimit(u32_t limit)
Get max field offset limit.
bool isFunction()
Object attributes.
u32_t getByteSizeOfObj() const
Get the byte size of this object.
void setNumOfElements(u32_t num)
Set the number of elements of this object.
ObjVar(NodeID i, PNODEK ty=ObjNode)
Constructor to create an empty ObjVar (for SVFIRReader/deserialization)
virtual const std::string toString() const
Get string representation.
static bool classof(const SVFValue *node)
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFVar *node)
friend class SVFIRReader
ObjVar(NodeID i, const SVFType *svfType, PNODEK ty=ObjNode)
Constructor.
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.
friend class SVFIRWriter
const FunObjVar * callGraphNode
static bool classof(const ValVar *node)
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFValue *node)
const FunObjVar * getCallGraphNode() const
virtual bool isPointer() const
Check if this variable represents a pointer.
static bool classof(const SVFVar *node)
friend class SVFIRReader
const std::string getValueName() const
Return name of a LLVM value.
friend class SVFIRWriter
RetValPN(NodeID i)
Constructor to create empty RetValPN (for SVFIRReader/deserialization)
virtual const std::string toString() const
Get string representation.
static bool classof(const RetValPN *)
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
const SVFType * getReturnType() const
Definition SVFType.h:344
const LoopBBs & getLoopInfo(const SVFBasicBlock *bb) const
Definition SVFValue.cpp:70
const Map< const SVFBasicBlock *, BBSet > & getDomFrontierMap() const
Map< const SVFBasicBlock *, BBSet > & getDomTreeMap()
std::vector< const SVFBasicBlock * > BBList
bool dominate(const SVFBasicBlock *bbKey, const SVFBasicBlock *bbValue) const
Definition SVFValue.cpp:96
bool isLoopHeader(const SVFBasicBlock *bb) const
Definition SVFValue.cpp:183
void getExitBlocksOfLoop(const SVFBasicBlock *bb, BBList &exitbbs) const
Definition SVFValue.cpp:77
const BBList & getReachableBBs() const
const SVFBasicBlock * getLoopHeader(const LoopBBs &lp) const
bool hasLoopInfo(const SVFBasicBlock *bb) const
Set< const SVFBasicBlock * > BBSet
bool loopContainsBB(const LoopBBs &lp, const SVFBasicBlock *bb) const
bool postDominate(const SVFBasicBlock *bbKey, const SVFBasicBlock *bbValue) const
Definition SVFValue.cpp:127
GenericNode< SVFVar, SVFStmt >::GEdgeSetTy SVFStmtSetTy
PAGEdgeToSetMapTy KindToSVFStmtMapTy
static SVFType * getSVFPtrType()
Definition SVFType.h:178
bool isPointerTy() const
Definition SVFType.h:254
@ ConstNullptrObjNode
Definition SVFValue.h:99
@ ConstNullptrValNode
Definition SVFValue.h:80
static bool isConstantDataValVar(GNodeK n)
Definition SVFValue.h:248
static bool isObjVarKinds(GNodeK n)
Definition SVFValue.h:256
static bool isBaseObjVarKinds(GNodeK n)
Definition SVFValue.h:264
GNodeK getNodeKind() const
Get node kind.
Definition SVFValue.h:166
NodeID id
Node ID.
Definition SVFValue.h:205
virtual const std::string & getName() const
Definition SVFValue.h:186
static bool isConstantDataObjVarKinds(GNodeK n)
Definition SVFValue.h:272
static bool isValVarKinds(GNodeK n)
Definition SVFValue.h:239
static bool isSVFVarKind(GNodeK n)
Definition SVFValue.h:230
const SVFType * type
SVF type.
Definition SVFValue.h:207
SVFStmt::SVFStmtSetTy & getOutgoingEdges(SVFStmt::PEDGEK kind)
SVFStmt::KindToSVFStmtMapTy InEdgeKindToSetMap
Maps tracking incoming and outgoing edges by kind.
static bool classof(const SVFValue *node)
void addOutEdge(SVFStmt *outEdge)
friend OutStream & operator<<(OutStream &o, const SVFVar &node)
Stream operator overload for output.
SVFStmt::KindToSVFStmtMapTy OutEdgeKindToSetMap
virtual bool isConstDataOrAggDataButNotNullPtr() const
Check if this variable represents constant data/metadata but not null pointer.
virtual bool isPointer() const
Check if this variable represents a pointer.
SVFVar(NodeID i, PNODEK k)
Empty constructor for deserialization.
virtual bool ptrInUncalledFunction() const
Check if this pointer is in an uncalled function.
virtual const std::string getValueName() const =0
Get string name of the represented LLVM value.
bool hasIncomingVariantGepEdge() const
Check for incoming variable field GEP edges.
bool hasIncomingEdges(SVFStmt::PEDGEK kind) const
SVFStmt::SVFStmtSetTy & getIncomingEdges(SVFStmt::PEDGEK kind)
Edge accessors and checkers.
GNodeK PNODEK
SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
Edge iterators.
void addInEdge(SVFStmt *inEdge)
Edge management methods.
friend class SVFIRReader
bool hasOutgoingEdges(SVFStmt::PEDGEK kind) const
SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
void dump() const
Debug dump to console.
SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
virtual ~SVFVar()
Virtual destructor.
friend class SVFIRWriter
static bool classof(const SVFVar *)
Type checking support for LLVM-style RTTI.
virtual bool isIsolatedNode() const
Check if this node is isolated (no edges) in the SVFIR graph.
virtual const std::string toString() const
Get string representation.
virtual bool isConstDataOrAggData() const
Check if this variable represents constant/aggregate data.
s64_t GEdgeKind
SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd(SVFStmt::PEDGEK kind) const
static bool classof(const GenericPAGNodeTy *node)
Represents a stack-allocated object variable in the SVFIR (SVF Intermediate Representation) @inherits...
const std::string getValueName() const
Return name of a LLVM value.
static bool classof(const SVFVar *node)
StackObjVar(NodeID i, ObjTypeInfo *ti, const SVFType *svfType, const ICFGNode *node)
Constructor.
static bool classof(const ObjVar *node)
static bool classof(const BaseObjVar *node)
static bool classof(const GenericPAGNodeTy *node)
friend class SVFIRReader
friend class SVFIRWriter
static bool classof(const SVFValue *node)
StackObjVar(NodeID i, const ICFGNode *node)
Constructor to create stack object var.
virtual const std::string toString() const
Get string representation.
static bool classof(const StackObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition VFG.h:51
const ICFGNode * getICFGNode() const
static bool classof(const GenericPAGNodeTy *node)
virtual const std::string toString() const
Get string representation.
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
ValVar(NodeID i, PNODEK ty=ValNode)
Constructor to create an empty ValVar (for SVFIRReader/deserialization)
static bool classof(const SVFVar *node)
friend class SVFIRReader
ValVar(NodeID i, const SVFType *svfType, const ICFGNode *node, PNODEK ty=ValNode)
Constructor.
friend class SVFIRWriter
static bool classof(const SVFValue *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.
virtual bool isPointer() const
Check if this variable represents a pointer.
VarArgValPN(NodeID i)
Constructor to create empty VarArgValPN (for SVFIRReader/deserialization)
VarArgValPN(NodeID i, const FunObjVar *node, const SVFType *svfType, const ICFGNode *icn)
Constructor.
static bool classof(const SVFValue *node)
static bool classof(const GenericPAGNodeTy *node)
virtual const std::string toString() const
Get string representation.
static bool classof(const VarArgValPN *)
static bool classof(const SVFVar *node)
const FunObjVar * callGraphNode
const std::string getValueName() const
Return name of a LLVM value.
friend class SVFIRReader
friend class SVFIRWriter
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
static bool classof(const ValVar *node)
for isBitcode
Definition BasicTypes.h:68
unsigned long long u64_t
Definition GeneralType.h:49
GenericNode< SVFVar, SVFStmt > GenericPAGNodeTy
u32_t NodeID
Definition GeneralType.h:56
s64_t APOffset
Definition GeneralType.h:60
std::ostream OutStream
Definition GeneralType.h:46
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74
unsigned u32_t
Definition GeneralType.h:47
signed long long s64_t
Definition GeneralType.h:50