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/BasicBlockG.h"
36#include "Graphs/GenericGraph.h"
37#include "SVFIR/ObjTypeInfo.h"
38#include "SVFIR/SVFStatements.h"
39#include "Util/GeneralType.h"
41#include "Util/SVFUtil.h"
42
43namespace SVF
44{
45
46class FunObjVar;
47class SVFVar;
48
49/*
50 * Program variables in SVFIR (based on PAG nodes)
51 * These represent variables in the program analysis graph
52 */
55{
56
57 friend class SVFIRBuilder;
58 friend class IRGraph;
59 friend class SVFIR;
60 friend class VFG;
61 friend class GraphDBClient;
62
63public:
73 typedef GNodeK PNODEK;
75
76protected:
80
82 {
83 return InEdgeKindToSetMap;
84 }
85
86
91
92
93public:
96
98 virtual ~SVFVar() {}
99
101 virtual inline bool isPointer() const
102 {
103 assert(type && "type is null?");
104 return type->isPointerTy();
105 }
106
109 {
110 return false;
111 }
112
114 virtual bool isIsolatedNode() const;
115
117 virtual const std::string getValueName() const = 0;
118
120 virtual inline const FunObjVar* getFunction() const
121 {
122 return nullptr;
123 }
124
126
131
136
137 inline bool hasIncomingEdges(SVFStmt::PEDGEK kind) const
138 {
139 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
140 if (it != InEdgeKindToSetMap.end())
141 return (!it->second.empty());
142 else
143 return false;
144 }
145
146 inline bool hasOutgoingEdges(SVFStmt::PEDGEK kind) const
147 {
148 SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
149 if (it != OutEdgeKindToSetMap.end())
150 return (!it->second.empty());
151 else
152 return false;
153 }
154
156 inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
157 {
158 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
159 assert(it!=InEdgeKindToSetMap.end() && "Edge kind not found");
160 return it->second.begin();
161 }
162
163 inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd(SVFStmt::PEDGEK kind) const
164 {
165 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
166 assert(it!=InEdgeKindToSetMap.end() && "Edge kind not found");
167 return it->second.end();
168 }
169
170 inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
171 {
172 SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
173 assert(it!=OutEdgeKindToSetMap.end() && "Edge kind not found");
174 return it->second.begin();
175 }
176
177 inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
178 {
179 SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
180 assert(it!=OutEdgeKindToSetMap.end() && "Edge kind not found");
181 return it->second.end();
182 }
184
186 static inline bool classof(const SVFVar *)
187 {
188 return true;
189 }
190
191 static inline bool classof(const GenericPAGNodeTy * node)
192 {
193 return isSVFVarKind(node->getNodeKind());
194 }
195
196 static inline bool classof(const SVFValue* node)
197 {
198 return isSVFVarKind(node->getNodeKind());
199 }
200
202 virtual bool ptrInUncalledFunction() const;
203
205 virtual bool isConstDataOrAggData() const
206 {
207 return false;
208 }
209
210
211private:
213
215 {
216 GEdgeKind kind = inEdge->getEdgeKind();
217 InEdgeKindToSetMap[kind].insert(inEdge);
219 }
220
222 {
223 GEdgeKind kind = outEdge->getEdgeKind();
224 OutEdgeKindToSetMap[kind].insert(outEdge);
226 }
227
229 inline bool hasIncomingVariantGepEdge() const
230 {
231 SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(SVFStmt::Gep);
232 if (it != InEdgeKindToSetMap.end())
233 {
234 for(auto gep : it->second)
235 {
236 if(SVFUtil::cast<GepStmt>(gep)->isVariantFieldGep())
237 return true;
238 }
239 }
240 return false;
241 }
242
243public:
245 virtual const std::string toString() const;
246
248 void dump() const;
249
251 friend OutStream& operator<< (OutStream &o, const SVFVar &node)
252 {
253 o << node.toString();
254 return o;
255 }
256};
257
258
259
260/*
261 * Value (Pointer) variable
262 */
263class ValVar: public SVFVar
264{
265 friend class GraphDBClient;
266
267private:
268 const ICFGNode* icfgNode; // icfgnode related to valvar
269
270public:
272
273 static inline bool classof(const ValVar*)
274 {
275 return true;
276 }
277 static inline bool classof(const SVFVar* node)
278 {
279 return isValVarKinds(node->getNodeKind());
280 }
281 static inline bool classof(const GenericPAGNodeTy* node)
282 {
283 return isValVarKinds(node->getNodeKind());
284 }
285 static inline bool classof(const SVFValue* node)
286 {
287 return isValVarKinds(node->getNodeKind());
288 }
290
292 ValVar(NodeID i, const SVFType* svfType, const ICFGNode* node, PNODEK ty = ValNode);
294 inline const std::string getValueName() const
295 {
296 return getName();
297 }
298
299 const ICFGNode* getICFGNode() const
300 {
301 return icfgNode;
302 }
303
304 virtual const FunObjVar* getFunction() const;
305
306 virtual const std::string toString() const;
307
308 std::string getValVarNodeFieldsStmt() const;
309
310};
311
312/*
313 * Memory Object variable
314 */
315class ObjVar: public SVFVar
316{
317 friend class GraphDBClient;
318
319protected:
322 SVFVar(i, svfType, ty)
323 {
324 }
325public:
327
328 static inline bool classof(const ObjVar*)
329 {
330 return true;
331 }
332 static inline bool classof(const SVFVar* node)
333 {
334 return isObjVarKinds(node->getNodeKind());
335 }
336 static inline bool classof(const GenericPAGNodeTy* node)
337 {
338 return isObjVarKinds(node->getNodeKind());
339 }
340 static inline bool classof(const SVFValue* node)
341 {
342 return isObjVarKinds(node->getNodeKind());
343 }
345
347 virtual const std::string getValueName() const
348 {
349 return getName();
350 }
351
352 virtual const std::string toString() const;
353
354 std::string getObjVarNodeFieldsStmt() const;
355
356};
357
358
365class ArgValVar: public ValVar
366{
367 friend class GraphDBClient;
368
369private:
372
373public:
375
376 static inline bool classof(const ArgValVar*)
377 {
378 return true;
379 }
380 static inline bool classof(const ValVar* node)
381 {
382 return node->getNodeKind() == ArgValNode;
383 }
384 static inline bool classof(const SVFVar* node)
385 {
386 return node->getNodeKind() == ArgValNode;
387 }
388 static inline bool classof(const GenericPAGNodeTy* node)
389 {
390 return node->getNodeKind() == ArgValNode;
391 }
392 static inline bool classof(const SVFValue* node)
393 {
394 return node->getNodeKind() == ArgValNode;
395 }
397
399 ArgValVar(NodeID i, u32_t argNo, const ICFGNode* icn, const FunObjVar* callGraphNode,
400 const SVFType* svfType);
401
403 inline const std::string getValueName() const
404 {
405 return getName() + " (argument valvar)";
406 }
407
408 inline void addCGNodeFromDB(const FunObjVar* cgNode)
409 {
410 this->cgNode = cgNode;
411 }
412
413 virtual const FunObjVar* getFunction() const;
414
415 const FunObjVar* getParent() const;
416
419 inline u32_t getArgNo() const
420 {
421 return argNo;
422 }
423
424 bool isArgOfUncalledFunction() const;
425
426 virtual bool isPointer() const;
427
428 virtual const std::string toString() const;
429};
430
431
432/*
433 * Gep Value (Pointer) variable, this variable can be dynamic generated for field sensitive analysis
434 * e.g. memcpy, temp gep value variable needs to be created
435 * Each Gep Value variable is connected to base value variable via gep edge
436 */
437class GepValVar: public ValVar
438{
439 friend class GraphDBClient;
440
441private:
442 AccessPath ap; // AccessPath
443 const ValVar* base; // base node
446
447
448public:
450
451 static inline bool classof(const GepValVar *)
452 {
453 return true;
454 }
455 static inline bool classof(const ValVar * node)
456 {
457 return node->getNodeKind() == SVFVar::GepValNode;
458 }
459 static inline bool classof(const SVFVar *node)
460 {
461 return node->getNodeKind() == SVFVar::GepValNode;
462 }
463 static inline bool classof(const GenericPAGNodeTy *node)
464 {
465 return node->getNodeKind() == SVFVar::GepValNode;
466 }
467 static inline bool classof(const SVFValue* node)
468 {
469 return node->getNodeKind() == SVFVar::GepValNode;
470 }
471
472 inline const AccessPath& getAccessPath() const
473 {
474 return ap;
475 }
476
477 inline const void setAccessPath(const AccessPath* ap)
478 {
479 this->ap = *ap;
480 }
482
484 GepValVar(const ValVar* baseNode, NodeID i, const AccessPath& ap,
485 const SVFType* ty, const ICFGNode* node);
486
489 {
491 }
492
494 inline const ValVar* getBaseNode(void) const
495 {
496 return base;
497 }
498 inline void setBaseNode(const ValVar* baseNode)
499 {
500 base = baseNode;
501 }
502
504 inline const std::string getValueName() const
505 {
506 return getName() + "_" +
507 std::to_string(getConstantFieldIdx());
508 }
509
510 virtual bool isPointer() const
511 {
512 return base->isPointer();
513 }
514
515 inline const SVFType* getType() const
516 {
517 return gepValType;
518 }
519
520 virtual const FunObjVar* getFunction() const
521 {
522 return base->getFunction();
523 }
524
525 virtual const std::string toString() const;
526
528 {
530 }
531 virtual inline bool ptrInUncalledFunction() const
532 {
533 return base->ptrInUncalledFunction();
534 }
535
536 virtual inline bool isConstDataOrAggData() const
537 {
538 return base->isConstDataOrAggData();
539 }
540
543 {
544 return llvmVarID;
545 }
546
548 inline void setLLVMVarInstID(NodeID id)
549 {
550 llvmVarID = id;
551 }
552};
553
554/*
555 * Base memory object variable (address-taken variables in LLVM-based languages)
556 */
557class BaseObjVar : public ObjVar
558{
559 friend class SVFIRBuilder;
560 friend class GraphDBClient;
561
562private:
564
566
567public:
569
570 static inline bool classof(const BaseObjVar*)
571 {
572 return true;
573 }
574 static inline bool classof(const ObjVar* node)
575 {
576 return isBaseObjVarKinds(node->getNodeKind());
577 }
578 static inline bool classof(const SVFVar* node)
579 {
580 return isBaseObjVarKinds(node->getNodeKind());
581 }
582 static inline bool classof(const GenericPAGNodeTy* node)
583 {
584 return isBaseObjVarKinds(node->getNodeKind());
585 }
586 static inline bool classof(const SVFValue* node)
587 {
588 return isBaseObjVarKinds(node->getNodeKind());
589 }
591
594 : ObjVar(i, ti->getType(), ty), typeInfo(ti), icfgNode(node)
595 {
596 }
597
598 virtual const BaseObjVar* getBaseMemObj() const
599 {
600 return this;
601 }
602
603 inline const ObjTypeInfo* getTypeInfo() const
604 {
605 return typeInfo;
606 }
608 {
609 return typeInfo;
610 }
611
613 inline const ICFGNode* getICFGNode() const
614 {
615 return icfgNode;
616 }
617
619 inline const std::string getValueName() const
620 {
621 return getName() + " (base object)";
622 }
623
624 virtual const std::string toString() const;
625
627 inline NodeID getId() const
628 {
629 return id;
630 }
631
633 const SVFType* getType() const
634 {
635 return typeInfo->getType();
636 }
637
640 {
641 return typeInfo->getNumOfElements();
642 }
643
646 {
648 }
649
655
656
659 {
660 return getMaxFieldOffsetLimit() == 0;
661 }
662
668
669
675
677 bool isBlackHoleObj() const;
678
681 {
682 return typeInfo->getByteSizeOfObj();
683 }
684
687 {
689 }
690
691
693
694 bool isFunction() const
695 {
696 return typeInfo->isFunction();
697 }
698 bool isGlobalObj() const
699 {
700 return typeInfo->isGlobalObj();
701 }
702 bool isStaticObj() const
703 {
704 return typeInfo->isStaticObj();
705 }
706 bool isStack() const
707 {
708 return typeInfo->isStack();
709 }
710 bool isHeap() const
711 {
712 return typeInfo->isHeap();
713 }
714 bool isStruct() const
715 {
716 return typeInfo->isStruct();
717 }
718 bool isArray() const
719 {
720 return typeInfo->isArray();
721 }
722 bool isVarStruct() const
723 {
724 return typeInfo->isVarStruct();
725 }
726 bool isVarArray() const
727 {
728 return typeInfo->isVarArray();
729 }
730 bool isConstantStruct() const
731 {
732 return typeInfo->isConstantStruct();
733 }
734 bool isConstantArray() const
735 {
736 return typeInfo->isConstantArray();
737 }
739 {
741 }
742 virtual inline bool isConstDataOrAggData() const
743 {
745 }
747
749 void destroy()
750 {
751 delete typeInfo;
752 typeInfo = nullptr;
753 }
754
755 virtual const FunObjVar* getFunction() const;
756
757};
758
759
760/*
761 * Gep Obj variable, this is dynamic generated for field sensitive analysis
762 * Each gep obj variable is one field of a BaseObjVar (base)
763 */
764class GepObjVar: public ObjVar
765{
766 friend class GraphDBClient;
767
768
769private:
771
773
774public:
776
777 static inline bool classof(const GepObjVar*)
778 {
779 return true;
780 }
781 static inline bool classof(const ObjVar* node)
782 {
783 return node->getNodeKind() == SVFVar::GepObjNode;
784 }
785 static inline bool classof(const SVFVar* node)
786 {
787 return node->getNodeKind() == SVFVar::GepObjNode;
788 }
789 static inline bool classof(const GenericPAGNodeTy* node)
790 {
791 return node->getNodeKind() == SVFVar::GepObjNode;
792 }
793 static inline bool classof(const SVFValue* node)
794 {
795 return node->getNodeKind() == SVFVar::GepObjNode;
796 }
798
805
808 {
809 return apOffset;
810 }
811
813 inline NodeID getBaseNode(void) const
814 {
815 return base->getId();
816 }
817
818 inline const BaseObjVar* getBaseObj() const
819 {
820 return base;
821 }
822
824 inline virtual const SVFType* getType() const;
825
826
828 inline const std::string getValueName() const
829 {
830 return getName() + "_" + std::to_string(apOffset);
831 }
832
833 virtual const FunObjVar* getFunction() const
834 {
835 return base->getFunction();
836 }
837
838 virtual const std::string toString() const;
839
840 virtual inline bool ptrInUncalledFunction() const
841 {
842 return base->ptrInUncalledFunction();
843 }
844
845 virtual inline bool isConstDataOrAggData() const
846 {
847 return base->isConstDataOrAggData();
848 }
849
851 {
853 }
854
855 virtual bool isPointer() const
856 {
857 return base->isPointer();
858 }
859};
860
861
862
870{
871
872 friend class GraphDBClient;
873
874public:
876
877 static inline bool classof(const HeapObjVar*)
878 {
879 return true;
880 }
881 static inline bool classof(const BaseObjVar* node)
882 {
883 return node->getNodeKind() == HeapObjNode;
884 }
885 static inline bool classof(const ObjVar* node)
886 {
887 return node->getNodeKind() == HeapObjNode;
888 }
889 static inline bool classof(const SVFVar* node)
890 {
891 return node->getNodeKind() == HeapObjNode;
892 }
893 static inline bool classof(const GenericPAGNodeTy* node)
894 {
895 return node->getNodeKind() == HeapObjNode;
896 }
897 static inline bool classof(const SVFValue* node)
898 {
899 return node->getNodeKind() == HeapObjNode;
900 }
902
905 BaseObjVar(i, ti, node, HeapObjNode)
906 {
907 }
908
910 inline const std::string getValueName() const
911 {
912 return " (heap base object)";
913 }
914
915 virtual const std::string toString() const;
916};
917
918
928{
929
930 friend class GraphDBClient;
931
932
933public:
935
936 static inline bool classof(const StackObjVar*)
937 {
938 return true;
939 }
940 static inline bool classof(const BaseObjVar* node)
941 {
942 return node->getNodeKind() == StackObjNode;
943 }
944 static inline bool classof(const ObjVar* node)
945 {
946 return node->getNodeKind() == StackObjNode;
947 }
948 static inline bool classof(const SVFVar* node)
949 {
950 return node->getNodeKind() == StackObjNode;
951 }
952 static inline bool classof(const GenericPAGNodeTy* node)
953 {
954 return node->getNodeKind() == StackObjNode;
955 }
956 static inline bool classof(const SVFValue* node)
957 {
958 return node->getNodeKind() == StackObjNode;
959 }
961
964 BaseObjVar(i, ti, node, StackObjNode)
965 {
966 }
967
969 inline const std::string getValueName() const
970 {
971 return " (stack base object)";
972 }
973
974 virtual const std::string toString() const;
975};
976
977
978class CallGraphNode;
979
980class FunObjVar : public BaseObjVar
981{
982 friend class SVFIRBuilder;
983 friend class LLVMModuleSet;
984 friend class GraphDBClient;
985
986protected:
987
989 {
990 exitBlock = bb;
991 }
992
994 {
995 loopAndDom = ld;
996 }
997 inline bool getIsNotRet() const
998 {
999 return isNotRet;
1000 }
1001 inline const std::vector<const ArgValVar*> &getArgs() const
1002 {
1003 return allArgs;
1004 }
1005
1006public:
1010
1011 typedef BasicBlockGraph::IDToNodeMapTy::const_iterator const_bb_iterator;
1012
1013
1014private:
1015 bool isDecl;
1025 std::vector<const ArgValVar*> allArgs;
1027
1028
1029public:
1031
1032 static inline bool classof(const FunObjVar*)
1033 {
1034 return true;
1035 }
1036 static inline bool classof(const BaseObjVar* node)
1037 {
1038 return node->getNodeKind() == FunObjNode;
1039 }
1040 static inline bool classof(const ObjVar* node)
1041 {
1042 return node->getNodeKind() == FunObjNode;
1043 }
1044 static inline bool classof(const SVFVar* node)
1045 {
1046 return node->getNodeKind() == FunObjNode;
1047 }
1048 static inline bool classof(const GenericPAGNodeTy* node)
1049 {
1050 return node->getNodeKind() == FunObjNode;
1051 }
1052 static inline bool classof(const SVFValue* node)
1053 {
1054 return node->getNodeKind() == FunObjNode;
1055 }
1057
1059 FunObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node);
1060
1061
1062 virtual ~FunObjVar()
1063 {
1064 delete loopAndDom;
1065 delete bbGraph;
1066 }
1067
1068 void initFunObjVar(bool decl, bool intrinc, bool addr, bool uncalled, bool notret, bool vararg, const SVFFunctionType *ft,
1070 const std::vector<const ArgValVar *> &allarg, const SVFBasicBlock *exit);
1071
1073 {
1074 realDefFun = real;
1075 }
1076
1077 virtual const FunObjVar*getFunction() const;
1078
1079 inline void addArgument(const ArgValVar *arg)
1080 {
1081 allArgs.push_back(arg);
1082 }
1083 inline bool isDeclaration() const
1084 {
1085 return isDecl;
1086 }
1087
1088 inline bool isIntrinsic() const
1089 {
1090 return intrinsic;
1091 }
1092
1093 inline bool hasAddressTaken() const
1094 {
1095 return isAddrTaken;
1096 }
1097
1098 inline bool isVarArg() const
1099 {
1100 return supVarArg;
1101 }
1102
1103 inline bool isUncalledFunction() const
1104 {
1105 return isUncalled;
1106 }
1107
1108 inline bool hasReturn() const
1109 {
1110 return !isNotRet;
1111 }
1112
1114 inline const SVFFunctionType* getFunctionType() const
1115 {
1116 return funcType;
1117 }
1118
1120 inline const SVFType* getReturnType() const
1121 {
1122 return funcType->getReturnType();
1123 }
1124
1126 {
1127 return loopAndDom;
1128 }
1129
1130 inline const std::vector<const SVFBasicBlock*>& getReachableBBs() const
1131 {
1132 return loopAndDom->getReachableBBs();
1133 }
1134
1135 inline void getExitBlocksOfLoop(const SVFBasicBlock* bb, BBList& exitbbs) const
1136 {
1138 }
1139
1140 inline bool hasLoopInfo(const SVFBasicBlock* bb) const
1141 {
1142 return loopAndDom->hasLoopInfo(bb);
1143 }
1144
1145 const LoopBBs& getLoopInfo(const SVFBasicBlock* bb) const
1146 {
1147 return loopAndDom->getLoopInfo(bb);
1148 }
1149
1150 inline const SVFBasicBlock* getLoopHeader(const BBList& lp) const
1151 {
1152 return loopAndDom->getLoopHeader(lp);
1153 }
1154
1155 inline bool loopContainsBB(const BBList& lp, const SVFBasicBlock* bb) const
1156 {
1157 return loopAndDom->loopContainsBB(lp,bb);
1158 }
1159
1161 {
1162 return loopAndDom->getDomTreeMap();
1163 }
1164
1166 {
1167 return loopAndDom->getDomFrontierMap();
1168 }
1169
1170 inline bool isLoopHeader(const SVFBasicBlock* bb) const
1171 {
1172 return loopAndDom->isLoopHeader(bb);
1173 }
1174
1175 inline bool dominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
1176 {
1178 }
1179
1180 inline bool postDominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
1181 {
1183 }
1184
1186 {
1187 if(realDefFun==nullptr)
1188 return this;
1189 return realDefFun;
1190 }
1191
1193 {
1194 this->bbGraph = graph;
1195 }
1196
1198 {
1199 return bbGraph;
1200 }
1201
1203 {
1204 return bbGraph;
1205 }
1206
1207 inline bool hasBasicBlock() const
1208 {
1209 return bbGraph && bbGraph->begin() != bbGraph->end();
1210 }
1211
1212 inline const SVFBasicBlock* getEntryBlock() const
1213 {
1214 assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1215 assert(bbGraph->begin()->second->getInEdges().size() == 0 && "the first basic block is not entry block");
1216 return bbGraph->begin()->second;
1217 }
1218
1219 inline const SVFBasicBlock* getExitBB() const
1220 {
1221 assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1222 assert(exitBlock && "must have an exitBlock");
1223 return exitBlock;
1224 }
1225
1227 {
1228 assert(!exitBlock && "have already set exit Basicblock!");
1229 exitBlock = bb;
1230 }
1231
1232
1233 u32_t inline arg_size() const
1234 {
1235 return allArgs.size();
1236 }
1237
1238 inline const ArgValVar* getArg(u32_t idx) const
1239 {
1240 assert (idx < allArgs.size() && "getArg() out of range!");
1241 return allArgs[idx];
1242 }
1243 inline const SVFBasicBlock* front() const
1244 {
1245 return getEntryBlock();
1246 }
1247
1248 inline const SVFBasicBlock* back() const
1249 {
1250 assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1254 return std::prev(bbGraph->end())->second;
1255 }
1256
1258 {
1259 return bbGraph->begin();
1260 }
1261
1262 inline const_bb_iterator end() const
1263 {
1264 return bbGraph->end();
1265 }
1266
1267 virtual bool isIsolatedNode() const;
1268
1269 virtual const std::string toString() const;
1270};
1271class FunValVar : public ValVar
1272{
1273
1274 friend class GraphDBClient;
1275
1276protected:
1277 inline void setFunction(const FunObjVar* cgn)
1278 {
1279 funObjVar = cgn;
1280 }
1281
1282private:
1284
1285public:
1287
1288 static inline bool classof(const FunValVar*)
1289 {
1290 return true;
1291 }
1292 static inline bool classof(const ValVar* node)
1293 {
1294 return node->getNodeKind() == FunValNode;
1295 }
1296 static inline bool classof(const SVFVar* node)
1297 {
1298 return node->getNodeKind() == FunValNode;
1299 }
1300 static inline bool classof(const GenericPAGNodeTy* node)
1301 {
1302 return node->getNodeKind() == FunValNode;
1303 }
1304 static inline bool classof(const SVFValue* node)
1305 {
1306 return node->getNodeKind() == FunValNode;
1307 }
1309
1310 inline virtual const FunObjVar* getFunction() const
1311 {
1312 return funObjVar->getFunction();
1313 }
1314
1316 FunValVar(NodeID i, const ICFGNode* icn, const FunObjVar* cgn, const SVFType* svfType);
1317
1318
1319 virtual bool isPointer() const
1320 {
1321 return true;
1322 }
1323
1324 virtual const std::string toString() const;
1325};
1326
1327
1328
1329class GlobalValVar : public ValVar
1330{
1331 friend class GraphDBClient;
1332
1333
1334public:
1336
1337 static inline bool classof(const GlobalValVar*)
1338 {
1339 return true;
1340 }
1341 static inline bool classof(const ValVar* node)
1342 {
1343 return node->getNodeKind() == GlobalValNode;
1344 }
1345 static inline bool classof(const SVFVar* node)
1346 {
1347 return node->getNodeKind() == GlobalValNode;
1348 }
1349 static inline bool classof(const GenericPAGNodeTy* node)
1350 {
1351 return node->getNodeKind() == GlobalValNode;
1352 }
1353 static inline bool classof(const SVFValue* node)
1354 {
1355 return node->getNodeKind() == GlobalValNode;
1356 }
1358
1362 {
1363 type = svfType;
1364 }
1365
1366
1367 virtual const std::string toString() const;
1368};
1369
1371{
1372 friend class GraphDBClient;
1373
1374
1375public:
1377
1378 static inline bool classof(const ConstAggValVar*)
1379 {
1380 return true;
1381 }
1382 static inline bool classof(const ValVar* node)
1383 {
1384 return node->getNodeKind() == ConstAggValNode;
1385 }
1386 static inline bool classof(const SVFVar* node)
1387 {
1388 return node->getNodeKind() == ConstAggValNode;
1389 }
1390 static inline bool classof(const GenericPAGNodeTy* node)
1391 {
1392 return node->getNodeKind() == ConstAggValNode;
1393 }
1394 static inline bool classof(const SVFValue* node)
1395 {
1396 return node->getNodeKind() == ConstAggValNode;
1397 }
1399
1403 {
1404 type = svfTy;
1405 }
1406
1407
1408 virtual bool isConstDataOrAggData() const
1409 {
1410 return true;
1411 }
1412
1414 {
1415 return true;
1416 }
1417
1418 virtual const std::string toString() const;
1419};
1420
1421
1423{
1424 friend class GraphDBClient;
1425
1426
1427public:
1429
1430 static inline bool classof(const ConstDataValVar*)
1431 {
1432 return true;
1433 }
1434 static inline bool classof(const ValVar* node)
1435 {
1436 return isConstantDataValVar(node->getNodeKind());
1437 }
1438 static inline bool classof(const SVFVar* node)
1439 {
1440 return isConstantDataValVar(node->getNodeKind());
1441 }
1442 static inline bool classof(const GenericPAGNodeTy* node)
1443 {
1444 return isConstantDataValVar(node->getNodeKind());
1445 }
1446 static inline bool classof(const SVFValue* node)
1447 {
1448 return isConstantDataValVar(node->getNodeKind());
1449 }
1451
1455 : ValVar(i, svfType, icn, ty)
1456 {
1457
1458 }
1459
1460 virtual bool isConstDataOrAggData() const
1461 {
1462 return true;
1463 }
1464
1466 {
1467 return true;
1468 }
1469
1470 virtual const std::string toString() const;
1471};
1472
1474{
1475
1476 friend class GraphDBClient;
1477public:
1479
1480 static inline bool classof(const BlackHoleValVar*)
1481 {
1482 return true;
1483 }
1484 static inline bool classof(const ConstDataValVar* node)
1485 {
1486 return node->getNodeKind() == BlackHoleValNode;
1487 }
1488 static inline bool classof(const ValVar* node)
1489 {
1490 return node->getNodeKind() == BlackHoleValNode;
1491 }
1492 static inline bool classof(const SVFVar* node)
1493 {
1494 return node->getNodeKind() == BlackHoleValNode;
1495 }
1496 static inline bool classof(const GenericPAGNodeTy* node)
1497 {
1498 return node->getNodeKind() == BlackHoleValNode;
1499 }
1500 static inline bool classof(const SVFValue* node)
1501 {
1502 return node->getNodeKind() == BlackHoleValNode;
1503 }
1505
1512
1514 {
1515 return false;
1516 }
1517
1518 virtual const std::string toString() const
1519 {
1520 return "BlackHoleValVar";
1521 }
1522};
1523
1525{
1526
1527 friend class GraphDBClient;
1528
1529private:
1530 double dval;
1531
1532public:
1534
1535 static inline bool classof(const ConstFPValVar*)
1536 {
1537 return true;
1538 }
1539 static inline bool classof(const ConstDataValVar* node)
1540 {
1541 return node->getNodeKind() == ConstFPValNode;
1542 }
1543 static inline bool classof(const ValVar* node)
1544 {
1545 return node->getNodeKind() == ConstFPValNode;
1546 }
1547 static inline bool classof(const SVFVar* node)
1548 {
1549 return node->getNodeKind() == ConstFPValNode;
1550 }
1551 static inline bool classof(const GenericPAGNodeTy* node)
1552 {
1553 return node->getNodeKind() == ConstFPValNode;
1554 }
1555 static inline bool classof(const SVFValue* node)
1556 {
1557 return node->getNodeKind() == ConstFPValNode;
1558 }
1560
1561 inline double getFPValue() const
1562 {
1563 return dval;
1564 }
1565
1568 const ICFGNode* icn, const SVFType* svfType)
1570 {
1571 }
1572
1573 virtual const std::string toString() const;
1574};
1575
1577{
1578
1579 friend class GraphDBClient;
1580
1581
1582private:
1585
1586public:
1588
1589 static inline bool classof(const ConstIntValVar*)
1590 {
1591 return true;
1592 }
1593 static inline bool classof(const ConstDataValVar* node)
1594 {
1595 return node->getNodeKind() == ConstIntValNode;
1596 }
1597 static inline bool classof(const ValVar* node)
1598 {
1599 return node->getNodeKind() == ConstIntValNode;
1600 }
1601 static inline bool classof(const SVFVar* node)
1602 {
1603 return node->getNodeKind() == ConstIntValNode;
1604 }
1605 static inline bool classof(const GenericPAGNodeTy* node)
1606 {
1607 return node->getNodeKind() == ConstIntValNode;
1608 }
1609 static inline bool classof(const SVFValue* node)
1610 {
1611 return node->getNodeKind() == ConstIntValNode;
1612 }
1614
1616 {
1617 return sval;
1618 }
1619
1620
1622 {
1623 return zval;
1624 }
1625
1632 virtual const std::string toString() const;
1633};
1634
1636{
1637 friend class GraphDBClient;
1638
1639public:
1641
1642 static inline bool classof(const ConstNullPtrValVar*)
1643 {
1644 return true;
1645 }
1646 static inline bool classof(const ConstDataValVar* node)
1647 {
1648 return node->getNodeKind() == ConstNullptrValNode;
1649 }
1650 static inline bool classof(const ValVar* node)
1651 {
1652 return node->getNodeKind() == ConstNullptrValNode;
1653 }
1654 static inline bool classof(const SVFVar* node)
1655 {
1656 return node->getNodeKind() == ConstNullptrValNode;
1657 }
1658 static inline bool classof(const GenericPAGNodeTy* node)
1659 {
1660 return node->getNodeKind() == ConstNullptrValNode;
1661 }
1662 static inline bool classof(const SVFValue* node)
1663 {
1664 return node->getNodeKind() == ConstNullptrValNode;
1665 }
1667
1674
1676 {
1677 return false;
1678 }
1679
1680 virtual const std::string toString() const;
1681};
1682
1684{
1685 friend class GraphDBClient;
1686
1687
1688public:
1690
1691 static inline bool classof(const GlobalObjVar*)
1692 {
1693 return true;
1694 }
1695 static inline bool classof(const BaseObjVar* node)
1696 {
1697 return node->getNodeKind() == GlobalObjNode;
1698 }
1699 static inline bool classof(const ObjVar* node)
1700 {
1701 return node->getNodeKind() == GlobalObjNode;
1702 }
1703 static inline bool classof(const SVFVar* node)
1704 {
1705 return node->getNodeKind() == GlobalObjNode;
1706 }
1707 static inline bool classof(const GenericPAGNodeTy* node)
1708 {
1709 return node->getNodeKind() == GlobalObjNode;
1710 }
1711 static inline bool classof(const SVFValue* node)
1712 {
1713 return node->getNodeKind() == GlobalObjNode;
1714 }
1716
1719 PNODEK ty = GlobalObjNode): BaseObjVar(i, ti, node, ty)
1720 {
1721
1722 }
1723
1724
1725 virtual const std::string toString() const;
1726};
1727
1729{
1730 friend class GraphDBClient;
1731
1732
1733public:
1735
1736 static inline bool classof(const ConstAggObjVar*)
1737 {
1738 return true;
1739 }
1740 static inline bool classof(const BaseObjVar* node)
1741 {
1742 return node->getNodeKind() == ConstAggObjNode;
1743 }
1744
1745 static inline bool classof(const ObjVar* node)
1746 {
1747 return node->getNodeKind() == ConstAggObjNode;
1748 }
1749 static inline bool classof(const SVFVar* node)
1750 {
1751 return node->getNodeKind() == ConstAggObjNode;
1752 }
1753 static inline bool classof(const GenericPAGNodeTy* node)
1754 {
1755 return node->getNodeKind() == ConstAggObjNode;
1756 }
1757 static inline bool classof(const SVFValue* node)
1758 {
1759 return node->getNodeKind() == ConstAggObjNode;
1760 }
1762
1765 : BaseObjVar(i, ti, node, ConstAggObjNode)
1766 {
1767
1768 }
1769
1770 virtual bool isConstDataOrAggData() const
1771 {
1772 return true;
1773 }
1774
1776 {
1777 return true;
1778 }
1779
1780 virtual const std::string toString() const;
1781};
1782
1784{
1785 friend class GraphDBClient;
1786
1787public:
1789 static inline bool classof(const ConstDataObjVar*)
1790 {
1791 return true;
1792 }
1793 static inline bool classof(const BaseObjVar* node)
1794 {
1795 return isConstantDataObjVarKinds(node->getNodeKind());
1796 }
1797 static inline bool classof(const SVFVar* node)
1798 {
1799 return isConstantDataObjVarKinds(node->getNodeKind());
1800 }
1801 static inline bool classof(const ObjVar* node)
1802 {
1803 return isConstantDataObjVarKinds(node->getNodeKind());
1804 }
1805 static inline bool classof(const GenericPAGNodeTy* node)
1806 {
1807 return isConstantDataObjVarKinds(node->getNodeKind());
1808 }
1809
1810 static inline bool classof(const SVFValue* node)
1811 {
1812 return isConstantDataObjVarKinds(node->getNodeKind());
1813 }
1815
1818 : BaseObjVar(i, ti, node, ty)
1819 {
1820 }
1821
1822 virtual bool isConstDataOrAggData() const
1823 {
1824 return true;
1825 }
1826
1828 {
1829 return true;
1830 }
1831
1832 virtual const std::string toString() const;
1833};
1834
1836{
1837
1838 friend class GraphDBClient;
1839
1840
1841private:
1842 float dval;
1843
1844public:
1846 static inline bool classof(const ConstFPObjVar*)
1847 {
1848 return true;
1849 }
1850 static inline bool classof(const ConstDataObjVar* node)
1851 {
1852 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1853 }
1854 static inline bool classof(const BaseObjVar* node)
1855 {
1856 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1857 }
1858
1859 static inline bool classof(const SVFVar* node)
1860 {
1861 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1862 }
1863
1864 static inline bool classof(const ObjVar* node)
1865 {
1866 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1867 }
1868
1869 static inline bool classof(const GenericPAGNodeTy* node)
1870 {
1871 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1872 }
1873
1874 static inline bool classof(const SVFValue* node)
1875 {
1876 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1877 }
1879
1883 {
1884 }
1885
1886 inline double getFPValue() const
1887 {
1888 return dval;
1889 }
1890
1891
1892 virtual const std::string toString() const;
1893};
1894
1896{
1897
1898 friend class GraphDBClient;
1899
1900
1901
1902private:
1905
1906public:
1908 static inline bool classof(const ConstIntObjVar*)
1909 {
1910 return true;
1911 }
1912
1913 static inline bool classof(const ConstDataObjVar* node)
1914 {
1915 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1916 }
1917
1918 static inline bool classof(const BaseObjVar* node)
1919 {
1920 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1921 }
1922
1923 static inline bool classof(const SVFVar* node)
1924 {
1925 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1926 }
1927 static inline bool classof(const ObjVar* node)
1928 {
1929 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1930 }
1931 static inline bool classof(const GenericPAGNodeTy* node)
1932 {
1933 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1934 }
1935
1936 static inline bool classof(const SVFValue* node)
1937 {
1938 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1939 }
1940
1942 {
1943 return sval;
1944 }
1945
1946
1948 {
1949 return zval;
1950 }
1952
1956 {
1957 }
1958
1959 virtual const std::string toString() const;
1960};
1961
1963{
1964
1965 friend class GraphDBClient;
1966
1967public:
1969 static inline bool classof(const ConstNullPtrObjVar*)
1970 {
1971 return true;
1972 }
1973
1974 static inline bool classof(const ConstDataObjVar* node)
1975 {
1976 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1977 }
1978
1979 static inline bool classof(const BaseObjVar* node)
1980 {
1981 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1982 }
1983
1984 static inline bool classof(const SVFVar* node)
1985 {
1986 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1987 }
1988 static inline bool classof(const ObjVar* node)
1989 {
1990 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1991 }
1992 static inline bool classof(const GenericPAGNodeTy* node)
1993 {
1994 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1995 }
1996
1997 static inline bool classof(const SVFValue* node)
1998 {
1999 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
2000 }
2002
2009 {
2010 return false;
2011 }
2012 virtual const std::string toString() const;
2013};
2014/*
2015 * Unique Return node of a procedure
2016 */
2017class RetValPN : public ValVar
2018{
2019 friend class GraphDBClient;
2020
2021protected:
2022 inline void setCallGraphNode(const FunObjVar* node)
2023 {
2024 callGraphNode = node;
2025 }
2026
2027private:
2029
2030public:
2032 static inline bool classof(const RetValPN*)
2033 {
2034 return true;
2035 }
2036 static inline bool classof(const SVFVar* node)
2037 {
2038 return node->getNodeKind() == SVFVar::RetValNode;
2039 }
2040 static inline bool classof(const ValVar* node)
2041 {
2042 return node->getNodeKind() == SVFVar::RetValNode;
2043 }
2044 static inline bool classof(const GenericPAGNodeTy* node)
2045 {
2046 return node->getNodeKind() == SVFVar::RetValNode;
2047 }
2048 static inline bool classof(const SVFValue* node)
2049 {
2050 return node->getNodeKind() == SVFVar::RetValNode;
2051 }
2053
2054
2056 RetValPN(NodeID i, const FunObjVar* node, const SVFType* svfType, const ICFGNode* icn);
2057
2058 inline const FunObjVar* getCallGraphNode() const
2059 {
2060 return callGraphNode;
2061 }
2062
2063 virtual const FunObjVar* getFunction() const;
2064
2065 virtual bool isPointer() const;
2066
2068 const std::string getValueName() const;
2069
2070 virtual const std::string toString() const;
2071};
2072
2073/*
2074 * Unique vararg node of a procedure
2075 */
2076class VarArgValPN : public ValVar
2077{
2078
2079 friend class GraphDBClient;
2080
2081protected:
2082 inline void setCallGraphNode(const FunObjVar* node)
2083 {
2084 callGraphNode = node;
2085 }
2086private:
2088
2089public:
2091 static inline bool classof(const VarArgValPN*)
2092 {
2093 return true;
2094 }
2095 static inline bool classof(const SVFVar* node)
2096 {
2097 return node->getNodeKind() == SVFVar::VarargValNode;
2098 }
2099 static inline bool classof(const ValVar* node)
2100 {
2101 return node->getNodeKind() == SVFVar::VarargValNode;
2102 }
2103 static inline bool classof(const GenericPAGNodeTy* node)
2104 {
2105 return node->getNodeKind() == SVFVar::VarargValNode;
2106 }
2107 static inline bool classof(const SVFValue* node)
2108 {
2109 return node->getNodeKind() == SVFVar::VarargValNode;
2110 }
2112
2114 VarArgValPN(NodeID i, const FunObjVar* node, const SVFType* svfType, const ICFGNode* icn)
2116 {
2117 assert((node->isDeclaration() || icn) &&
2118 "VarArgValPN of a defined function must have a valid ICFGNode");
2119 }
2120
2121 virtual const FunObjVar* getFunction() const;
2122
2124 const std::string getValueName() const;
2125
2126 virtual bool isPointer() const
2127 {
2128 return true;
2129 }
2130 virtual const std::string toString() const;
2131};
2132
2133/*
2134 * Dummy variable without any LLVM value
2135 */
2136class DummyValVar: public ValVar
2137{
2138 friend class GraphDBClient;
2139
2140public:
2142 static inline bool classof(const DummyValVar*)
2143 {
2144 return true;
2145 }
2146 static inline bool classof(const SVFVar* node)
2147 {
2148 return node->getNodeKind() == SVFVar::DummyValNode;
2149 }
2150 static inline bool classof(const ValVar* node)
2151 {
2152 return node->getNodeKind() == SVFVar::DummyValNode;
2153 }
2154 static inline bool classof(const GenericPAGNodeTy* node)
2155 {
2156 return node->getNodeKind() == SVFVar::DummyValNode;
2157 }
2158 static inline bool classof(const SVFValue* node)
2159 {
2160 return node->getNodeKind() == SVFVar::DummyValNode;
2161 }
2163
2166 : ValVar(i, svfType, node, DummyValNode)
2167 {
2168 }
2169
2171 inline const std::string getValueName() const
2172 {
2173 return "dummyVal";
2174 }
2175
2176 virtual bool isPointer() const
2177 {
2178 return true;
2179 }
2180
2181 virtual const std::string toString() const;
2182};
2183
2184/*
2185 * Represents an LLVM intrinsic call instruction (e.g. llvm.dbg.declare).
2186 * These are collected into valSyms but have no corresponding ICFGNode.
2187 */
2189{
2190 friend class GraphDBClient;
2191
2192public:
2194 static inline bool classof(const IntrinsicValVar*)
2195 {
2196 return true;
2197 }
2198 static inline bool classof(const SVFVar* node)
2199 {
2200 return node->getNodeKind() == SVFVar::IntrinsicValNode;
2201 }
2202 static inline bool classof(const ValVar* node)
2203 {
2204 return node->getNodeKind() == SVFVar::IntrinsicValNode;
2205 }
2206 static inline bool classof(const GenericPAGNodeTy* node)
2207 {
2208 return node->getNodeKind() == SVFVar::IntrinsicValNode;
2209 }
2210 static inline bool classof(const SVFValue* node)
2211 {
2212 return node->getNodeKind() == SVFVar::IntrinsicValNode;
2213 }
2215
2220
2221 inline const std::string getValueName() const
2222 {
2223 return "intrinsicVal";
2224 }
2225
2226 virtual const std::string toString() const;
2227};
2228
2229/*
2230 * Represents InlineAsm, DSOLocalEquivalent, and NoCFIValue.
2231 * These are non-instruction values related to inline assembly,
2232 * position-independent code (PIC), or control-flow integrity (CFI).
2233 * They have no corresponding ICFGNode.
2234 */
2235class AsmPCValVar: public ValVar
2236{
2237 friend class GraphDBClient;
2238
2239public:
2240 static inline bool classof(const AsmPCValVar*)
2241 {
2242 return true;
2243 }
2244 static inline bool classof(const SVFVar* node)
2245 {
2246 return node->getNodeKind() == SVFVar::AsmPCValNode;
2247 }
2248 static inline bool classof(const ValVar* node)
2249 {
2250 return node->getNodeKind() == SVFVar::AsmPCValNode;
2251 }
2252 static inline bool classof(const GenericPAGNodeTy* node)
2253 {
2254 return node->getNodeKind() == SVFVar::AsmPCValNode;
2255 }
2256 static inline bool classof(const SVFValue* node)
2257 {
2258 return node->getNodeKind() == SVFVar::AsmPCValNode;
2259 }
2260
2263
2264 inline const std::string getValueName() const
2265 {
2266 return "asmPCVal";
2267 }
2268 virtual const std::string toString() const;
2269};
2270
2271/*
2272 * Dummy object variable
2273 */
2275{
2276
2277 friend class GraphDBClient;
2278
2279
2280public:
2282 static inline bool classof(const DummyObjVar*)
2283 {
2284 return true;
2285 }
2286 static inline bool classof(const BaseObjVar* node)
2287 {
2288 return node->getNodeKind() == SVFVar::DummyObjNode;
2289 }
2290 static inline bool classof(const SVFVar* node)
2291 {
2292 return node->getNodeKind() == SVFVar::DummyObjNode;
2293 }
2294 static inline bool classof(const ObjVar* node)
2295 {
2296 return node->getNodeKind() == SVFVar::DummyObjNode;
2297 }
2298 static inline bool classof(const GenericPAGNodeTy* node)
2299 {
2300 return node->getNodeKind() == SVFVar::DummyObjNode;
2301 }
2302
2303 static inline bool classof(const SVFValue* node)
2304 {
2305 return node->getNodeKind() == SVFVar::DummyObjNode;
2306 }
2308
2311 : BaseObjVar(i, ti, node, DummyObjNode)
2312 {
2313 }
2314
2316 inline const std::string getValueName() const
2317 {
2318 return "dummyObj";
2319 }
2320
2321 virtual bool isPointer() const
2322 {
2323 return true;
2324 }
2325
2326 virtual const std::string toString() const;
2327};
2328
2329} // End namespace SVF
2330
2331#endif /* INCLUDE_SVFIR_SVFVARIABLE_H_ */
APOffset getConstantStructFldIdx() const
Get methods.
Definition AccessPath.h:102
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.
static bool classof(const GenericPAGNodeTy *node)
static bool classof(const SVFVar *node)
virtual const std::string toString() const
Get string representation.
static bool classof(const AsmPCValVar *)
static bool classof(const SVFValue *node)
AsmPCValVar(NodeID i, const SVFType *svfType)
friend class GraphDBClient
static bool classof(const ValVar *node)
const std::string getValueName() const
Get string name of the represented LLVM value.
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)
const std::string getValueName() const
Get string name of the represented LLVM value.
static bool classof(const SVFVar *node)
static bool classof(const SVFValue *node)
static bool classof(const GenericPAGNodeTy *node)
IntrinsicValVar(NodeID i, const SVFType *svfType)
static bool classof(const ValVar *node)
friend class GraphDBClient
virtual const std::string toString() const
Get string representation.
static bool classof(const IntrinsicValVar *)
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.
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:401
const LoopBBs & getLoopInfo(const SVFBasicBlock *bb) const
Definition SVFValue.cpp:77
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:103
bool isLoopHeader(const SVFBasicBlock *bb) const
Definition SVFValue.cpp:190
void getExitBlocksOfLoop(const SVFBasicBlock *bb, BBList &exitbbs) const
Definition SVFValue.cpp:84
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:134
GenericNode< SVFVar, SVFStmt >::GEdgeSetTy SVFStmtSetTy
PAGEdgeToSetMapTy KindToSVFStmtMapTy
static SVFType * getSVFPtrType()
Definition SVFType.h:216
bool isPointerTy() const
Definition SVFType.h:292
@ ConstNullptrObjNode
Definition SVFValue.h:100
@ ConstNullptrValNode
Definition SVFValue.h:79
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
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:70
unsigned long long u64_t
Definition GeneralType.h:69
GenericNode< SVFVar, SVFStmt > GenericPAGNodeTy
u32_t NodeID
Definition GeneralType.h:76
s64_t APOffset
Definition GeneralType.h:80
std::ostream OutStream
Definition GeneralType.h:66
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76
unsigned u32_t
Definition GeneralType.h:67
signed long long s64_t
Definition GeneralType.h:70