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
51 friend class SVFIRBuilder;
52 friend class IRGraph;
53 friend class SVFIR;
54 friend class VFG;
55 friend class GraphDBClient;
56
57public:
67 typedef GNodeK PNODEK;
69
70protected:
74
76 {
77 return InEdgeKindToSetMap;
78 }
79
80
85
86
87public:
90
92 virtual ~SVFVar() {}
93
95 virtual inline bool isPointer() const
96 {
97 assert(type && "type is null?");
98 return type->isPointerTy();
99 }
100
103 {
104 return false;
105 }
106
108 virtual bool isIsolatedNode() const;
109
111 virtual const std::string getValueName() const = 0;
112
114 virtual inline const FunObjVar* getFunction() const
115 {
116 return nullptr;
117 }
118
120
125
130
131 inline bool hasIncomingEdges(SVFStmt::PEDGEK kind) const
132 {
133 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
134 if (it != InEdgeKindToSetMap.end())
135 return (!it->second.empty());
136 else
137 return false;
138 }
139
140 inline bool hasOutgoingEdges(SVFStmt::PEDGEK kind) const
141 {
142 SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
143 if (it != OutEdgeKindToSetMap.end())
144 return (!it->second.empty());
145 else
146 return false;
147 }
148
150 inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
151 {
152 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
153 assert(it!=InEdgeKindToSetMap.end() && "Edge kind not found");
154 return it->second.begin();
155 }
156
157 inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd(SVFStmt::PEDGEK kind) const
158 {
159 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
160 assert(it!=InEdgeKindToSetMap.end() && "Edge kind not found");
161 return it->second.end();
162 }
163
164 inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
165 {
166 SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
167 assert(it!=OutEdgeKindToSetMap.end() && "Edge kind not found");
168 return it->second.begin();
169 }
170
171 inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
172 {
173 SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
174 assert(it!=OutEdgeKindToSetMap.end() && "Edge kind not found");
175 return it->second.end();
176 }
178
180 static inline bool classof(const SVFVar *)
181 {
182 return true;
183 }
184
185 static inline bool classof(const GenericPAGNodeTy * node)
186 {
187 return isSVFVarKind(node->getNodeKind());
188 }
189
190 static inline bool classof(const SVFValue* node)
191 {
192 return isSVFVarKind(node->getNodeKind());
193 }
194
196 virtual bool ptrInUncalledFunction() const;
197
199 virtual bool isConstDataOrAggData() const
200 {
201 return false;
202 }
203
204
205private:
207
209 {
210 GEdgeKind kind = inEdge->getEdgeKind();
211 InEdgeKindToSetMap[kind].insert(inEdge);
213 }
214
216 {
217 GEdgeKind kind = outEdge->getEdgeKind();
218 OutEdgeKindToSetMap[kind].insert(outEdge);
220 }
221
223 inline bool hasIncomingVariantGepEdge() const
224 {
225 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(SVFStmt::Gep);
226 if (it != InEdgeKindToSetMap.end())
227 {
228 for(auto gep : it->second)
229 {
230 if(SVFUtil::cast<GepStmt>(gep)->isVariantFieldGep())
231 return true;
232 }
233 }
234 return false;
235 }
236
237public:
239 virtual const std::string toString() const;
240
242 void dump() const;
243
245 friend OutStream& operator<< (OutStream &o, const SVFVar &node)
246 {
247 o << node.toString();
248 return o;
249 }
250};
251
252
253
254/*
255 * Value (Pointer) variable
256 */
257class ValVar: public SVFVar
258{
259 friend class GraphDBClient;
260
261private:
262 const ICFGNode* icfgNode; // icfgnode related to valvar
263
264public:
266
267 static inline bool classof(const ValVar*)
268 {
269 return true;
270 }
271 static inline bool classof(const SVFVar* node)
272 {
273 return isValVarKinds(node->getNodeKind());
274 }
275 static inline bool classof(const GenericPAGNodeTy* node)
276 {
277 return isValVarKinds(node->getNodeKind());
278 }
279 static inline bool classof(const SVFValue* node)
280 {
281 return isValVarKinds(node->getNodeKind());
282 }
284
287 : SVFVar(i, svfType, ty), icfgNode(node)
288 {
289 }
291 inline const std::string getValueName() const
292 {
293 return getName();
294 }
295
296 const ICFGNode* getICFGNode() const
297 {
298 return icfgNode;
299 }
300
301 virtual const FunObjVar* getFunction() const;
302
303 virtual const std::string toString() const;
304
305 std::string getValVarNodeFieldsStmt() const;
306
307};
308
309/*
310 * Memory Object variable
311 */
312class ObjVar: public SVFVar
313{
314 friend class GraphDBClient;
315
316protected:
319 SVFVar(i, svfType, ty)
320 {
321 }
322public:
324
325 static inline bool classof(const ObjVar*)
326 {
327 return true;
328 }
329 static inline bool classof(const SVFVar* node)
330 {
331 return isObjVarKinds(node->getNodeKind());
332 }
333 static inline bool classof(const GenericPAGNodeTy* node)
334 {
335 return isObjVarKinds(node->getNodeKind());
336 }
337 static inline bool classof(const SVFValue* node)
338 {
339 return isObjVarKinds(node->getNodeKind());
340 }
342
344 virtual const std::string getValueName() const
345 {
346 return getName();
347 }
348
349 virtual const std::string toString() const;
350
351 std::string getObjVarNodeFieldsStmt() const;
352
353};
354
355
362class ArgValVar: public ValVar
363{
364 friend class GraphDBClient;
365
366private:
369
370public:
372
373 static inline bool classof(const ArgValVar*)
374 {
375 return true;
376 }
377 static inline bool classof(const ValVar* node)
378 {
379 return node->getNodeKind() == ArgValNode;
380 }
381 static inline bool classof(const SVFVar* node)
382 {
383 return node->getNodeKind() == ArgValNode;
384 }
385 static inline bool classof(const GenericPAGNodeTy* node)
386 {
387 return node->getNodeKind() == ArgValNode;
388 }
389 static inline bool classof(const SVFValue* node)
390 {
391 return node->getNodeKind() == ArgValNode;
392 }
394
396 ArgValVar(NodeID i, u32_t argNo, const ICFGNode* icn, const FunObjVar* callGraphNode,
397 const SVFType* svfType);
398
400 inline const std::string getValueName() const
401 {
402 return getName() + " (argument valvar)";
403 }
404
405 inline void addCGNodeFromDB(const FunObjVar* cgNode)
406 {
407 this->cgNode = cgNode;
408 }
409
410 virtual const FunObjVar* getFunction() const;
411
412 const FunObjVar* getParent() const;
413
416 inline u32_t getArgNo() const
417 {
418 return argNo;
419 }
420
421 bool isArgOfUncalledFunction() const;
422
423 virtual bool isPointer() const;
424
425 virtual const std::string toString() const;
426};
427
428
429/*
430 * Gep Value (Pointer) variable, this variable can be dynamic generated for field sensitive analysis
431 * e.g. memcpy, temp gep value variable needs to be created
432 * Each Gep Value variable is connected to base value variable via gep edge
433 */
434class GepValVar: public ValVar
435{
436 friend class GraphDBClient;
437
438private:
439 AccessPath ap; // AccessPath
440 const ValVar* base; // base node
443
444
445public:
447
448 static inline bool classof(const GepValVar *)
449 {
450 return true;
451 }
452 static inline bool classof(const ValVar * node)
453 {
454 return node->getNodeKind() == SVFVar::GepValNode;
455 }
456 static inline bool classof(const SVFVar *node)
457 {
458 return node->getNodeKind() == SVFVar::GepValNode;
459 }
460 static inline bool classof(const GenericPAGNodeTy *node)
461 {
462 return node->getNodeKind() == SVFVar::GepValNode;
463 }
464 static inline bool classof(const SVFValue* node)
465 {
466 return node->getNodeKind() == SVFVar::GepValNode;
467 }
468
469 inline const AccessPath& getAccessPath() const
470 {
471 return ap;
472 }
473
474 inline const void setAccessPath(const AccessPath* ap)
475 {
476 this->ap = *ap;
477 }
479
481 GepValVar(const ValVar* baseNode, NodeID i, const AccessPath& ap,
482 const SVFType* ty, const ICFGNode* node);
483
486 {
488 }
489
491 inline const ValVar* getBaseNode(void) const
492 {
493 return base;
494 }
495 inline void setBaseNode(const ValVar* baseNode)
496 {
497 base = baseNode;
498 }
499
501 inline const std::string getValueName() const
502 {
503 return getName() + "_" +
504 std::to_string(getConstantFieldIdx());
505 }
506
507 virtual bool isPointer() const
508 {
509 return base->isPointer();
510 }
511
512 inline const SVFType* getType() const
513 {
514 return gepValType;
515 }
516
517 virtual const FunObjVar* getFunction() const
518 {
519 return base->getFunction();
520 }
521
522 virtual const std::string toString() const;
523
525 {
527 }
528 virtual inline bool ptrInUncalledFunction() const
529 {
530 return base->ptrInUncalledFunction();
531 }
532
533 virtual inline bool isConstDataOrAggData() const
534 {
535 return base->isConstDataOrAggData();
536 }
537
540 {
541 return llvmVarID;
542 }
543
545 inline void setLLVMVarInstID(NodeID id)
546 {
547 llvmVarID = id;
548 }
549};
550
551/*
552 * Base memory object variable (address-taken variables in LLVM-based languages)
553 */
554class BaseObjVar : public ObjVar
555{
556 friend class SVFIRBuilder;
557 friend class GraphDBClient;
558
559private:
561
563
564public:
566
567 static inline bool classof(const BaseObjVar*)
568 {
569 return true;
570 }
571 static inline bool classof(const ObjVar* node)
572 {
573 return isBaseObjVarKinds(node->getNodeKind());
574 }
575 static inline bool classof(const SVFVar* node)
576 {
577 return isBaseObjVarKinds(node->getNodeKind());
578 }
579 static inline bool classof(const GenericPAGNodeTy* node)
580 {
581 return isBaseObjVarKinds(node->getNodeKind());
582 }
583 static inline bool classof(const SVFValue* node)
584 {
585 return isBaseObjVarKinds(node->getNodeKind());
586 }
588
591 : ObjVar(i, ti->getType(), ty), typeInfo(ti), icfgNode(node)
592 {
593 }
594
595 virtual const BaseObjVar* getBaseMemObj() const
596 {
597 return this;
598 }
599
600 inline const ObjTypeInfo* getTypeInfo() const
601 {
602 return typeInfo;
603 }
605 {
606 return typeInfo;
607 }
608
610 inline const ICFGNode* getICFGNode() const
611 {
612 return icfgNode;
613 }
614
616 inline const std::string getValueName() const
617 {
618 return getName() + " (base object)";
619 }
620
621 virtual const std::string toString() const;
622
624 inline NodeID getId() const
625 {
626 return id;
627 }
628
630 const SVFType* getType() const
631 {
632 return typeInfo->getType();
633 }
634
637 {
638 return typeInfo->getNumOfElements();
639 }
640
643 {
645 }
646
652
653
656 {
657 return getMaxFieldOffsetLimit() == 0;
658 }
659
665
666
672
674 bool isBlackHoleObj() const;
675
678 {
679 return typeInfo->getByteSizeOfObj();
680 }
681
684 {
686 }
687
688
690
691 bool isFunction() const
692 {
693 return typeInfo->isFunction();
694 }
695 bool isGlobalObj() const
696 {
697 return typeInfo->isGlobalObj();
698 }
699 bool isStaticObj() const
700 {
701 return typeInfo->isStaticObj();
702 }
703 bool isStack() const
704 {
705 return typeInfo->isStack();
706 }
707 bool isHeap() const
708 {
709 return typeInfo->isHeap();
710 }
711 bool isStruct() const
712 {
713 return typeInfo->isStruct();
714 }
715 bool isArray() const
716 {
717 return typeInfo->isArray();
718 }
719 bool isVarStruct() const
720 {
721 return typeInfo->isVarStruct();
722 }
723 bool isVarArray() const
724 {
725 return typeInfo->isVarArray();
726 }
727 bool isConstantStruct() const
728 {
729 return typeInfo->isConstantStruct();
730 }
731 bool isConstantArray() const
732 {
733 return typeInfo->isConstantArray();
734 }
736 {
738 }
739 virtual inline bool isConstDataOrAggData() const
740 {
742 }
744
746 void destroy()
747 {
748 delete typeInfo;
749 typeInfo = nullptr;
750 }
751
752 virtual const FunObjVar* getFunction() const;
753
754};
755
756
757/*
758 * Gep Obj variable, this is dynamic generated for field sensitive analysis
759 * Each gep obj variable is one field of a BaseObjVar (base)
760 */
761class GepObjVar: public ObjVar
762{
763 friend class GraphDBClient;
764
765
766private:
768
770
771public:
773
774 static inline bool classof(const GepObjVar*)
775 {
776 return true;
777 }
778 static inline bool classof(const ObjVar* node)
779 {
780 return node->getNodeKind() == SVFVar::GepObjNode;
781 }
782 static inline bool classof(const SVFVar* node)
783 {
784 return node->getNodeKind() == SVFVar::GepObjNode;
785 }
786 static inline bool classof(const GenericPAGNodeTy* node)
787 {
788 return node->getNodeKind() == SVFVar::GepObjNode;
789 }
790 static inline bool classof(const SVFValue* node)
791 {
792 return node->getNodeKind() == SVFVar::GepObjNode;
793 }
795
802
805 {
806 return apOffset;
807 }
808
810 inline NodeID getBaseNode(void) const
811 {
812 return base->getId();
813 }
814
815 inline const BaseObjVar* getBaseObj() const
816 {
817 return base;
818 }
819
821 inline virtual const SVFType* getType() const;
822
823
825 inline const std::string getValueName() const
826 {
827 return getName() + "_" + std::to_string(apOffset);
828 }
829
830 virtual const FunObjVar* getFunction() const
831 {
832 return base->getFunction();
833 }
834
835 virtual const std::string toString() const;
836
837 virtual inline bool ptrInUncalledFunction() const
838 {
839 return base->ptrInUncalledFunction();
840 }
841
842 virtual inline bool isConstDataOrAggData() const
843 {
844 return base->isConstDataOrAggData();
845 }
846
848 {
850 }
851
852 virtual bool isPointer() const
853 {
854 return base->isPointer();
855 }
856};
857
858
859
867{
868
869 friend class GraphDBClient;
870
871public:
873
874 static inline bool classof(const HeapObjVar*)
875 {
876 return true;
877 }
878 static inline bool classof(const BaseObjVar* node)
879 {
880 return node->getNodeKind() == HeapObjNode;
881 }
882 static inline bool classof(const ObjVar* node)
883 {
884 return node->getNodeKind() == HeapObjNode;
885 }
886 static inline bool classof(const SVFVar* node)
887 {
888 return node->getNodeKind() == HeapObjNode;
889 }
890 static inline bool classof(const GenericPAGNodeTy* node)
891 {
892 return node->getNodeKind() == HeapObjNode;
893 }
894 static inline bool classof(const SVFValue* node)
895 {
896 return node->getNodeKind() == HeapObjNode;
897 }
899
902 BaseObjVar(i, ti, node, HeapObjNode)
903 {
904 }
905
907 inline const std::string getValueName() const
908 {
909 return " (heap base object)";
910 }
911
912 virtual const std::string toString() const;
913};
914
915
925{
926
927 friend class GraphDBClient;
928
929
930public:
932
933 static inline bool classof(const StackObjVar*)
934 {
935 return true;
936 }
937 static inline bool classof(const BaseObjVar* node)
938 {
939 return node->getNodeKind() == StackObjNode;
940 }
941 static inline bool classof(const ObjVar* node)
942 {
943 return node->getNodeKind() == StackObjNode;
944 }
945 static inline bool classof(const SVFVar* node)
946 {
947 return node->getNodeKind() == StackObjNode;
948 }
949 static inline bool classof(const GenericPAGNodeTy* node)
950 {
951 return node->getNodeKind() == StackObjNode;
952 }
953 static inline bool classof(const SVFValue* node)
954 {
955 return node->getNodeKind() == StackObjNode;
956 }
958
961 BaseObjVar(i, ti, node, StackObjNode)
962 {
963 }
964
966 inline const std::string getValueName() const
967 {
968 return " (stack base object)";
969 }
970
971 virtual const std::string toString() const;
972};
973
974
975class CallGraphNode;
976
977class FunObjVar : public BaseObjVar
978{
979 friend class SVFIRBuilder;
980 friend class LLVMModuleSet;
981 friend class GraphDBClient;
982
983protected:
984
986 {
987 exitBlock = bb;
988 }
989
991 {
992 loopAndDom = ld;
993 }
994 inline bool getIsNotRet() const
995 {
996 return isNotRet;
997 }
998 inline const std::vector<const ArgValVar*> &getArgs() const
999 {
1000 return allArgs;
1001 }
1002
1003public:
1007
1008 typedef BasicBlockGraph::IDToNodeMapTy::const_iterator const_bb_iterator;
1009
1010
1011private:
1012 bool isDecl;
1022 std::vector<const ArgValVar*> allArgs;
1024
1025
1026public:
1028
1029 static inline bool classof(const FunObjVar*)
1030 {
1031 return true;
1032 }
1033 static inline bool classof(const BaseObjVar* node)
1034 {
1035 return node->getNodeKind() == FunObjNode;
1036 }
1037 static inline bool classof(const ObjVar* node)
1038 {
1039 return node->getNodeKind() == FunObjNode;
1040 }
1041 static inline bool classof(const SVFVar* node)
1042 {
1043 return node->getNodeKind() == FunObjNode;
1044 }
1045 static inline bool classof(const GenericPAGNodeTy* node)
1046 {
1047 return node->getNodeKind() == FunObjNode;
1048 }
1049 static inline bool classof(const SVFValue* node)
1050 {
1051 return node->getNodeKind() == FunObjNode;
1052 }
1054
1056 FunObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node);
1057
1058
1059 virtual ~FunObjVar()
1060 {
1061 delete loopAndDom;
1062 delete bbGraph;
1063 }
1064
1065 void initFunObjVar(bool decl, bool intrinc, bool addr, bool uncalled, bool notret, bool vararg, const SVFFunctionType *ft,
1067 const std::vector<const ArgValVar *> &allarg, const SVFBasicBlock *exit);
1068
1070 {
1071 realDefFun = real;
1072 }
1073
1074 virtual const FunObjVar*getFunction() const;
1075
1076 inline void addArgument(const ArgValVar *arg)
1077 {
1078 allArgs.push_back(arg);
1079 }
1080 inline bool isDeclaration() const
1081 {
1082 return isDecl;
1083 }
1084
1085 inline bool isIntrinsic() const
1086 {
1087 return intrinsic;
1088 }
1089
1090 inline bool hasAddressTaken() const
1091 {
1092 return isAddrTaken;
1093 }
1094
1095 inline bool isVarArg() const
1096 {
1097 return supVarArg;
1098 }
1099
1100 inline bool isUncalledFunction() const
1101 {
1102 return isUncalled;
1103 }
1104
1105 inline bool hasReturn() const
1106 {
1107 return !isNotRet;
1108 }
1109
1111 inline const SVFFunctionType* getFunctionType() const
1112 {
1113 return funcType;
1114 }
1115
1117 inline const SVFType* getReturnType() const
1118 {
1119 return funcType->getReturnType();
1120 }
1121
1123 {
1124 return loopAndDom;
1125 }
1126
1127 inline const std::vector<const SVFBasicBlock*>& getReachableBBs() const
1128 {
1129 return loopAndDom->getReachableBBs();
1130 }
1131
1132 inline void getExitBlocksOfLoop(const SVFBasicBlock* bb, BBList& exitbbs) const
1133 {
1135 }
1136
1137 inline bool hasLoopInfo(const SVFBasicBlock* bb) const
1138 {
1139 return loopAndDom->hasLoopInfo(bb);
1140 }
1141
1142 const LoopBBs& getLoopInfo(const SVFBasicBlock* bb) const
1143 {
1144 return loopAndDom->getLoopInfo(bb);
1145 }
1146
1147 inline const SVFBasicBlock* getLoopHeader(const BBList& lp) const
1148 {
1149 return loopAndDom->getLoopHeader(lp);
1150 }
1151
1152 inline bool loopContainsBB(const BBList& lp, const SVFBasicBlock* bb) const
1153 {
1154 return loopAndDom->loopContainsBB(lp,bb);
1155 }
1156
1158 {
1159 return loopAndDom->getDomTreeMap();
1160 }
1161
1163 {
1164 return loopAndDom->getDomFrontierMap();
1165 }
1166
1167 inline bool isLoopHeader(const SVFBasicBlock* bb) const
1168 {
1169 return loopAndDom->isLoopHeader(bb);
1170 }
1171
1172 inline bool dominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
1173 {
1175 }
1176
1177 inline bool postDominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
1178 {
1180 }
1181
1183 {
1184 if(realDefFun==nullptr)
1185 return this;
1186 return realDefFun;
1187 }
1188
1190 {
1191 this->bbGraph = graph;
1192 }
1193
1195 {
1196 return bbGraph;
1197 }
1198
1200 {
1201 return bbGraph;
1202 }
1203
1204 inline bool hasBasicBlock() const
1205 {
1206 return bbGraph && bbGraph->begin() != bbGraph->end();
1207 }
1208
1209 inline const SVFBasicBlock* getEntryBlock() const
1210 {
1211 assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1212 assert(bbGraph->begin()->second->getInEdges().size() == 0 && "the first basic block is not entry block");
1213 return bbGraph->begin()->second;
1214 }
1215
1216 inline const SVFBasicBlock* getExitBB() const
1217 {
1218 assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1219 assert(exitBlock && "must have an exitBlock");
1220 return exitBlock;
1221 }
1222
1224 {
1225 assert(!exitBlock && "have already set exit Basicblock!");
1226 exitBlock = bb;
1227 }
1228
1229
1230 u32_t inline arg_size() const
1231 {
1232 return allArgs.size();
1233 }
1234
1235 inline const ArgValVar* getArg(u32_t idx) const
1236 {
1237 assert (idx < allArgs.size() && "getArg() out of range!");
1238 return allArgs[idx];
1239 }
1240 inline const SVFBasicBlock* front() const
1241 {
1242 return getEntryBlock();
1243 }
1244
1245 inline const SVFBasicBlock* back() const
1246 {
1247 assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1251 return std::prev(bbGraph->end())->second;
1252 }
1253
1255 {
1256 return bbGraph->begin();
1257 }
1258
1259 inline const_bb_iterator end() const
1260 {
1261 return bbGraph->end();
1262 }
1263
1264 virtual bool isIsolatedNode() const;
1265
1266 virtual const std::string toString() const;
1267};
1268class FunValVar : public ValVar
1269{
1270
1271 friend class GraphDBClient;
1272
1273protected:
1274 inline void setFunction(const FunObjVar* cgn)
1275 {
1276 funObjVar = cgn;
1277 }
1278
1279private:
1281
1282public:
1284
1285 static inline bool classof(const FunValVar*)
1286 {
1287 return true;
1288 }
1289 static inline bool classof(const ValVar* node)
1290 {
1291 return node->getNodeKind() == FunValNode;
1292 }
1293 static inline bool classof(const SVFVar* node)
1294 {
1295 return node->getNodeKind() == FunValNode;
1296 }
1297 static inline bool classof(const GenericPAGNodeTy* node)
1298 {
1299 return node->getNodeKind() == FunValNode;
1300 }
1301 static inline bool classof(const SVFValue* node)
1302 {
1303 return node->getNodeKind() == FunValNode;
1304 }
1306
1307 inline virtual const FunObjVar* getFunction() const
1308 {
1309 return funObjVar->getFunction();
1310 }
1311
1313 FunValVar(NodeID i, const ICFGNode* icn, const FunObjVar* cgn, const SVFType* svfType);
1314
1315
1316 virtual bool isPointer() const
1317 {
1318 return true;
1319 }
1320
1321 virtual const std::string toString() const;
1322};
1323
1324
1325
1326class GlobalValVar : public ValVar
1327{
1328 friend class GraphDBClient;
1329
1330
1331public:
1333
1334 static inline bool classof(const GlobalValVar*)
1335 {
1336 return true;
1337 }
1338 static inline bool classof(const ValVar* node)
1339 {
1340 return node->getNodeKind() == GlobalValNode;
1341 }
1342 static inline bool classof(const SVFVar* node)
1343 {
1344 return node->getNodeKind() == GlobalValNode;
1345 }
1346 static inline bool classof(const GenericPAGNodeTy* node)
1347 {
1348 return node->getNodeKind() == GlobalValNode;
1349 }
1350 static inline bool classof(const SVFValue* node)
1351 {
1352 return node->getNodeKind() == GlobalValNode;
1353 }
1355
1359 {
1360 type = svfType;
1361 }
1362
1363
1364 virtual const std::string toString() const;
1365};
1366
1368{
1369 friend class GraphDBClient;
1370
1371
1372public:
1374
1375 static inline bool classof(const ConstAggValVar*)
1376 {
1377 return true;
1378 }
1379 static inline bool classof(const ValVar* node)
1380 {
1381 return node->getNodeKind() == ConstAggValNode;
1382 }
1383 static inline bool classof(const SVFVar* node)
1384 {
1385 return node->getNodeKind() == ConstAggValNode;
1386 }
1387 static inline bool classof(const GenericPAGNodeTy* node)
1388 {
1389 return node->getNodeKind() == ConstAggValNode;
1390 }
1391 static inline bool classof(const SVFValue* node)
1392 {
1393 return node->getNodeKind() == ConstAggValNode;
1394 }
1396
1400 {
1401 type = svfTy;
1402 }
1403
1404
1405 virtual bool isConstDataOrAggData() const
1406 {
1407 return true;
1408 }
1409
1411 {
1412 return true;
1413 }
1414
1415 virtual const std::string toString() const;
1416};
1417
1418
1420{
1421 friend class GraphDBClient;
1422
1423
1424public:
1426
1427 static inline bool classof(const ConstDataValVar*)
1428 {
1429 return true;
1430 }
1431 static inline bool classof(const ValVar* node)
1432 {
1433 return isConstantDataValVar(node->getNodeKind());
1434 }
1435 static inline bool classof(const SVFVar* node)
1436 {
1437 return isConstantDataValVar(node->getNodeKind());
1438 }
1439 static inline bool classof(const GenericPAGNodeTy* node)
1440 {
1441 return isConstantDataValVar(node->getNodeKind());
1442 }
1443 static inline bool classof(const SVFValue* node)
1444 {
1445 return isConstantDataValVar(node->getNodeKind());
1446 }
1448
1452 : ValVar(i, svfType, icn, ty)
1453 {
1454
1455 }
1456
1457 virtual bool isConstDataOrAggData() const
1458 {
1459 return true;
1460 }
1461
1463 {
1464 return true;
1465 }
1466
1467 virtual const std::string toString() const;
1468};
1469
1471{
1472
1473 friend class GraphDBClient;
1474public:
1476
1477 static inline bool classof(const BlackHoleValVar*)
1478 {
1479 return true;
1480 }
1481 static inline bool classof(const ConstDataValVar* node)
1482 {
1483 return node->getNodeKind() == BlackHoleValNode;
1484 }
1485 static inline bool classof(const ValVar* node)
1486 {
1487 return node->getNodeKind() == BlackHoleValNode;
1488 }
1489 static inline bool classof(const SVFVar* node)
1490 {
1491 return node->getNodeKind() == BlackHoleValNode;
1492 }
1493 static inline bool classof(const GenericPAGNodeTy* node)
1494 {
1495 return node->getNodeKind() == BlackHoleValNode;
1496 }
1497 static inline bool classof(const SVFValue* node)
1498 {
1499 return node->getNodeKind() == BlackHoleValNode;
1500 }
1502
1509
1511 {
1512 return false;
1513 }
1514
1515 virtual const std::string toString() const
1516 {
1517 return "BlackHoleValVar";
1518 }
1519};
1520
1522{
1523
1524 friend class GraphDBClient;
1525
1526private:
1527 double dval;
1528
1529public:
1531
1532 static inline bool classof(const ConstFPValVar*)
1533 {
1534 return true;
1535 }
1536 static inline bool classof(const ConstDataValVar* node)
1537 {
1538 return node->getNodeKind() == ConstFPValNode;
1539 }
1540 static inline bool classof(const ValVar* node)
1541 {
1542 return node->getNodeKind() == ConstFPValNode;
1543 }
1544 static inline bool classof(const SVFVar* node)
1545 {
1546 return node->getNodeKind() == ConstFPValNode;
1547 }
1548 static inline bool classof(const GenericPAGNodeTy* node)
1549 {
1550 return node->getNodeKind() == ConstFPValNode;
1551 }
1552 static inline bool classof(const SVFValue* node)
1553 {
1554 return node->getNodeKind() == ConstFPValNode;
1555 }
1557
1558 inline double getFPValue() const
1559 {
1560 return dval;
1561 }
1562
1565 const ICFGNode* icn, const SVFType* svfType)
1567 {
1568 }
1569
1570 virtual const std::string toString() const;
1571};
1572
1574{
1575
1576 friend class GraphDBClient;
1577
1578
1579private:
1582
1583public:
1585
1586 static inline bool classof(const ConstIntValVar*)
1587 {
1588 return true;
1589 }
1590 static inline bool classof(const ConstDataValVar* node)
1591 {
1592 return node->getNodeKind() == ConstIntValNode;
1593 }
1594 static inline bool classof(const ValVar* node)
1595 {
1596 return node->getNodeKind() == ConstIntValNode;
1597 }
1598 static inline bool classof(const SVFVar* node)
1599 {
1600 return node->getNodeKind() == ConstIntValNode;
1601 }
1602 static inline bool classof(const GenericPAGNodeTy* node)
1603 {
1604 return node->getNodeKind() == ConstIntValNode;
1605 }
1606 static inline bool classof(const SVFValue* node)
1607 {
1608 return node->getNodeKind() == ConstIntValNode;
1609 }
1611
1613 {
1614 return sval;
1615 }
1616
1617
1619 {
1620 return zval;
1621 }
1622
1629 virtual const std::string toString() const;
1630};
1631
1633{
1634 friend class GraphDBClient;
1635
1636public:
1638
1639 static inline bool classof(const ConstNullPtrValVar*)
1640 {
1641 return true;
1642 }
1643 static inline bool classof(const ConstDataValVar* node)
1644 {
1645 return node->getNodeKind() == ConstNullptrValNode;
1646 }
1647 static inline bool classof(const ValVar* node)
1648 {
1649 return node->getNodeKind() == ConstNullptrValNode;
1650 }
1651 static inline bool classof(const SVFVar* node)
1652 {
1653 return node->getNodeKind() == ConstNullptrValNode;
1654 }
1655 static inline bool classof(const GenericPAGNodeTy* node)
1656 {
1657 return node->getNodeKind() == ConstNullptrValNode;
1658 }
1659 static inline bool classof(const SVFValue* node)
1660 {
1661 return node->getNodeKind() == ConstNullptrValNode;
1662 }
1664
1671
1673 {
1674 return false;
1675 }
1676
1677 virtual const std::string toString() const;
1678};
1679
1681{
1682 friend class GraphDBClient;
1683
1684
1685public:
1687
1688 static inline bool classof(const GlobalObjVar*)
1689 {
1690 return true;
1691 }
1692 static inline bool classof(const BaseObjVar* node)
1693 {
1694 return node->getNodeKind() == GlobalObjNode;
1695 }
1696 static inline bool classof(const ObjVar* node)
1697 {
1698 return node->getNodeKind() == GlobalObjNode;
1699 }
1700 static inline bool classof(const SVFVar* node)
1701 {
1702 return node->getNodeKind() == GlobalObjNode;
1703 }
1704 static inline bool classof(const GenericPAGNodeTy* node)
1705 {
1706 return node->getNodeKind() == GlobalObjNode;
1707 }
1708 static inline bool classof(const SVFValue* node)
1709 {
1710 return node->getNodeKind() == GlobalObjNode;
1711 }
1713
1716 PNODEK ty = GlobalObjNode): BaseObjVar(i, ti, node, ty)
1717 {
1718
1719 }
1720
1721
1722 virtual const std::string toString() const;
1723};
1724
1726{
1727 friend class GraphDBClient;
1728
1729
1730public:
1732
1733 static inline bool classof(const ConstAggObjVar*)
1734 {
1735 return true;
1736 }
1737 static inline bool classof(const BaseObjVar* node)
1738 {
1739 return node->getNodeKind() == ConstAggObjNode;
1740 }
1741
1742 static inline bool classof(const ObjVar* node)
1743 {
1744 return node->getNodeKind() == ConstAggObjNode;
1745 }
1746 static inline bool classof(const SVFVar* node)
1747 {
1748 return node->getNodeKind() == ConstAggObjNode;
1749 }
1750 static inline bool classof(const GenericPAGNodeTy* node)
1751 {
1752 return node->getNodeKind() == ConstAggObjNode;
1753 }
1754 static inline bool classof(const SVFValue* node)
1755 {
1756 return node->getNodeKind() == ConstAggObjNode;
1757 }
1759
1762 : BaseObjVar(i, ti, node, ConstAggObjNode)
1763 {
1764
1765 }
1766
1767 virtual bool isConstDataOrAggData() const
1768 {
1769 return true;
1770 }
1771
1773 {
1774 return true;
1775 }
1776
1777 virtual const std::string toString() const;
1778};
1779
1781{
1782 friend class GraphDBClient;
1783
1784public:
1786 static inline bool classof(const ConstDataObjVar*)
1787 {
1788 return true;
1789 }
1790 static inline bool classof(const BaseObjVar* node)
1791 {
1792 return isConstantDataObjVarKinds(node->getNodeKind());
1793 }
1794 static inline bool classof(const SVFVar* node)
1795 {
1796 return isConstantDataObjVarKinds(node->getNodeKind());
1797 }
1798 static inline bool classof(const ObjVar* node)
1799 {
1800 return isConstantDataObjVarKinds(node->getNodeKind());
1801 }
1802 static inline bool classof(const GenericPAGNodeTy* node)
1803 {
1804 return isConstantDataObjVarKinds(node->getNodeKind());
1805 }
1806
1807 static inline bool classof(const SVFValue* node)
1808 {
1809 return isConstantDataObjVarKinds(node->getNodeKind());
1810 }
1812
1815 : BaseObjVar(i, ti, node, ty)
1816 {
1817 }
1818
1819 virtual bool isConstDataOrAggData() const
1820 {
1821 return true;
1822 }
1823
1825 {
1826 return true;
1827 }
1828
1829 virtual const std::string toString() const;
1830};
1831
1833{
1834
1835 friend class GraphDBClient;
1836
1837
1838private:
1839 float dval;
1840
1841public:
1843 static inline bool classof(const ConstFPObjVar*)
1844 {
1845 return true;
1846 }
1847 static inline bool classof(const ConstDataObjVar* node)
1848 {
1849 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1850 }
1851 static inline bool classof(const BaseObjVar* node)
1852 {
1853 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1854 }
1855
1856 static inline bool classof(const SVFVar* node)
1857 {
1858 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1859 }
1860
1861 static inline bool classof(const ObjVar* node)
1862 {
1863 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1864 }
1865
1866 static inline bool classof(const GenericPAGNodeTy* node)
1867 {
1868 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1869 }
1870
1871 static inline bool classof(const SVFValue* node)
1872 {
1873 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1874 }
1876
1880 {
1881 }
1882
1883 inline double getFPValue() const
1884 {
1885 return dval;
1886 }
1887
1888
1889 virtual const std::string toString() const;
1890};
1891
1893{
1894
1895 friend class GraphDBClient;
1896
1897
1898
1899private:
1902
1903public:
1905 static inline bool classof(const ConstIntObjVar*)
1906 {
1907 return true;
1908 }
1909
1910 static inline bool classof(const ConstDataObjVar* node)
1911 {
1912 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1913 }
1914
1915 static inline bool classof(const BaseObjVar* node)
1916 {
1917 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1918 }
1919
1920 static inline bool classof(const SVFVar* node)
1921 {
1922 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1923 }
1924 static inline bool classof(const ObjVar* node)
1925 {
1926 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1927 }
1928 static inline bool classof(const GenericPAGNodeTy* node)
1929 {
1930 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1931 }
1932
1933 static inline bool classof(const SVFValue* node)
1934 {
1935 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1936 }
1937
1939 {
1940 return sval;
1941 }
1942
1943
1945 {
1946 return zval;
1947 }
1949
1953 {
1954 }
1955
1956 virtual const std::string toString() const;
1957};
1958
1960{
1961
1962 friend class GraphDBClient;
1963
1964public:
1966 static inline bool classof(const ConstNullPtrObjVar*)
1967 {
1968 return true;
1969 }
1970
1971 static inline bool classof(const ConstDataObjVar* node)
1972 {
1973 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1974 }
1975
1976 static inline bool classof(const BaseObjVar* node)
1977 {
1978 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1979 }
1980
1981 static inline bool classof(const SVFVar* node)
1982 {
1983 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1984 }
1985 static inline bool classof(const ObjVar* node)
1986 {
1987 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1988 }
1989 static inline bool classof(const GenericPAGNodeTy* node)
1990 {
1991 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1992 }
1993
1994 static inline bool classof(const SVFValue* node)
1995 {
1996 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1997 }
1999
2006 {
2007 return false;
2008 }
2009 virtual const std::string toString() const;
2010};
2011/*
2012 * Unique Return node of a procedure
2013 */
2014class RetValPN : public ValVar
2015{
2016 friend class GraphDBClient;
2017
2018protected:
2019 inline void setCallGraphNode(const FunObjVar* node)
2020 {
2021 callGraphNode = node;
2022 }
2023
2024private:
2026
2027public:
2029 static inline bool classof(const RetValPN*)
2030 {
2031 return true;
2032 }
2033 static inline bool classof(const SVFVar* node)
2034 {
2035 return node->getNodeKind() == SVFVar::RetValNode;
2036 }
2037 static inline bool classof(const ValVar* node)
2038 {
2039 return node->getNodeKind() == SVFVar::RetValNode;
2040 }
2041 static inline bool classof(const GenericPAGNodeTy* node)
2042 {
2043 return node->getNodeKind() == SVFVar::RetValNode;
2044 }
2045 static inline bool classof(const SVFValue* node)
2046 {
2047 return node->getNodeKind() == SVFVar::RetValNode;
2048 }
2050
2051
2053 RetValPN(NodeID i, const FunObjVar* node, const SVFType* svfType, const ICFGNode* icn);
2054
2055 inline const FunObjVar* getCallGraphNode() const
2056 {
2057 return callGraphNode;
2058 }
2059
2060 virtual const FunObjVar* getFunction() const;
2061
2062 virtual bool isPointer() const;
2063
2065 const std::string getValueName() const;
2066
2067 virtual const std::string toString() const;
2068};
2069
2070/*
2071 * Unique vararg node of a procedure
2072 */
2073class VarArgValPN : public ValVar
2074{
2075
2076 friend class GraphDBClient;
2077
2078protected:
2079 inline void setCallGraphNode(const FunObjVar* node)
2080 {
2081 callGraphNode = node;
2082 }
2083private:
2085
2086public:
2088 static inline bool classof(const VarArgValPN*)
2089 {
2090 return true;
2091 }
2092 static inline bool classof(const SVFVar* node)
2093 {
2094 return node->getNodeKind() == SVFVar::VarargValNode;
2095 }
2096 static inline bool classof(const ValVar* node)
2097 {
2098 return node->getNodeKind() == SVFVar::VarargValNode;
2099 }
2100 static inline bool classof(const GenericPAGNodeTy* node)
2101 {
2102 return node->getNodeKind() == SVFVar::VarargValNode;
2103 }
2104 static inline bool classof(const SVFValue* node)
2105 {
2106 return node->getNodeKind() == SVFVar::VarargValNode;
2107 }
2109
2111 VarArgValPN(NodeID i, const FunObjVar* node, const SVFType* svfType, const ICFGNode* icn)
2113 {
2114 }
2115
2116 virtual const FunObjVar* getFunction() const;
2117
2119 const std::string getValueName() const;
2120
2121 virtual bool isPointer() const
2122 {
2123 return true;
2124 }
2125 virtual const std::string toString() const;
2126};
2127
2128/*
2129 * Dummy variable without any LLVM value
2130 */
2131class DummyValVar: public ValVar
2132{
2133 friend class GraphDBClient;
2134
2135public:
2137 static inline bool classof(const DummyValVar*)
2138 {
2139 return true;
2140 }
2141 static inline bool classof(const SVFVar* node)
2142 {
2143 return node->getNodeKind() == SVFVar::DummyValNode;
2144 }
2145 static inline bool classof(const ValVar* node)
2146 {
2147 return node->getNodeKind() == SVFVar::DummyValNode;
2148 }
2149 static inline bool classof(const GenericPAGNodeTy* node)
2150 {
2151 return node->getNodeKind() == SVFVar::DummyValNode;
2152 }
2153 static inline bool classof(const SVFValue* node)
2154 {
2155 return node->getNodeKind() == SVFVar::DummyValNode;
2156 }
2158
2161 : ValVar(i, svfType, node, DummyValNode)
2162 {
2163 }
2164
2166 inline const std::string getValueName() const
2167 {
2168 return "dummyVal";
2169 }
2170
2171 virtual bool isPointer() const
2172 {
2173 return true;
2174 }
2175
2176 virtual const std::string toString() const;
2177};
2178
2179/*
2180 * Dummy object variable
2181 */
2183{
2184
2185 friend class GraphDBClient;
2186
2187
2188public:
2190 static inline bool classof(const DummyObjVar*)
2191 {
2192 return true;
2193 }
2194 static inline bool classof(const BaseObjVar* node)
2195 {
2196 return node->getNodeKind() == SVFVar::DummyObjNode;
2197 }
2198 static inline bool classof(const SVFVar* node)
2199 {
2200 return node->getNodeKind() == SVFVar::DummyObjNode;
2201 }
2202 static inline bool classof(const ObjVar* node)
2203 {
2204 return node->getNodeKind() == SVFVar::DummyObjNode;
2205 }
2206 static inline bool classof(const GenericPAGNodeTy* node)
2207 {
2208 return node->getNodeKind() == SVFVar::DummyObjNode;
2209 }
2210
2211 static inline bool classof(const SVFValue* node)
2212 {
2213 return node->getNodeKind() == SVFVar::DummyObjNode;
2214 }
2216
2219 : BaseObjVar(i, ti, node, DummyObjNode)
2220 {
2221 }
2222
2224 inline const std::string getValueName() const
2225 {
2226 return "dummyObj";
2227 }
2228
2229 virtual bool isPointer() const
2230 {
2231 return true;
2232 }
2233
2234 virtual const std::string toString() const;
2235};
2236
2237} // End namespace SVF
2238
2239#endif /* INCLUDE_SVFIR_SVFVARIABLE_H_ */
APOffset getConstantStructFldIdx() const
Get methods.
Definition AccessPath.h:98
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
static bool classof(const GenericPAGNodeTy *node)
void addCGNodeFromDB(const FunObjVar *cgNode)
static bool classof(const SVFVar *node)
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
friend class GraphDBClient
virtual bool isPointer() const
Check if this variable represents a pointer.
const FunObjVar * getParent() const
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
BaseObjVar(NodeID i, ObjTypeInfo *ti, const ICFGNode *node, PNODEK ty=BaseObjNode)
Constructor.
const ObjTypeInfo * getTypeInfo() 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.
bool isConstantByteSize() const
Check if byte size is a const value.
u32_t getByteSizeOfObj() const
Get the byte size of this object.
friend class GraphDBClient
ObjTypeInfo * typeInfo
bool isBlackHoleObj() const
Whether it is a black hole object.
bool isStruct() const
static bool classof(const BaseObjVar *)
ICFGNode related to the creation of this object.
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.
ObjTypeInfo * getTypeInfo()
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)
static bool classof(const SVFVar *node)
static bool classof(const ConstDataValVar *node)
friend class GraphDBClient
static bool classof(const BlackHoleValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const SVFValue *node)
static bool classof(const BaseObjVar *node)
virtual const std::string toString() const
Get string representation.
ConstAggObjVar(NodeID i, ObjTypeInfo *ti, const ICFGNode *node)
Constructor.
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 GraphDBClient
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.
static bool classof(const SVFVar *node)
static bool classof(const ValVar *node)
friend class GraphDBClient
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.
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.
ConstDataObjVar(NodeID i, ObjTypeInfo *ti, const ICFGNode *node, PNODEK ty=ConstDataObjNode)
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 GraphDBClient
virtual bool isConstDataOrAggData() const
Check if this variable represents constant/aggregate data.
static bool classof(const ConstDataObjVar *)
static bool classof(const SVFVar *node)
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 GraphDBClient
static bool classof(const SVFVar *node)
virtual bool isConstDataOrAggData() const
Check if this variable represents constant/aggregate data.
ConstFPObjVar(NodeID i, double dv, ObjTypeInfo *ti, const ICFGNode *node)
Constructor.
static bool classof(const ObjVar *node)
static bool classof(const BaseObjVar *node)
static bool classof(const ConstFPObjVar *)
virtual const std::string toString() const
Get string representation.
friend class GraphDBClient
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const ConstDataObjVar *node)
double getFPValue() const
static bool classof(const SVFValue *node)
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)
static bool classof(const ConstFPValVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const GenericPAGNodeTy *node)
friend class GraphDBClient
double getFPValue() const
ConstFPValVar(NodeID i, double dv, const ICFGNode *icn, const SVFType *svfType)
Constructor.
virtual const std::string toString() const
Get string representation.
static bool classof(const SVFValue *node)
ConstIntObjVar(NodeID i, s64_t sv, u64_t zv, ObjTypeInfo *ti, const ICFGNode *node)
Constructor.
static bool classof(const SVFVar *node)
static bool classof(const ConstDataObjVar *node)
s64_t getSExtValue() const
static bool classof(const ConstIntObjVar *)
static bool classof(const ObjVar *node)
u64_t getZExtValue() const
friend class GraphDBClient
static bool classof(const GenericPAGNodeTy *node)
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 GraphDBClient
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)
ConstNullPtrObjVar(NodeID i, ObjTypeInfo *ti, const ICFGNode *node)
Constructor.
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.
static bool classof(const SVFValue *node)
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)
Constructor.
static bool classof(const ObjVar *node)
friend class GraphDBClient
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 GraphDBClient
virtual bool isPointer() const
Check if this variable represents a pointer.
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFVar *node)
static bool classof(const SVFValue *node)
BasicBlockGraph::IDToNodeMapTy::const_iterator const_bb_iterator
void updateExitBlock(SVFBasicBlock *bb)
const BasicBlockGraph * getBasicBlockGraph() const
const ArgValVar * getArg(u32_t idx) const
virtual const std::string toString() const
Get string representation.
void setLoopAndDomInfo(SVFLoopAndDomInfo *ld)
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)
const std::vector< const ArgValVar * > & getArgs() const
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
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)
bool getIsNotRet() const
static bool classof(const GenericPAGNodeTy *node)
const SVFFunctionType * funcType
return true if this function supports variable arguments
friend class GraphDBClient
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 *)
a 'single' basic block having no successors and containing return instruction in a function
const FunObjVar * realDefFun
the loop and dominate information
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.
static bool classof(const ValVar *node)
friend class GraphDBClient
const FunObjVar * funObjVar
void setFunction(const FunObjVar *cgn)
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.
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)
virtual bool isPointer() const
Check if this variable represents a pointer.
virtual const std::string toString() const
Get string representation.
friend class GraphDBClient
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)
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)
void setLLVMVarInstID(NodeID id)
Set the LLVM variable ID associated with this GepValVar.
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.
const AccessPath & getAccessPath() const
const void setAccessPath(const AccessPath *ap)
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.
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
friend class GraphDBClient
void setBaseNode(const ValVar *baseNode)
NodeID getLLVMVarInstID() const
Get the LLVM variable ID associated with this GepValVar.
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)
static bool classof(const BaseObjVar *node)
static bool classof(const GenericPAGNodeTy *node)
GlobalObjVar(NodeID i, ObjTypeInfo *ti, const ICFGNode *node, PNODEK ty=GlobalObjNode)
Constructor.
virtual const std::string toString() const
Get string representation.
static bool classof(const SVFVar *node)
friend class GraphDBClient
static bool classof(const GlobalObjVar *)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const ObjVar *node)
static bool classof(const SVFValue *node)
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 GraphDBClient
static bool classof(const SVFValue *node)
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 GenericPAGNodeTy *node)
HeapObjVar(NodeID i, ObjTypeInfo *ti, const ICFGNode *node)
Constructor.
static bool classof(const SVFValue *node)
const std::string getValueName() const
Return name of a LLVM value.
friend class GraphDBClient
static bool classof(const ObjVar *node)
virtual const std::string toString() const
Get string representation.
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:97
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.
virtual const std::string toString() const
Get string representation.
static bool classof(const SVFValue *node)
static bool classof(const GenericPAGNodeTy *node)
std::string getObjVarNodeFieldsStmt() const
static bool classof(const SVFVar *node)
ObjVar(NodeID i, const SVFType *svfType, PNODEK ty=ObjNode)
Constructor.
friend class GraphDBClient
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.
const FunObjVar * callGraphNode
void setCallGraphNode(const FunObjVar *node)
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)
const std::string getValueName() const
Return name of a LLVM value.
friend class GraphDBClient
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:403
const LoopBBs & getLoopInfo(const SVFBasicBlock *bb) const
Definition SVFValue.cpp:76
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:102
bool isLoopHeader(const SVFBasicBlock *bb) const
Definition SVFValue.cpp:189
void getExitBlocksOfLoop(const SVFBasicBlock *bb, BBList &exitbbs) const
Definition SVFValue.cpp:83
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:133
GenericNode< SVFVar, SVFStmt >::GEdgeSetTy SVFStmtSetTy
PAGEdgeToSetMapTy KindToSVFStmtMapTy
static SVFType * getSVFPtrType()
Definition SVFType.h:218
bool isPointerTy() const
Definition SVFType.h:294
@ ConstNullptrObjNode
Definition SVFValue.h:99
@ ConstNullptrValNode
Definition SVFValue.h:80
static bool isConstantDataValVar(GNodeK n)
Definition SVFValue.h:249
static bool isObjVarKinds(GNodeK n)
Definition SVFValue.h:257
static bool isBaseObjVarKinds(GNodeK n)
Definition SVFValue.h:265
GNodeK getNodeKind() const
Get node kind.
Definition SVFValue.h:166
NodeID id
Node ID.
Definition SVFValue.h:206
virtual const std::string & getName() const
Definition SVFValue.h:186
static bool isConstantDataObjVarKinds(GNodeK n)
Definition SVFValue.h:273
static bool isValVarKinds(GNodeK n)
Definition SVFValue.h:240
static bool isSVFVarKind(GNodeK n)
Definition SVFValue.h:231
const SVFType * type
SVF type.
Definition SVFValue.h:208
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.
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.
bool hasOutgoingEdges(SVFStmt::PEDGEK kind) const
SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
const SVFStmt::KindToSVFStmtMapTy & getInEdgeKindToSetMap() 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
const SVFStmt::KindToSVFStmtMapTy & getOutEdgeKindToSetMap() const
friend class GraphDBClient
virtual ~SVFVar()
Virtual destructor.
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)
static bool classof(const ObjVar *node)
static bool classof(const BaseObjVar *node)
static bool classof(const GenericPAGNodeTy *node)
friend class GraphDBClient
StackObjVar(NodeID i, ObjTypeInfo *ti, const ICFGNode *node)
Constructor.
static bool classof(const SVFValue *node)
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.
static bool classof(const SVFVar *node)
friend class GraphDBClient
std::string getValVarNodeFieldsStmt() const
ValVar(NodeID i, const SVFType *svfType, const ICFGNode *node, PNODEK ty=ValNode)
Constructor.
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, 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 GraphDBClient
virtual const FunObjVar * getFunction() const
Get containing function, or null for globals/constants.
static bool classof(const ValVar *node)
void setCallGraphNode(const FunObjVar *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