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
263protected:
264
265 inline void setICFGNode(const ICFGNode* icfgNode)
266 {
267 this->icfgNode = icfgNode;
268 }
269public:
271
272 static inline bool classof(const ValVar*)
273 {
274 return true;
275 }
276 static inline bool classof(const SVFVar* node)
277 {
278 return isValVarKinds(node->getNodeKind());
279 }
280 static inline bool classof(const GenericPAGNodeTy* node)
281 {
282 return isValVarKinds(node->getNodeKind());
283 }
284 static inline bool classof(const SVFValue* node)
285 {
286 return isValVarKinds(node->getNodeKind());
287 }
289
292 : SVFVar(i, svfType, ty), icfgNode(node)
293 {
294 }
296 inline const std::string getValueName() const
297 {
298 return getName();
299 }
300
301 const ICFGNode* getICFGNode() const
302 {
303 return icfgNode;
304 }
305
306 virtual const FunObjVar* getFunction() const;
307
308 virtual const std::string toString() const;
309
310 std::string getValVarNodeFieldsStmt() const;
311
312};
313
314/*
315 * Memory Object variable
316 */
317class ObjVar: public SVFVar
318{
319 friend class GraphDBClient;
320
321protected:
324 SVFVar(i, svfType, ty)
325 {
326 }
327public:
329
330 static inline bool classof(const ObjVar*)
331 {
332 return true;
333 }
334 static inline bool classof(const SVFVar* node)
335 {
336 return isObjVarKinds(node->getNodeKind());
337 }
338 static inline bool classof(const GenericPAGNodeTy* node)
339 {
340 return isObjVarKinds(node->getNodeKind());
341 }
342 static inline bool classof(const SVFValue* node)
343 {
344 return isObjVarKinds(node->getNodeKind());
345 }
347
349 virtual const std::string getValueName() const
350 {
351 return getName();
352 }
353
354 virtual const std::string toString() const;
355
356 std::string getObjVarNodeFieldsStmt() const;
357
358};
359
360
367class ArgValVar: public ValVar
368{
369 friend class GraphDBClient;
370
371private:
374
375public:
377
378 static inline bool classof(const ArgValVar*)
379 {
380 return true;
381 }
382 static inline bool classof(const ValVar* node)
383 {
384 return node->getNodeKind() == ArgValNode;
385 }
386 static inline bool classof(const SVFVar* node)
387 {
388 return node->getNodeKind() == ArgValNode;
389 }
390 static inline bool classof(const GenericPAGNodeTy* node)
391 {
392 return node->getNodeKind() == ArgValNode;
393 }
394 static inline bool classof(const SVFValue* node)
395 {
396 return node->getNodeKind() == ArgValNode;
397 }
399
401 ArgValVar(NodeID i, u32_t argNo, const ICFGNode* icn, const FunObjVar* callGraphNode,
402 const SVFType* svfType);
403
405 inline const std::string getValueName() const
406 {
407 return getName() + " (argument valvar)";
408 }
409
410 inline void addCGNodeFromDB(const FunObjVar* cgNode)
411 {
412 this->cgNode = cgNode;
413 }
414
415 virtual const FunObjVar* getFunction() const;
416
417 const FunObjVar* getParent() const;
418
421 inline u32_t getArgNo() const
422 {
423 return argNo;
424 }
425
426 bool isArgOfUncalledFunction() const;
427
428 virtual bool isPointer() const;
429
430 virtual const std::string toString() const;
431};
432
433
434/*
435 * Gep Value (Pointer) variable, this variable can be dynamic generated for field sensitive analysis
436 * e.g. memcpy, temp gep value variable needs to be created
437 * Each Gep Value variable is connected to base value variable via gep edge
438 */
439class GepValVar: public ValVar
440{
441 friend class GraphDBClient;
442
443private:
444 AccessPath ap; // AccessPath
445 const ValVar* base; // base node
448
449
450public:
452
453 static inline bool classof(const GepValVar *)
454 {
455 return true;
456 }
457 static inline bool classof(const ValVar * node)
458 {
459 return node->getNodeKind() == SVFVar::GepValNode;
460 }
461 static inline bool classof(const SVFVar *node)
462 {
463 return node->getNodeKind() == SVFVar::GepValNode;
464 }
465 static inline bool classof(const GenericPAGNodeTy *node)
466 {
467 return node->getNodeKind() == SVFVar::GepValNode;
468 }
469 static inline bool classof(const SVFValue* node)
470 {
471 return node->getNodeKind() == SVFVar::GepValNode;
472 }
473
474 inline const AccessPath& getAccessPath() const
475 {
476 return ap;
477 }
478
479 inline const void setAccessPath(const AccessPath* ap)
480 {
481 this->ap = *ap;
482 }
484
486 GepValVar(const ValVar* baseNode, NodeID i, const AccessPath& ap,
487 const SVFType* ty, const ICFGNode* node);
488
491 {
493 }
494
496 inline const ValVar* getBaseNode(void) const
497 {
498 return base;
499 }
500 inline void setBaseNode(const ValVar* baseNode)
501 {
502 base = baseNode;
503 }
504
506 inline const std::string getValueName() const
507 {
508 return getName() + "_" +
509 std::to_string(getConstantFieldIdx());
510 }
511
512 virtual bool isPointer() const
513 {
514 return base->isPointer();
515 }
516
517 inline const SVFType* getType() const
518 {
519 return gepValType;
520 }
521
522 virtual const FunObjVar* getFunction() const
523 {
524 return base->getFunction();
525 }
526
527 virtual const std::string toString() const;
528
530 {
532 }
533 virtual inline bool ptrInUncalledFunction() const
534 {
535 return base->ptrInUncalledFunction();
536 }
537
538 virtual inline bool isConstDataOrAggData() const
539 {
540 return base->isConstDataOrAggData();
541 }
542
545 {
546 return llvmVarID;
547 }
548
550 inline void setLLVMVarInstID(NodeID id)
551 {
552 llvmVarID = id;
553 }
554};
555
556/*
557 * Base memory object variable (address-taken variables in LLVM-based languages)
558 */
559class BaseObjVar : public ObjVar
560{
561 friend class SVFIRBuilder;
562 friend class GraphDBClient;
563
564private:
566
568
569public:
571
572 static inline bool classof(const BaseObjVar*)
573 {
574 return true;
575 }
576 static inline bool classof(const ObjVar* node)
577 {
578 return isBaseObjVarKinds(node->getNodeKind());
579 }
580 static inline bool classof(const SVFVar* node)
581 {
582 return isBaseObjVarKinds(node->getNodeKind());
583 }
584 static inline bool classof(const GenericPAGNodeTy* node)
585 {
586 return isBaseObjVarKinds(node->getNodeKind());
587 }
588 static inline bool classof(const SVFValue* node)
589 {
590 return isBaseObjVarKinds(node->getNodeKind());
591 }
593
596 : ObjVar(i, ti->getType(), ty), typeInfo(ti), icfgNode(node)
597 {
598 }
599
600 virtual const BaseObjVar* getBaseMemObj() const
601 {
602 return this;
603 }
604
605 inline const ObjTypeInfo* getTypeInfo() const
606 {
607 return typeInfo;
608 }
610 {
611 return typeInfo;
612 }
613
615 inline const ICFGNode* getICFGNode() const
616 {
617 return icfgNode;
618 }
619
620 inline void setICFGNode(const ICFGNode* node)
621 {
622 icfgNode = node;
623 }
624
626 inline const std::string getValueName() const
627 {
628 return getName() + " (base object)";
629 }
630
631 virtual const std::string toString() const;
632
634 inline NodeID getId() const
635 {
636 return id;
637 }
638
640 const SVFType* getType() const
641 {
642 return typeInfo->getType();
643 }
644
647 {
648 return typeInfo->getNumOfElements();
649 }
650
653 {
655 }
656
662
663
666 {
667 return getMaxFieldOffsetLimit() == 0;
668 }
669
675
676
682
684 bool isBlackHoleObj() const;
685
688 {
689 return typeInfo->getByteSizeOfObj();
690 }
691
694 {
696 }
697
698
700
701 bool isFunction() const
702 {
703 return typeInfo->isFunction();
704 }
705 bool isGlobalObj() const
706 {
707 return typeInfo->isGlobalObj();
708 }
709 bool isStaticObj() const
710 {
711 return typeInfo->isStaticObj();
712 }
713 bool isStack() const
714 {
715 return typeInfo->isStack();
716 }
717 bool isHeap() const
718 {
719 return typeInfo->isHeap();
720 }
721 bool isStruct() const
722 {
723 return typeInfo->isStruct();
724 }
725 bool isArray() const
726 {
727 return typeInfo->isArray();
728 }
729 bool isVarStruct() const
730 {
731 return typeInfo->isVarStruct();
732 }
733 bool isVarArray() const
734 {
735 return typeInfo->isVarArray();
736 }
737 bool isConstantStruct() const
738 {
739 return typeInfo->isConstantStruct();
740 }
741 bool isConstantArray() const
742 {
743 return typeInfo->isConstantArray();
744 }
746 {
748 }
749 virtual inline bool isConstDataOrAggData() const
750 {
752 }
754
756 void destroy()
757 {
758 delete typeInfo;
759 typeInfo = nullptr;
760 }
761
762 virtual const FunObjVar* getFunction() const;
763
764};
765
766
767/*
768 * Gep Obj variable, this is dynamic generated for field sensitive analysis
769 * Each gep obj variable is one field of a BaseObjVar (base)
770 */
771class GepObjVar: public ObjVar
772{
773 friend class GraphDBClient;
774
775
776private:
778
780
781public:
783
784 static inline bool classof(const GepObjVar*)
785 {
786 return true;
787 }
788 static inline bool classof(const ObjVar* node)
789 {
790 return node->getNodeKind() == SVFVar::GepObjNode;
791 }
792 static inline bool classof(const SVFVar* node)
793 {
794 return node->getNodeKind() == SVFVar::GepObjNode;
795 }
796 static inline bool classof(const GenericPAGNodeTy* node)
797 {
798 return node->getNodeKind() == SVFVar::GepObjNode;
799 }
800 static inline bool classof(const SVFValue* node)
801 {
802 return node->getNodeKind() == SVFVar::GepObjNode;
803 }
805
812
815 {
816 return apOffset;
817 }
818
820 inline NodeID getBaseNode(void) const
821 {
822 return base->getId();
823 }
824
825 inline const BaseObjVar* getBaseObj() const
826 {
827 return base;
828 }
829
831 inline virtual const SVFType* getType() const;
832
833
835 inline const std::string getValueName() const
836 {
837 return getName() + "_" + std::to_string(apOffset);
838 }
839
840 virtual const FunObjVar* getFunction() const
841 {
842 return base->getFunction();
843 }
844
845 virtual const std::string toString() const;
846
847 virtual inline bool ptrInUncalledFunction() const
848 {
849 return base->ptrInUncalledFunction();
850 }
851
852 virtual inline bool isConstDataOrAggData() const
853 {
854 return base->isConstDataOrAggData();
855 }
856
858 {
860 }
861
862 virtual bool isPointer() const
863 {
864 return base->isPointer();
865 }
866};
867
868
869
877{
878
879 friend class GraphDBClient;
880
881public:
883
884 static inline bool classof(const HeapObjVar*)
885 {
886 return true;
887 }
888 static inline bool classof(const BaseObjVar* node)
889 {
890 return node->getNodeKind() == HeapObjNode;
891 }
892 static inline bool classof(const ObjVar* node)
893 {
894 return node->getNodeKind() == HeapObjNode;
895 }
896 static inline bool classof(const SVFVar* node)
897 {
898 return node->getNodeKind() == HeapObjNode;
899 }
900 static inline bool classof(const GenericPAGNodeTy* node)
901 {
902 return node->getNodeKind() == HeapObjNode;
903 }
904 static inline bool classof(const SVFValue* node)
905 {
906 return node->getNodeKind() == HeapObjNode;
907 }
909
912 BaseObjVar(i, ti, node, HeapObjNode)
913 {
914 }
915
917 inline const std::string getValueName() const
918 {
919 return " (heap base object)";
920 }
921
922 virtual const std::string toString() const;
923};
924
925
935{
936
937 friend class GraphDBClient;
938
939
940public:
942
943 static inline bool classof(const StackObjVar*)
944 {
945 return true;
946 }
947 static inline bool classof(const BaseObjVar* node)
948 {
949 return node->getNodeKind() == StackObjNode;
950 }
951 static inline bool classof(const ObjVar* node)
952 {
953 return node->getNodeKind() == StackObjNode;
954 }
955 static inline bool classof(const SVFVar* node)
956 {
957 return node->getNodeKind() == StackObjNode;
958 }
959 static inline bool classof(const GenericPAGNodeTy* node)
960 {
961 return node->getNodeKind() == StackObjNode;
962 }
963 static inline bool classof(const SVFValue* node)
964 {
965 return node->getNodeKind() == StackObjNode;
966 }
968
971 BaseObjVar(i, ti, node, StackObjNode)
972 {
973 }
974
976 inline const std::string getValueName() const
977 {
978 return " (stack base object)";
979 }
980
981 virtual const std::string toString() const;
982};
983
984
985class CallGraphNode;
986
987class FunObjVar : public BaseObjVar
988{
989 friend class SVFIRBuilder;
990 friend class LLVMModuleSet;
991 friend class GraphDBClient;
992
993protected:
994
996 {
997 exitBlock = bb;
998 }
999
1001 {
1002 loopAndDom = ld;
1003 }
1004 inline bool getIsNotRet() const
1005 {
1006 return isNotRet;
1007 }
1008 inline const std::vector<const ArgValVar*> &getArgs() const
1009 {
1010 return allArgs;
1011 }
1012
1013public:
1017
1018 typedef BasicBlockGraph::IDToNodeMapTy::const_iterator const_bb_iterator;
1019
1020
1021private:
1022 bool isDecl;
1032 std::vector<const ArgValVar*> allArgs;
1034
1035
1036public:
1038
1039 static inline bool classof(const FunObjVar*)
1040 {
1041 return true;
1042 }
1043 static inline bool classof(const BaseObjVar* node)
1044 {
1045 return node->getNodeKind() == FunObjNode;
1046 }
1047 static inline bool classof(const ObjVar* node)
1048 {
1049 return node->getNodeKind() == FunObjNode;
1050 }
1051 static inline bool classof(const SVFVar* node)
1052 {
1053 return node->getNodeKind() == FunObjNode;
1054 }
1055 static inline bool classof(const GenericPAGNodeTy* node)
1056 {
1057 return node->getNodeKind() == FunObjNode;
1058 }
1059 static inline bool classof(const SVFValue* node)
1060 {
1061 return node->getNodeKind() == FunObjNode;
1062 }
1064
1066 FunObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node);
1067
1068
1069 virtual ~FunObjVar()
1070 {
1071 delete loopAndDom;
1072 delete bbGraph;
1073 }
1074
1075 void initFunObjVar(bool decl, bool intrinc, bool addr, bool uncalled, bool notret, bool vararg, const SVFFunctionType *ft,
1077 const std::vector<const ArgValVar *> &allarg, const SVFBasicBlock *exit);
1078
1080 {
1081 realDefFun = real;
1082 }
1083
1084 virtual const FunObjVar*getFunction() const;
1085
1086 inline void addArgument(const ArgValVar *arg)
1087 {
1088 allArgs.push_back(arg);
1089 }
1090 inline bool isDeclaration() const
1091 {
1092 return isDecl;
1093 }
1094
1095 inline bool isIntrinsic() const
1096 {
1097 return intrinsic;
1098 }
1099
1100 inline bool hasAddressTaken() const
1101 {
1102 return isAddrTaken;
1103 }
1104
1105 inline bool isVarArg() const
1106 {
1107 return supVarArg;
1108 }
1109
1110 inline bool isUncalledFunction() const
1111 {
1112 return isUncalled;
1113 }
1114
1115 inline bool hasReturn() const
1116 {
1117 return !isNotRet;
1118 }
1119
1121 inline const SVFFunctionType* getFunctionType() const
1122 {
1123 return funcType;
1124 }
1125
1127 inline const SVFType* getReturnType() const
1128 {
1129 return funcType->getReturnType();
1130 }
1131
1133 {
1134 return loopAndDom;
1135 }
1136
1137 inline const std::vector<const SVFBasicBlock*>& getReachableBBs() const
1138 {
1139 return loopAndDom->getReachableBBs();
1140 }
1141
1142 inline void getExitBlocksOfLoop(const SVFBasicBlock* bb, BBList& exitbbs) const
1143 {
1145 }
1146
1147 inline bool hasLoopInfo(const SVFBasicBlock* bb) const
1148 {
1149 return loopAndDom->hasLoopInfo(bb);
1150 }
1151
1152 const LoopBBs& getLoopInfo(const SVFBasicBlock* bb) const
1153 {
1154 return loopAndDom->getLoopInfo(bb);
1155 }
1156
1157 inline const SVFBasicBlock* getLoopHeader(const BBList& lp) const
1158 {
1159 return loopAndDom->getLoopHeader(lp);
1160 }
1161
1162 inline bool loopContainsBB(const BBList& lp, const SVFBasicBlock* bb) const
1163 {
1164 return loopAndDom->loopContainsBB(lp,bb);
1165 }
1166
1168 {
1169 return loopAndDom->getDomTreeMap();
1170 }
1171
1173 {
1174 return loopAndDom->getDomFrontierMap();
1175 }
1176
1177 inline bool isLoopHeader(const SVFBasicBlock* bb) const
1178 {
1179 return loopAndDom->isLoopHeader(bb);
1180 }
1181
1182 inline bool dominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
1183 {
1185 }
1186
1187 inline bool postDominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
1188 {
1190 }
1191
1193 {
1194 if(realDefFun==nullptr)
1195 return this;
1196 return realDefFun;
1197 }
1198
1200 {
1201 this->bbGraph = graph;
1202 }
1203
1205 {
1206 return bbGraph;
1207 }
1208
1210 {
1211 return bbGraph;
1212 }
1213
1214 inline bool hasBasicBlock() const
1215 {
1216 return bbGraph && bbGraph->begin() != bbGraph->end();
1217 }
1218
1219 inline const SVFBasicBlock* getEntryBlock() const
1220 {
1221 assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1222 assert(bbGraph->begin()->second->getInEdges().size() == 0 && "the first basic block is not entry block");
1223 return bbGraph->begin()->second;
1224 }
1225
1226 inline const SVFBasicBlock* getExitBB() const
1227 {
1228 assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1229 assert(exitBlock && "must have an exitBlock");
1230 return exitBlock;
1231 }
1232
1234 {
1235 assert(!exitBlock && "have already set exit Basicblock!");
1236 exitBlock = bb;
1237 }
1238
1239
1240 u32_t inline arg_size() const
1241 {
1242 return allArgs.size();
1243 }
1244
1245 inline const ArgValVar* getArg(u32_t idx) const
1246 {
1247 assert (idx < allArgs.size() && "getArg() out of range!");
1248 return allArgs[idx];
1249 }
1250 inline const SVFBasicBlock* front() const
1251 {
1252 return getEntryBlock();
1253 }
1254
1255 inline const SVFBasicBlock* back() const
1256 {
1257 assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1261 return std::prev(bbGraph->end())->second;
1262 }
1263
1265 {
1266 return bbGraph->begin();
1267 }
1268
1269 inline const_bb_iterator end() const
1270 {
1271 return bbGraph->end();
1272 }
1273
1274 virtual bool isIsolatedNode() const;
1275
1276 virtual const std::string toString() const;
1277};
1278class FunValVar : public ValVar
1279{
1280
1281 friend class GraphDBClient;
1282
1283protected:
1284 inline void setFunction(const FunObjVar* cgn)
1285 {
1286 funObjVar = cgn;
1287 }
1288
1289private:
1291
1292public:
1294
1295 static inline bool classof(const FunValVar*)
1296 {
1297 return true;
1298 }
1299 static inline bool classof(const ValVar* node)
1300 {
1301 return node->getNodeKind() == FunValNode;
1302 }
1303 static inline bool classof(const SVFVar* node)
1304 {
1305 return node->getNodeKind() == FunValNode;
1306 }
1307 static inline bool classof(const GenericPAGNodeTy* node)
1308 {
1309 return node->getNodeKind() == FunValNode;
1310 }
1311 static inline bool classof(const SVFValue* node)
1312 {
1313 return node->getNodeKind() == FunValNode;
1314 }
1316
1317 inline virtual const FunObjVar* getFunction() const
1318 {
1319 return funObjVar->getFunction();
1320 }
1321
1323 FunValVar(NodeID i, const ICFGNode* icn, const FunObjVar* cgn, const SVFType* svfType);
1324
1325
1326 virtual bool isPointer() const
1327 {
1328 return true;
1329 }
1330
1331 virtual const std::string toString() const;
1332};
1333
1334
1335
1336class GlobalValVar : public ValVar
1337{
1338 friend class GraphDBClient;
1339
1340
1341public:
1343
1344 static inline bool classof(const GlobalValVar*)
1345 {
1346 return true;
1347 }
1348 static inline bool classof(const ValVar* node)
1349 {
1350 return node->getNodeKind() == GlobalValNode;
1351 }
1352 static inline bool classof(const SVFVar* node)
1353 {
1354 return node->getNodeKind() == GlobalValNode;
1355 }
1356 static inline bool classof(const GenericPAGNodeTy* node)
1357 {
1358 return node->getNodeKind() == GlobalValNode;
1359 }
1360 static inline bool classof(const SVFValue* node)
1361 {
1362 return node->getNodeKind() == GlobalValNode;
1363 }
1365
1369 {
1370 type = svfType;
1371 }
1372
1373
1374 virtual const std::string toString() const;
1375};
1376
1378{
1379 friend class GraphDBClient;
1380
1381
1382public:
1384
1385 static inline bool classof(const ConstAggValVar*)
1386 {
1387 return true;
1388 }
1389 static inline bool classof(const ValVar* node)
1390 {
1391 return node->getNodeKind() == ConstAggValNode;
1392 }
1393 static inline bool classof(const SVFVar* node)
1394 {
1395 return node->getNodeKind() == ConstAggValNode;
1396 }
1397 static inline bool classof(const GenericPAGNodeTy* node)
1398 {
1399 return node->getNodeKind() == ConstAggValNode;
1400 }
1401 static inline bool classof(const SVFValue* node)
1402 {
1403 return node->getNodeKind() == ConstAggValNode;
1404 }
1406
1410 {
1411 type = svfTy;
1412 }
1413
1414
1415 virtual bool isConstDataOrAggData() const
1416 {
1417 return true;
1418 }
1419
1421 {
1422 return true;
1423 }
1424
1425 virtual const std::string toString() const;
1426};
1427
1428
1430{
1431 friend class GraphDBClient;
1432
1433
1434public:
1436
1437 static inline bool classof(const ConstDataValVar*)
1438 {
1439 return true;
1440 }
1441 static inline bool classof(const ValVar* node)
1442 {
1443 return isConstantDataValVar(node->getNodeKind());
1444 }
1445 static inline bool classof(const SVFVar* node)
1446 {
1447 return isConstantDataValVar(node->getNodeKind());
1448 }
1449 static inline bool classof(const GenericPAGNodeTy* node)
1450 {
1451 return isConstantDataValVar(node->getNodeKind());
1452 }
1453 static inline bool classof(const SVFValue* node)
1454 {
1455 return isConstantDataValVar(node->getNodeKind());
1456 }
1458
1462 : ValVar(i, svfType, icn, ty)
1463 {
1464
1465 }
1466
1467 virtual bool isConstDataOrAggData() const
1468 {
1469 return true;
1470 }
1471
1473 {
1474 return true;
1475 }
1476
1477 virtual const std::string toString() const;
1478};
1479
1481{
1482
1483 friend class GraphDBClient;
1484public:
1486
1487 static inline bool classof(const BlackHoleValVar*)
1488 {
1489 return true;
1490 }
1491 static inline bool classof(const ConstDataValVar* node)
1492 {
1493 return node->getNodeKind() == BlackHoleValNode;
1494 }
1495 static inline bool classof(const ValVar* node)
1496 {
1497 return node->getNodeKind() == BlackHoleValNode;
1498 }
1499 static inline bool classof(const SVFVar* node)
1500 {
1501 return node->getNodeKind() == BlackHoleValNode;
1502 }
1503 static inline bool classof(const GenericPAGNodeTy* node)
1504 {
1505 return node->getNodeKind() == BlackHoleValNode;
1506 }
1507 static inline bool classof(const SVFValue* node)
1508 {
1509 return node->getNodeKind() == BlackHoleValNode;
1510 }
1512
1519
1521 {
1522 return false;
1523 }
1524
1525 virtual const std::string toString() const
1526 {
1527 return "BlackHoleValVar";
1528 }
1529};
1530
1532{
1533
1534 friend class GraphDBClient;
1535
1536private:
1537 double dval;
1538
1539public:
1541
1542 static inline bool classof(const ConstFPValVar*)
1543 {
1544 return true;
1545 }
1546 static inline bool classof(const ConstDataValVar* node)
1547 {
1548 return node->getNodeKind() == ConstFPValNode;
1549 }
1550 static inline bool classof(const ValVar* node)
1551 {
1552 return node->getNodeKind() == ConstFPValNode;
1553 }
1554 static inline bool classof(const SVFVar* node)
1555 {
1556 return node->getNodeKind() == ConstFPValNode;
1557 }
1558 static inline bool classof(const GenericPAGNodeTy* node)
1559 {
1560 return node->getNodeKind() == ConstFPValNode;
1561 }
1562 static inline bool classof(const SVFValue* node)
1563 {
1564 return node->getNodeKind() == ConstFPValNode;
1565 }
1567
1568 inline double getFPValue() const
1569 {
1570 return dval;
1571 }
1572
1575 const ICFGNode* icn, const SVFType* svfType)
1577 {
1578 }
1579
1580 virtual const std::string toString() const;
1581};
1582
1584{
1585
1586 friend class GraphDBClient;
1587
1588
1589private:
1592
1593public:
1595
1596 static inline bool classof(const ConstIntValVar*)
1597 {
1598 return true;
1599 }
1600 static inline bool classof(const ConstDataValVar* node)
1601 {
1602 return node->getNodeKind() == ConstIntValNode;
1603 }
1604 static inline bool classof(const ValVar* node)
1605 {
1606 return node->getNodeKind() == ConstIntValNode;
1607 }
1608 static inline bool classof(const SVFVar* node)
1609 {
1610 return node->getNodeKind() == ConstIntValNode;
1611 }
1612 static inline bool classof(const GenericPAGNodeTy* node)
1613 {
1614 return node->getNodeKind() == ConstIntValNode;
1615 }
1616 static inline bool classof(const SVFValue* node)
1617 {
1618 return node->getNodeKind() == ConstIntValNode;
1619 }
1621
1623 {
1624 return sval;
1625 }
1626
1627
1629 {
1630 return zval;
1631 }
1632
1639 virtual const std::string toString() const;
1640};
1641
1643{
1644 friend class GraphDBClient;
1645
1646public:
1648
1649 static inline bool classof(const ConstNullPtrValVar*)
1650 {
1651 return true;
1652 }
1653 static inline bool classof(const ConstDataValVar* node)
1654 {
1655 return node->getNodeKind() == ConstNullptrValNode;
1656 }
1657 static inline bool classof(const ValVar* node)
1658 {
1659 return node->getNodeKind() == ConstNullptrValNode;
1660 }
1661 static inline bool classof(const SVFVar* node)
1662 {
1663 return node->getNodeKind() == ConstNullptrValNode;
1664 }
1665 static inline bool classof(const GenericPAGNodeTy* node)
1666 {
1667 return node->getNodeKind() == ConstNullptrValNode;
1668 }
1669 static inline bool classof(const SVFValue* node)
1670 {
1671 return node->getNodeKind() == ConstNullptrValNode;
1672 }
1674
1681
1683 {
1684 return false;
1685 }
1686
1687 virtual const std::string toString() const;
1688};
1689
1691{
1692 friend class GraphDBClient;
1693
1694
1695public:
1697
1698 static inline bool classof(const GlobalObjVar*)
1699 {
1700 return true;
1701 }
1702 static inline bool classof(const BaseObjVar* node)
1703 {
1704 return node->getNodeKind() == GlobalObjNode;
1705 }
1706 static inline bool classof(const ObjVar* node)
1707 {
1708 return node->getNodeKind() == GlobalObjNode;
1709 }
1710 static inline bool classof(const SVFVar* node)
1711 {
1712 return node->getNodeKind() == GlobalObjNode;
1713 }
1714 static inline bool classof(const GenericPAGNodeTy* node)
1715 {
1716 return node->getNodeKind() == GlobalObjNode;
1717 }
1718 static inline bool classof(const SVFValue* node)
1719 {
1720 return node->getNodeKind() == GlobalObjNode;
1721 }
1723
1726 PNODEK ty = GlobalObjNode): BaseObjVar(i, ti, node, ty)
1727 {
1728
1729 }
1730
1731
1732 virtual const std::string toString() const;
1733};
1734
1736{
1737 friend class GraphDBClient;
1738
1739
1740public:
1742
1743 static inline bool classof(const ConstAggObjVar*)
1744 {
1745 return true;
1746 }
1747 static inline bool classof(const BaseObjVar* node)
1748 {
1749 return node->getNodeKind() == ConstAggObjNode;
1750 }
1751
1752 static inline bool classof(const ObjVar* node)
1753 {
1754 return node->getNodeKind() == ConstAggObjNode;
1755 }
1756 static inline bool classof(const SVFVar* node)
1757 {
1758 return node->getNodeKind() == ConstAggObjNode;
1759 }
1760 static inline bool classof(const GenericPAGNodeTy* node)
1761 {
1762 return node->getNodeKind() == ConstAggObjNode;
1763 }
1764 static inline bool classof(const SVFValue* node)
1765 {
1766 return node->getNodeKind() == ConstAggObjNode;
1767 }
1769
1772 : BaseObjVar(i, ti, node, ConstAggObjNode)
1773 {
1774
1775 }
1776
1777 virtual bool isConstDataOrAggData() const
1778 {
1779 return true;
1780 }
1781
1783 {
1784 return true;
1785 }
1786
1787 virtual const std::string toString() const;
1788};
1789
1791{
1792 friend class GraphDBClient;
1793
1794public:
1796 static inline bool classof(const ConstDataObjVar*)
1797 {
1798 return true;
1799 }
1800 static inline bool classof(const BaseObjVar* node)
1801 {
1802 return isConstantDataObjVarKinds(node->getNodeKind());
1803 }
1804 static inline bool classof(const SVFVar* node)
1805 {
1806 return isConstantDataObjVarKinds(node->getNodeKind());
1807 }
1808 static inline bool classof(const ObjVar* node)
1809 {
1810 return isConstantDataObjVarKinds(node->getNodeKind());
1811 }
1812 static inline bool classof(const GenericPAGNodeTy* node)
1813 {
1814 return isConstantDataObjVarKinds(node->getNodeKind());
1815 }
1816
1817 static inline bool classof(const SVFValue* node)
1818 {
1819 return isConstantDataObjVarKinds(node->getNodeKind());
1820 }
1822
1825 : BaseObjVar(i, ti, node, ty)
1826 {
1827 }
1828
1829 virtual bool isConstDataOrAggData() const
1830 {
1831 return true;
1832 }
1833
1835 {
1836 return true;
1837 }
1838
1839 virtual const std::string toString() const;
1840};
1841
1843{
1844
1845 friend class GraphDBClient;
1846
1847
1848private:
1849 float dval;
1850
1851public:
1853 static inline bool classof(const ConstFPObjVar*)
1854 {
1855 return true;
1856 }
1857 static inline bool classof(const ConstDataObjVar* node)
1858 {
1859 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1860 }
1861 static inline bool classof(const BaseObjVar* node)
1862 {
1863 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1864 }
1865
1866 static inline bool classof(const SVFVar* node)
1867 {
1868 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1869 }
1870
1871 static inline bool classof(const ObjVar* node)
1872 {
1873 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1874 }
1875
1876 static inline bool classof(const GenericPAGNodeTy* node)
1877 {
1878 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1879 }
1880
1881 static inline bool classof(const SVFValue* node)
1882 {
1883 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1884 }
1886
1890 {
1891 }
1892
1893 inline double getFPValue() const
1894 {
1895 return dval;
1896 }
1897
1898
1899 virtual const std::string toString() const;
1900};
1901
1903{
1904
1905 friend class GraphDBClient;
1906
1907
1908
1909private:
1912
1913public:
1915 static inline bool classof(const ConstIntObjVar*)
1916 {
1917 return true;
1918 }
1919
1920 static inline bool classof(const ConstDataObjVar* node)
1921 {
1922 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1923 }
1924
1925 static inline bool classof(const BaseObjVar* node)
1926 {
1927 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1928 }
1929
1930 static inline bool classof(const SVFVar* node)
1931 {
1932 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1933 }
1934 static inline bool classof(const ObjVar* node)
1935 {
1936 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1937 }
1938 static inline bool classof(const GenericPAGNodeTy* node)
1939 {
1940 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1941 }
1942
1943 static inline bool classof(const SVFValue* node)
1944 {
1945 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1946 }
1947
1949 {
1950 return sval;
1951 }
1952
1953
1955 {
1956 return zval;
1957 }
1959
1963 {
1964 }
1965
1966 virtual const std::string toString() const;
1967};
1968
1970{
1971
1972 friend class GraphDBClient;
1973
1974public:
1976 static inline bool classof(const ConstNullPtrObjVar*)
1977 {
1978 return true;
1979 }
1980
1981 static inline bool classof(const ConstDataObjVar* node)
1982 {
1983 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1984 }
1985
1986 static inline bool classof(const BaseObjVar* node)
1987 {
1988 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1989 }
1990
1991 static inline bool classof(const SVFVar* node)
1992 {
1993 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1994 }
1995 static inline bool classof(const ObjVar* node)
1996 {
1997 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1998 }
1999 static inline bool classof(const GenericPAGNodeTy* node)
2000 {
2001 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
2002 }
2003
2004 static inline bool classof(const SVFValue* node)
2005 {
2006 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
2007 }
2009
2016 {
2017 return false;
2018 }
2019 virtual const std::string toString() const;
2020};
2021/*
2022 * Unique Return node of a procedure
2023 */
2024class RetValPN : public ValVar
2025{
2026 friend class GraphDBClient;
2027
2028protected:
2029 inline void setCallGraphNode(const FunObjVar* node)
2030 {
2031 callGraphNode = node;
2032 }
2033
2034private:
2036
2037public:
2039 static inline bool classof(const RetValPN*)
2040 {
2041 return true;
2042 }
2043 static inline bool classof(const SVFVar* node)
2044 {
2045 return node->getNodeKind() == SVFVar::RetValNode;
2046 }
2047 static inline bool classof(const ValVar* node)
2048 {
2049 return node->getNodeKind() == SVFVar::RetValNode;
2050 }
2051 static inline bool classof(const GenericPAGNodeTy* node)
2052 {
2053 return node->getNodeKind() == SVFVar::RetValNode;
2054 }
2055 static inline bool classof(const SVFValue* node)
2056 {
2057 return node->getNodeKind() == SVFVar::RetValNode;
2058 }
2060
2061
2063 RetValPN(NodeID i, const FunObjVar* node, const SVFType* svfType, const ICFGNode* icn);
2064
2065 inline const FunObjVar* getCallGraphNode() const
2066 {
2067 return callGraphNode;
2068 }
2069
2070 virtual const FunObjVar* getFunction() const;
2071
2072 virtual bool isPointer() const;
2073
2075 const std::string getValueName() const;
2076
2077 virtual const std::string toString() const;
2078};
2079
2080/*
2081 * Unique vararg node of a procedure
2082 */
2083class VarArgValPN : public ValVar
2084{
2085
2086 friend class GraphDBClient;
2087
2088protected:
2089 inline void setCallGraphNode(const FunObjVar* node)
2090 {
2091 callGraphNode = node;
2092 }
2093private:
2095
2096public:
2098 static inline bool classof(const VarArgValPN*)
2099 {
2100 return true;
2101 }
2102 static inline bool classof(const SVFVar* node)
2103 {
2104 return node->getNodeKind() == SVFVar::VarargValNode;
2105 }
2106 static inline bool classof(const ValVar* node)
2107 {
2108 return node->getNodeKind() == SVFVar::VarargValNode;
2109 }
2110 static inline bool classof(const GenericPAGNodeTy* node)
2111 {
2112 return node->getNodeKind() == SVFVar::VarargValNode;
2113 }
2114 static inline bool classof(const SVFValue* node)
2115 {
2116 return node->getNodeKind() == SVFVar::VarargValNode;
2117 }
2119
2121 VarArgValPN(NodeID i, const FunObjVar* node, const SVFType* svfType, const ICFGNode* icn)
2123 {
2124 }
2125
2126 virtual const FunObjVar* getFunction() const;
2127
2129 const std::string getValueName() const;
2130
2131 virtual bool isPointer() const
2132 {
2133 return true;
2134 }
2135 virtual const std::string toString() const;
2136};
2137
2138/*
2139 * Dummy variable without any LLVM value
2140 */
2141class DummyValVar: public ValVar
2142{
2143 friend class GraphDBClient;
2144
2145public:
2147 static inline bool classof(const DummyValVar*)
2148 {
2149 return true;
2150 }
2151 static inline bool classof(const SVFVar* node)
2152 {
2153 return node->getNodeKind() == SVFVar::DummyValNode;
2154 }
2155 static inline bool classof(const ValVar* node)
2156 {
2157 return node->getNodeKind() == SVFVar::DummyValNode;
2158 }
2159 static inline bool classof(const GenericPAGNodeTy* node)
2160 {
2161 return node->getNodeKind() == SVFVar::DummyValNode;
2162 }
2163 static inline bool classof(const SVFValue* node)
2164 {
2165 return node->getNodeKind() == SVFVar::DummyValNode;
2166 }
2168
2171 : ValVar(i, svfType, node, DummyValNode)
2172 {
2173 }
2174
2176 inline const std::string getValueName() const
2177 {
2178 return "dummyVal";
2179 }
2180
2181 virtual bool isPointer() const
2182 {
2183 return true;
2184 }
2185
2186 virtual const std::string toString() const;
2187};
2188
2189/*
2190 * Dummy object variable
2191 */
2193{
2194
2195 friend class GraphDBClient;
2196
2197
2198public:
2200 static inline bool classof(const DummyObjVar*)
2201 {
2202 return true;
2203 }
2204 static inline bool classof(const BaseObjVar* node)
2205 {
2206 return node->getNodeKind() == SVFVar::DummyObjNode;
2207 }
2208 static inline bool classof(const SVFVar* node)
2209 {
2210 return node->getNodeKind() == SVFVar::DummyObjNode;
2211 }
2212 static inline bool classof(const ObjVar* node)
2213 {
2214 return node->getNodeKind() == SVFVar::DummyObjNode;
2215 }
2216 static inline bool classof(const GenericPAGNodeTy* node)
2217 {
2218 return node->getNodeKind() == SVFVar::DummyObjNode;
2219 }
2220
2221 static inline bool classof(const SVFValue* node)
2222 {
2223 return node->getNodeKind() == SVFVar::DummyObjNode;
2224 }
2226
2229 : BaseObjVar(i, ti, node, DummyObjNode)
2230 {
2231 }
2232
2234 inline const std::string getValueName() const
2235 {
2236 return "dummyObj";
2237 }
2238
2239 virtual bool isPointer() const
2240 {
2241 return true;
2242 }
2243
2244 virtual const std::string toString() const;
2245};
2246
2247} // End namespace SVF
2248
2249#endif /* INCLUDE_SVFIR_SVFVARIABLE_H_ */
APOffset getConstantStructFldIdx() const
Get methods.
Definition AccessPath.h:97
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
void setICFGNode(const ICFGNode *node)
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.
void setICFGNode(const ICFGNode *icfgNode)
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