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 ConstDataValVar*)
1379 {
1380 return true;
1381 }
1382 static inline bool classof(const ValVar* node)
1383 {
1384 return isConstantDataValVar(node->getNodeKind());
1385 }
1386 static inline bool classof(const SVFVar* node)
1387 {
1388 return isConstantDataValVar(node->getNodeKind());
1389 }
1390 static inline bool classof(const GenericPAGNodeTy* node)
1391 {
1392 return isConstantDataValVar(node->getNodeKind());
1393 }
1394 static inline bool classof(const SVFValue* node)
1395 {
1396 return isConstantDataValVar(node->getNodeKind());
1397 }
1399
1403 : ValVar(i, svfType, icn, ty)
1404 {
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
1422{
1423
1424 friend class GraphDBClient;
1425public:
1427
1428 static inline bool classof(const BlackHoleValVar*)
1429 {
1430 return true;
1431 }
1432 static inline bool classof(const ConstDataValVar* node)
1433 {
1434 return node->getNodeKind() == BlackHoleValNode;
1435 }
1436 static inline bool classof(const ValVar* node)
1437 {
1438 return node->getNodeKind() == BlackHoleValNode;
1439 }
1440 static inline bool classof(const SVFVar* node)
1441 {
1442 return node->getNodeKind() == BlackHoleValNode;
1443 }
1444 static inline bool classof(const GenericPAGNodeTy* node)
1445 {
1446 return node->getNodeKind() == BlackHoleValNode;
1447 }
1448 static inline bool classof(const SVFValue* node)
1449 {
1450 return node->getNodeKind() == BlackHoleValNode;
1451 }
1453
1460
1462 {
1463 return false;
1464 }
1465
1466 virtual const std::string toString() const
1467 {
1468 return "BlackHoleValVar";
1469 }
1470};
1471
1473{
1474
1475 friend class GraphDBClient;
1476
1477private:
1478 double dval;
1479
1480public:
1482
1483 static inline bool classof(const ConstFPValVar*)
1484 {
1485 return true;
1486 }
1487 static inline bool classof(const ConstDataValVar* node)
1488 {
1489 return node->getNodeKind() == ConstFPValNode;
1490 }
1491 static inline bool classof(const ValVar* node)
1492 {
1493 return node->getNodeKind() == ConstFPValNode;
1494 }
1495 static inline bool classof(const SVFVar* node)
1496 {
1497 return node->getNodeKind() == ConstFPValNode;
1498 }
1499 static inline bool classof(const GenericPAGNodeTy* node)
1500 {
1501 return node->getNodeKind() == ConstFPValNode;
1502 }
1503 static inline bool classof(const SVFValue* node)
1504 {
1505 return node->getNodeKind() == ConstFPValNode;
1506 }
1508
1509 inline double getFPValue() const
1510 {
1511 return dval;
1512 }
1513
1516 const ICFGNode* icn, const SVFType* svfType)
1518 {
1519 }
1520
1521 virtual const std::string toString() const;
1522};
1523
1525{
1526
1527 friend class GraphDBClient;
1528
1529
1530private:
1533
1534public:
1536
1537 static inline bool classof(const ConstIntValVar*)
1538 {
1539 return true;
1540 }
1541 static inline bool classof(const ConstDataValVar* node)
1542 {
1543 return node->getNodeKind() == ConstIntValNode;
1544 }
1545 static inline bool classof(const ValVar* node)
1546 {
1547 return node->getNodeKind() == ConstIntValNode;
1548 }
1549 static inline bool classof(const SVFVar* node)
1550 {
1551 return node->getNodeKind() == ConstIntValNode;
1552 }
1553 static inline bool classof(const GenericPAGNodeTy* node)
1554 {
1555 return node->getNodeKind() == ConstIntValNode;
1556 }
1557 static inline bool classof(const SVFValue* node)
1558 {
1559 return node->getNodeKind() == ConstIntValNode;
1560 }
1562
1564 {
1565 return sval;
1566 }
1567
1568
1570 {
1571 return zval;
1572 }
1573
1580 virtual const std::string toString() const;
1581};
1582
1584{
1585 friend class GraphDBClient;
1586
1587public:
1589
1590 static inline bool classof(const ConstNullPtrValVar*)
1591 {
1592 return true;
1593 }
1594 static inline bool classof(const ConstDataValVar* node)
1595 {
1596 return node->getNodeKind() == ConstNullptrValNode;
1597 }
1598 static inline bool classof(const ValVar* node)
1599 {
1600 return node->getNodeKind() == ConstNullptrValNode;
1601 }
1602 static inline bool classof(const SVFVar* node)
1603 {
1604 return node->getNodeKind() == ConstNullptrValNode;
1605 }
1606 static inline bool classof(const GenericPAGNodeTy* node)
1607 {
1608 return node->getNodeKind() == ConstNullptrValNode;
1609 }
1610 static inline bool classof(const SVFValue* node)
1611 {
1612 return node->getNodeKind() == ConstNullptrValNode;
1613 }
1615
1622
1624 {
1625 return false;
1626 }
1627
1628 virtual const std::string toString() const;
1629};
1630
1632{
1633 friend class GraphDBClient;
1634
1635
1636public:
1638
1639 static inline bool classof(const GlobalObjVar*)
1640 {
1641 return true;
1642 }
1643 static inline bool classof(const BaseObjVar* node)
1644 {
1645 return node->getNodeKind() == GlobalObjNode;
1646 }
1647 static inline bool classof(const ObjVar* node)
1648 {
1649 return node->getNodeKind() == GlobalObjNode;
1650 }
1651 static inline bool classof(const SVFVar* node)
1652 {
1653 return node->getNodeKind() == GlobalObjNode;
1654 }
1655 static inline bool classof(const GenericPAGNodeTy* node)
1656 {
1657 return node->getNodeKind() == GlobalObjNode;
1658 }
1659 static inline bool classof(const SVFValue* node)
1660 {
1661 return node->getNodeKind() == GlobalObjNode;
1662 }
1664
1667 PNODEK ty = GlobalObjNode): BaseObjVar(i, ti, node, ty)
1668 {
1669
1670 }
1671
1672
1673 virtual const std::string toString() const;
1674};
1675
1677{
1678 friend class GraphDBClient;
1679
1680public:
1682 static inline bool classof(const ConstDataObjVar*)
1683 {
1684 return true;
1685 }
1686 static inline bool classof(const BaseObjVar* node)
1687 {
1688 return isConstantDataObjVarKinds(node->getNodeKind());
1689 }
1690 static inline bool classof(const SVFVar* node)
1691 {
1692 return isConstantDataObjVarKinds(node->getNodeKind());
1693 }
1694 static inline bool classof(const ObjVar* node)
1695 {
1696 return isConstantDataObjVarKinds(node->getNodeKind());
1697 }
1698 static inline bool classof(const GenericPAGNodeTy* node)
1699 {
1700 return isConstantDataObjVarKinds(node->getNodeKind());
1701 }
1702
1703 static inline bool classof(const SVFValue* node)
1704 {
1705 return isConstantDataObjVarKinds(node->getNodeKind());
1706 }
1708
1711 : BaseObjVar(i, ti, node, ty)
1712 {
1713 }
1714
1715 virtual bool isConstDataOrAggData() const
1716 {
1717 return true;
1718 }
1719
1721 {
1722 return true;
1723 }
1724
1725 virtual const std::string toString() const;
1726};
1727
1729{
1730
1731 friend class GraphDBClient;
1732
1733
1734private:
1735 float dval;
1736
1737public:
1739 static inline bool classof(const ConstFPObjVar*)
1740 {
1741 return true;
1742 }
1743 static inline bool classof(const ConstDataObjVar* node)
1744 {
1745 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1746 }
1747 static inline bool classof(const BaseObjVar* node)
1748 {
1749 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1750 }
1751
1752 static inline bool classof(const SVFVar* node)
1753 {
1754 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1755 }
1756
1757 static inline bool classof(const ObjVar* node)
1758 {
1759 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1760 }
1761
1762 static inline bool classof(const GenericPAGNodeTy* node)
1763 {
1764 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1765 }
1766
1767 static inline bool classof(const SVFValue* node)
1768 {
1769 return node->getNodeKind() == SVFVar::ConstFPObjNode;
1770 }
1772
1776 {
1777 }
1778
1779 inline double getFPValue() const
1780 {
1781 return dval;
1782 }
1783
1784
1785 virtual const std::string toString() const;
1786};
1787
1789{
1790
1791 friend class GraphDBClient;
1792
1793
1794
1795private:
1798
1799public:
1801 static inline bool classof(const ConstIntObjVar*)
1802 {
1803 return true;
1804 }
1805
1806 static inline bool classof(const ConstDataObjVar* node)
1807 {
1808 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1809 }
1810
1811 static inline bool classof(const BaseObjVar* node)
1812 {
1813 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1814 }
1815
1816 static inline bool classof(const SVFVar* node)
1817 {
1818 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1819 }
1820 static inline bool classof(const ObjVar* node)
1821 {
1822 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1823 }
1824 static inline bool classof(const GenericPAGNodeTy* node)
1825 {
1826 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1827 }
1828
1829 static inline bool classof(const SVFValue* node)
1830 {
1831 return node->getNodeKind() == SVFVar::ConstIntObjNode;
1832 }
1833
1835 {
1836 return sval;
1837 }
1838
1839
1841 {
1842 return zval;
1843 }
1845
1849 {
1850 }
1851
1852 virtual const std::string toString() const;
1853};
1854
1856{
1857
1858 friend class GraphDBClient;
1859
1860public:
1862 static inline bool classof(const ConstNullPtrObjVar*)
1863 {
1864 return true;
1865 }
1866
1867 static inline bool classof(const ConstDataObjVar* node)
1868 {
1869 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1870 }
1871
1872 static inline bool classof(const BaseObjVar* node)
1873 {
1874 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1875 }
1876
1877 static inline bool classof(const SVFVar* node)
1878 {
1879 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1880 }
1881 static inline bool classof(const ObjVar* node)
1882 {
1883 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1884 }
1885 static inline bool classof(const GenericPAGNodeTy* node)
1886 {
1887 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1888 }
1889
1890 static inline bool classof(const SVFValue* node)
1891 {
1892 return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1893 }
1895
1902 {
1903 return false;
1904 }
1905 virtual const std::string toString() const;
1906};
1907/*
1908 * Unique Return node of a procedure
1909 */
1910class RetValPN : public ValVar
1911{
1912 friend class GraphDBClient;
1913
1914protected:
1915 inline void setCallGraphNode(const FunObjVar* node)
1916 {
1917 callGraphNode = node;
1918 }
1919
1920private:
1922
1923public:
1925 static inline bool classof(const RetValPN*)
1926 {
1927 return true;
1928 }
1929 static inline bool classof(const SVFVar* node)
1930 {
1931 return node->getNodeKind() == SVFVar::RetValNode;
1932 }
1933 static inline bool classof(const ValVar* node)
1934 {
1935 return node->getNodeKind() == SVFVar::RetValNode;
1936 }
1937 static inline bool classof(const GenericPAGNodeTy* node)
1938 {
1939 return node->getNodeKind() == SVFVar::RetValNode;
1940 }
1941 static inline bool classof(const SVFValue* node)
1942 {
1943 return node->getNodeKind() == SVFVar::RetValNode;
1944 }
1946
1947
1949 RetValPN(NodeID i, const FunObjVar* node, const SVFType* svfType, const ICFGNode* icn);
1950
1951 inline const FunObjVar* getCallGraphNode() const
1952 {
1953 return callGraphNode;
1954 }
1955
1956 virtual const FunObjVar* getFunction() const;
1957
1958 virtual bool isPointer() const;
1959
1961 const std::string getValueName() const;
1962
1963 virtual const std::string toString() const;
1964};
1965
1966/*
1967 * Unique vararg node of a procedure
1968 */
1969class VarArgValPN : public ValVar
1970{
1971
1972 friend class GraphDBClient;
1973
1974protected:
1975 inline void setCallGraphNode(const FunObjVar* node)
1976 {
1977 callGraphNode = node;
1978 }
1979private:
1981
1982public:
1984 static inline bool classof(const VarArgValPN*)
1985 {
1986 return true;
1987 }
1988 static inline bool classof(const SVFVar* node)
1989 {
1990 return node->getNodeKind() == SVFVar::VarargValNode;
1991 }
1992 static inline bool classof(const ValVar* node)
1993 {
1994 return node->getNodeKind() == SVFVar::VarargValNode;
1995 }
1996 static inline bool classof(const GenericPAGNodeTy* node)
1997 {
1998 return node->getNodeKind() == SVFVar::VarargValNode;
1999 }
2000 static inline bool classof(const SVFValue* node)
2001 {
2002 return node->getNodeKind() == SVFVar::VarargValNode;
2003 }
2005
2007 VarArgValPN(NodeID i, const FunObjVar* node, const SVFType* svfType, const ICFGNode* icn)
2009 {
2010 assert((node->isDeclaration() || icn) &&
2011 "VarArgValPN of a defined function must have a valid ICFGNode");
2012 }
2013
2014 virtual const FunObjVar* getFunction() const;
2015
2017 const std::string getValueName() const;
2018
2019 virtual bool isPointer() const
2020 {
2021 return true;
2022 }
2023 virtual const std::string toString() const;
2024};
2025
2026/*
2027 * Dummy variable without any LLVM value
2028 */
2029class DummyValVar: public ValVar
2030{
2031 friend class GraphDBClient;
2032
2033public:
2035 static inline bool classof(const DummyValVar*)
2036 {
2037 return true;
2038 }
2039 static inline bool classof(const SVFVar* node)
2040 {
2041 return node->getNodeKind() == SVFVar::DummyValNode;
2042 }
2043 static inline bool classof(const ValVar* node)
2044 {
2045 return node->getNodeKind() == SVFVar::DummyValNode;
2046 }
2047 static inline bool classof(const GenericPAGNodeTy* node)
2048 {
2049 return node->getNodeKind() == SVFVar::DummyValNode;
2050 }
2051 static inline bool classof(const SVFValue* node)
2052 {
2053 return node->getNodeKind() == SVFVar::DummyValNode;
2054 }
2056
2059 : ValVar(i, svfType, node, DummyValNode)
2060 {
2061 }
2062
2064 inline const std::string getValueName() const
2065 {
2066 return "dummyVal";
2067 }
2068
2069 virtual bool isPointer() const
2070 {
2071 return true;
2072 }
2073
2074 virtual const std::string toString() const;
2075};
2076
2077/*
2078 * Represents an LLVM intrinsic call instruction (e.g. llvm.dbg.declare).
2079 * These are collected into valSyms but have no corresponding ICFGNode.
2080 */
2082{
2083 friend class GraphDBClient;
2084
2085public:
2087 static inline bool classof(const IntrinsicValVar*)
2088 {
2089 return true;
2090 }
2091 static inline bool classof(const SVFVar* node)
2092 {
2093 return node->getNodeKind() == SVFVar::IntrinsicValNode;
2094 }
2095 static inline bool classof(const ValVar* node)
2096 {
2097 return node->getNodeKind() == SVFVar::IntrinsicValNode;
2098 }
2099 static inline bool classof(const GenericPAGNodeTy* node)
2100 {
2101 return node->getNodeKind() == SVFVar::IntrinsicValNode;
2102 }
2103 static inline bool classof(const SVFValue* node)
2104 {
2105 return node->getNodeKind() == SVFVar::IntrinsicValNode;
2106 }
2108
2113
2114 inline const std::string getValueName() const
2115 {
2116 return "intrinsicVal";
2117 }
2118
2119 virtual const std::string toString() const;
2120};
2121
2122/*
2123 * Represents InlineAsm, DSOLocalEquivalent, and NoCFIValue.
2124 * These are non-instruction values related to inline assembly,
2125 * position-independent code (PIC), or control-flow integrity (CFI).
2126 * They have no corresponding ICFGNode.
2127 */
2128class AsmPCValVar: public ValVar
2129{
2130 friend class GraphDBClient;
2131
2132public:
2133 static inline bool classof(const AsmPCValVar*)
2134 {
2135 return true;
2136 }
2137 static inline bool classof(const SVFVar* node)
2138 {
2139 return node->getNodeKind() == SVFVar::AsmPCValNode;
2140 }
2141 static inline bool classof(const ValVar* node)
2142 {
2143 return node->getNodeKind() == SVFVar::AsmPCValNode;
2144 }
2145 static inline bool classof(const GenericPAGNodeTy* node)
2146 {
2147 return node->getNodeKind() == SVFVar::AsmPCValNode;
2148 }
2149 static inline bool classof(const SVFValue* node)
2150 {
2151 return node->getNodeKind() == SVFVar::AsmPCValNode;
2152 }
2153
2156
2157 inline const std::string getValueName() const
2158 {
2159 return "asmPCVal";
2160 }
2161 virtual const std::string toString() const;
2162};
2163
2164/*
2165 * Dummy object variable
2166 */
2168{
2169
2170 friend class GraphDBClient;
2171
2172
2173public:
2175 static inline bool classof(const DummyObjVar*)
2176 {
2177 return true;
2178 }
2179 static inline bool classof(const BaseObjVar* node)
2180 {
2181 return node->getNodeKind() == SVFVar::DummyObjNode;
2182 }
2183 static inline bool classof(const SVFVar* node)
2184 {
2185 return node->getNodeKind() == SVFVar::DummyObjNode;
2186 }
2187 static inline bool classof(const ObjVar* node)
2188 {
2189 return node->getNodeKind() == SVFVar::DummyObjNode;
2190 }
2191 static inline bool classof(const GenericPAGNodeTy* node)
2192 {
2193 return node->getNodeKind() == SVFVar::DummyObjNode;
2194 }
2195
2196 static inline bool classof(const SVFValue* node)
2197 {
2198 return node->getNodeKind() == SVFVar::DummyObjNode;
2199 }
2201
2204 : BaseObjVar(i, ti, node, DummyObjNode)
2205 {
2206 }
2207
2209 inline const std::string getValueName() const
2210 {
2211 return "dummyObj";
2212 }
2213
2214 virtual bool isPointer() const
2215 {
2216 return true;
2217 }
2218
2219 virtual const std::string toString() const;
2220};
2221
2222} // End namespace SVF
2223
2224#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)
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:98
@ ConstNullptrValNode
Definition SVFValue.h:78
static bool isConstantDataValVar(GNodeK n)
Definition SVFValue.h:247
static bool isObjVarKinds(GNodeK n)
Definition SVFValue.h:255
static bool isBaseObjVarKinds(GNodeK n)
Definition SVFValue.h:263
GNodeK getNodeKind() const
Get node kind.
Definition SVFValue.h:164
NodeID id
Node ID.
Definition SVFValue.h:204
virtual const std::string & getName() const
Definition SVFValue.h:184
static bool isConstantDataObjVarKinds(GNodeK n)
Definition SVFValue.h:271
static bool isValVarKinds(GNodeK n)
Definition SVFValue.h:238
static bool isSVFVarKind(GNodeK n)
Definition SVFValue.h:229
const SVFType * type
SVF type.
Definition SVFValue.h:206
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