svf-lib 1.0.2452 → 1.0.2454
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SVF-linux-aarch64/bin/ae +0 -0
- package/SVF-linux-aarch64/bin/cfl +0 -0
- package/SVF-linux-aarch64/bin/dvf +0 -0
- package/SVF-linux-aarch64/bin/llvm2svf +0 -0
- package/SVF-linux-aarch64/bin/mta +0 -0
- package/SVF-linux-aarch64/bin/saber +0 -0
- package/SVF-linux-aarch64/bin/svf-ex +0 -0
- package/SVF-linux-aarch64/bin/wpa +0 -0
- package/SVF-linux-aarch64/include/SVF-LLVM/BasicTypes.h +3 -1
- package/SVF-linux-aarch64/include/SVF-LLVM/BreakConstantExpr.h +24 -0
- package/SVF-linux-aarch64/lib/extapi.bc +19 -19
- package/SVF-linux-aarch64/lib/libSvfLLVM.so.3.2 +0 -0
- package/SVF-linux-x86_64/bin/ae +0 -0
- package/SVF-linux-x86_64/bin/cfl +0 -0
- package/SVF-linux-x86_64/bin/dvf +0 -0
- package/SVF-linux-x86_64/bin/mta +0 -0
- package/SVF-linux-x86_64/bin/saber +0 -0
- package/SVF-linux-x86_64/bin/svf-ex +0 -0
- package/SVF-linux-x86_64/bin/wpa +0 -0
- package/SVF-linux-x86_64/include/Graphs/BasicBlockG.h +18 -4
- package/SVF-linux-x86_64/include/Graphs/CHG.h +12 -0
- package/SVF-linux-x86_64/include/Graphs/CallGraph.h +14 -2
- package/SVF-linux-x86_64/include/Graphs/ICFG.h +24 -8
- package/SVF-linux-x86_64/include/Graphs/ICFGEdge.h +1 -0
- package/SVF-linux-x86_64/include/Graphs/ICFGNode.h +39 -6
- package/SVF-linux-x86_64/include/Graphs/IRGraph.h +12 -0
- package/SVF-linux-x86_64/include/MemoryModel/AccessPath.h +7 -1
- package/SVF-linux-x86_64/include/SVF-LLVM/ICFGBuilder.h +1 -1
- package/SVF-linux-x86_64/include/SVF-LLVM/SVFIRBuilder.h +1 -0
- package/SVF-linux-x86_64/include/SVFIR/ObjTypeInfo.h +5 -0
- package/SVF-linux-x86_64/include/SVFIR/SVFIR.h +61 -39
- package/SVF-linux-x86_64/include/SVFIR/SVFStatements.h +125 -10
- package/SVF-linux-x86_64/include/SVFIR/SVFType.h +97 -1
- package/SVF-linux-x86_64/include/SVFIR/SVFValue.h +1 -0
- package/SVF-linux-x86_64/include/SVFIR/SVFVariables.h +164 -4
- package/SVF-linux-x86_64/include/Util/ExtAPI.h +1 -0
- package/SVF-linux-x86_64/include/Util/NodeIDAllocator.h +11 -0
- package/SVF-linux-x86_64/include/Util/SVFLoopAndDomInfo.h +37 -0
- package/SVF-linux-x86_64/lib/libSvfCore.so.3.2 +0 -0
- package/SVF-linux-x86_64/lib/libSvfLLVM.so.3.2 +0 -0
- package/package.json +1 -1
|
@@ -42,6 +42,7 @@ namespace SVF
|
|
|
42
42
|
class ObjTypeInfo
|
|
43
43
|
{
|
|
44
44
|
friend class SymbolTableBuilder;
|
|
45
|
+
friend class GraphDBClient;
|
|
45
46
|
|
|
46
47
|
public:
|
|
47
48
|
typedef enum
|
|
@@ -148,6 +149,10 @@ public:
|
|
|
148
149
|
{
|
|
149
150
|
flags |= mask;
|
|
150
151
|
}
|
|
152
|
+
inline u32_t getFlag() const
|
|
153
|
+
{
|
|
154
|
+
return flags;
|
|
155
|
+
}
|
|
151
156
|
inline bool hasFlag(MEMTYPE mask)
|
|
152
157
|
{
|
|
153
158
|
return (flags & mask) == mask;
|
|
@@ -46,6 +46,8 @@ class SVFIR : public IRGraph
|
|
|
46
46
|
friend class PAGBuilderFromFile;
|
|
47
47
|
friend class TypeBasedHeapCloning;
|
|
48
48
|
friend class BVDataPTAImpl;
|
|
49
|
+
friend class GraphDBClient;
|
|
50
|
+
friend class GraphDBSVFIRBuilder;
|
|
49
51
|
|
|
50
52
|
public:
|
|
51
53
|
typedef Set<const CallICFGNode*> CallSiteSet;
|
|
@@ -181,6 +183,11 @@ public:
|
|
|
181
183
|
return callGraph;
|
|
182
184
|
}
|
|
183
185
|
|
|
186
|
+
inline void setCallGraph(CallGraph* cg)
|
|
187
|
+
{
|
|
188
|
+
callGraph = cg;
|
|
189
|
+
}
|
|
190
|
+
|
|
184
191
|
const FunObjVar* getFunObjVar(const std::string& name);
|
|
185
192
|
|
|
186
193
|
inline const std::string& getModuleIdentifier() const
|
|
@@ -500,6 +507,22 @@ public:
|
|
|
500
507
|
/// Print SVFIR
|
|
501
508
|
void print();
|
|
502
509
|
|
|
510
|
+
protected:
|
|
511
|
+
inline NodeID addBaseObjNode(BaseObjVar* node)
|
|
512
|
+
{
|
|
513
|
+
memToFieldsMap[node->getId()].set(node->getId());
|
|
514
|
+
return addObjNode(node);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
NodeID addDummyObjNode(DummyObjVar* node);
|
|
518
|
+
|
|
519
|
+
NodeID addGepObjNode(GepObjVar* gepObj, NodeID base, const APOffset& apOffset);
|
|
520
|
+
|
|
521
|
+
inline void addGepValObjFromDB(NodeID curInstID, const GepValVar* gepValvar)
|
|
522
|
+
{
|
|
523
|
+
GepValObjMap[curInstID][std::make_pair(gepValvar->getBaseNode()->getId(), gepValvar->getAccessPath())] = gepValvar->getId();
|
|
524
|
+
}
|
|
525
|
+
|
|
503
526
|
private:
|
|
504
527
|
|
|
505
528
|
/// Map a SVFStatement type to a set of corresponding SVF statements
|
|
@@ -521,6 +544,11 @@ private:
|
|
|
521
544
|
inline void addFunArgs(const FunObjVar* fun, const SVFVar* arg)
|
|
522
545
|
{
|
|
523
546
|
FunEntryICFGNode* funEntryBlockNode = icfg->getFunEntryICFGNode(fun);
|
|
547
|
+
addFunArgs(funEntryBlockNode, fun, arg);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
inline void addFunArgs(FunEntryICFGNode* funEntryBlockNode, const FunObjVar* fun, const SVFVar* arg)
|
|
551
|
+
{
|
|
524
552
|
funEntryBlockNode->addFormalParms(arg);
|
|
525
553
|
funArgsListMap[fun].push_back(arg);
|
|
526
554
|
}
|
|
@@ -528,6 +556,11 @@ private:
|
|
|
528
556
|
inline void addFunRet(const FunObjVar* fun, const SVFVar* ret)
|
|
529
557
|
{
|
|
530
558
|
FunExitICFGNode* funExitBlockNode = icfg->getFunExitICFGNode(fun);
|
|
559
|
+
addFunRet(funExitBlockNode, fun, ret);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
inline void addFunRet(FunExitICFGNode* funExitBlockNode, const FunObjVar* fun, const SVFVar* ret)
|
|
563
|
+
{
|
|
531
564
|
funExitBlockNode->addFormalRet(ret);
|
|
532
565
|
funRetMap[fun] = ret;
|
|
533
566
|
}
|
|
@@ -557,7 +590,7 @@ private:
|
|
|
557
590
|
/// Add a value (pointer) node
|
|
558
591
|
inline NodeID addValNode(NodeID i, const SVFType* type, const ICFGNode* icfgNode)
|
|
559
592
|
{
|
|
560
|
-
|
|
593
|
+
ValVar *node = new ValVar(i, type, icfgNode, ValVar::ValNode);
|
|
561
594
|
return addValNode(node);
|
|
562
595
|
}
|
|
563
596
|
|
|
@@ -624,9 +657,8 @@ private:
|
|
|
624
657
|
*/
|
|
625
658
|
inline NodeID addHeapObjNode(NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
|
|
626
659
|
{
|
|
627
|
-
memToFieldsMap[i].set(i);
|
|
628
660
|
HeapObjVar *heapObj = new HeapObjVar(i, ti, node);
|
|
629
|
-
return
|
|
661
|
+
return addBaseObjNode(heapObj);
|
|
630
662
|
}
|
|
631
663
|
|
|
632
664
|
/**
|
|
@@ -634,60 +666,52 @@ private:
|
|
|
634
666
|
*/
|
|
635
667
|
inline NodeID addStackObjNode(NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
|
|
636
668
|
{
|
|
637
|
-
memToFieldsMap[i].set(i);
|
|
638
669
|
StackObjVar *stackObj = new StackObjVar(i, ti, node);
|
|
639
|
-
return
|
|
670
|
+
return addBaseObjNode(stackObj);
|
|
640
671
|
}
|
|
641
672
|
|
|
642
673
|
NodeID addFunObjNode(NodeID id, ObjTypeInfo* ti, const ICFGNode* node)
|
|
643
674
|
{
|
|
644
|
-
memToFieldsMap[id].set(id);
|
|
645
675
|
FunObjVar* funObj = new FunObjVar(id, ti, node);
|
|
646
|
-
return
|
|
676
|
+
return addBaseObjNode(funObj);
|
|
647
677
|
}
|
|
648
678
|
|
|
649
679
|
|
|
650
680
|
inline NodeID addConstantFPObjNode(NodeID i, ObjTypeInfo* ti, double dval, const ICFGNode* node)
|
|
651
681
|
{
|
|
652
|
-
memToFieldsMap[i].set(i);
|
|
653
682
|
ConstFPObjVar* conObj = new ConstFPObjVar(i, dval, ti, node);
|
|
654
|
-
return
|
|
683
|
+
return addBaseObjNode(conObj);
|
|
655
684
|
}
|
|
656
685
|
|
|
657
686
|
|
|
658
687
|
inline NodeID addConstantIntObjNode(NodeID i, ObjTypeInfo* ti, const std::pair<s64_t, u64_t>& intValue, const ICFGNode* node)
|
|
659
688
|
{
|
|
660
|
-
memToFieldsMap[i].set(i);
|
|
661
689
|
ConstIntObjVar* conObj =
|
|
662
690
|
new ConstIntObjVar(i, intValue.first, intValue.second, ti, node);
|
|
663
|
-
return
|
|
691
|
+
return addBaseObjNode(conObj);
|
|
664
692
|
}
|
|
665
693
|
|
|
666
694
|
|
|
667
695
|
inline NodeID addConstantNullPtrObjNode(const NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
|
|
668
696
|
{
|
|
669
|
-
memToFieldsMap[i].set(i);
|
|
670
697
|
ConstNullPtrObjVar* conObj = new ConstNullPtrObjVar(i, ti, node);
|
|
671
|
-
return
|
|
698
|
+
return addBaseObjNode(conObj);
|
|
672
699
|
}
|
|
673
700
|
|
|
674
701
|
inline NodeID addGlobalObjNode(const NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
|
|
675
702
|
{
|
|
676
|
-
memToFieldsMap[i].set(i);
|
|
677
703
|
GlobalObjVar* gObj = new GlobalObjVar(i, ti, node);
|
|
678
|
-
return
|
|
704
|
+
return addBaseObjNode(gObj);
|
|
679
705
|
}
|
|
680
706
|
inline NodeID addConstantAggObjNode(const NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
|
|
681
707
|
{
|
|
682
|
-
memToFieldsMap[i].set(i);
|
|
683
708
|
ConstAggObjVar* conObj = new ConstAggObjVar(i, ti, node);
|
|
684
|
-
return
|
|
709
|
+
return addBaseObjNode(conObj);
|
|
685
710
|
}
|
|
686
711
|
inline NodeID addConstantDataObjNode(const NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
|
|
687
712
|
{
|
|
688
|
-
memToFieldsMap[i].set(i);
|
|
689
713
|
ConstDataObjVar* conObj = new ConstDataObjVar(i, ti, node);
|
|
690
|
-
return
|
|
714
|
+
return addBaseObjNode(conObj);
|
|
691
715
|
}
|
|
692
716
|
|
|
693
717
|
/// Add a unique return node for a procedure
|
|
@@ -710,9 +734,8 @@ private:
|
|
|
710
734
|
/// Add a field-insensitive node, this method can only invoked by getFIGepObjNode
|
|
711
735
|
NodeID addFIObjNode(NodeID i, ObjTypeInfo* ti, const ICFGNode* node)
|
|
712
736
|
{
|
|
713
|
-
memToFieldsMap[i].set(i);
|
|
714
737
|
BaseObjVar* baseObj = new BaseObjVar(i, ti, node);
|
|
715
|
-
return
|
|
738
|
+
return addBaseObjNode(baseObj);
|
|
716
739
|
}
|
|
717
740
|
|
|
718
741
|
|
|
@@ -730,11 +753,11 @@ private:
|
|
|
730
753
|
{
|
|
731
754
|
ObjTypeInfo* ti = createObjTypeInfo(type);
|
|
732
755
|
idToObjTypeInfoMap()[i] = ti;
|
|
733
|
-
return
|
|
756
|
+
return addDummyObjNode(new DummyObjVar(i, ti, nullptr));
|
|
734
757
|
}
|
|
735
758
|
else
|
|
736
759
|
{
|
|
737
|
-
return
|
|
760
|
+
return addDummyObjNode(new DummyObjVar(i, getObjTypeInfo(i), nullptr));
|
|
738
761
|
}
|
|
739
762
|
}
|
|
740
763
|
|
|
@@ -753,23 +776,9 @@ private:
|
|
|
753
776
|
//@}
|
|
754
777
|
|
|
755
778
|
/// Add a value (pointer) node
|
|
756
|
-
|
|
757
|
-
{
|
|
758
|
-
assert(node && "node cannot be nullptr.");
|
|
759
|
-
assert(hasGNode(node->getId()) == false &&
|
|
760
|
-
"This NodeID clashes here. Please check NodeIDAllocator. Switch "
|
|
761
|
-
"Strategy::DBUG to SEQ or DENSE");
|
|
762
|
-
return addNode(node);
|
|
763
|
-
}
|
|
779
|
+
NodeID addValNode(ValVar* node);
|
|
764
780
|
/// Add a memory obj node
|
|
765
|
-
|
|
766
|
-
{
|
|
767
|
-
assert(node && "node cannot be nullptr.");
|
|
768
|
-
assert(hasGNode(node->getId()) == false &&
|
|
769
|
-
"This NodeID clashes here. Please check NodeIDAllocator. Switch "
|
|
770
|
-
"Strategy::DBUG to SEQ or DENSE");
|
|
771
|
-
return addNode(node);
|
|
772
|
-
}
|
|
781
|
+
NodeID addObjNode(ObjVar *node);
|
|
773
782
|
/// Add a unique return node for a procedure
|
|
774
783
|
inline NodeID addRetNode(const FunObjVar*, SVFVar *node)
|
|
775
784
|
{
|
|
@@ -795,36 +804,49 @@ private:
|
|
|
795
804
|
//@{
|
|
796
805
|
/// Add Address edge
|
|
797
806
|
AddrStmt* addAddrStmt(NodeID src, NodeID dst);
|
|
807
|
+
void addAddrStmt(AddrStmt* edge);
|
|
798
808
|
/// Add Copy edge
|
|
799
809
|
CopyStmt* addCopyStmt(NodeID src, NodeID dst, CopyStmt::CopyKind type);
|
|
810
|
+
void addCopyStmt(CopyStmt* edge);
|
|
800
811
|
|
|
801
812
|
/// Add phi node information
|
|
802
813
|
PhiStmt* addPhiStmt(NodeID res, NodeID opnd, const ICFGNode* pred);
|
|
814
|
+
void addPhiStmt(PhiStmt* edge, SVFVar* src, SVFVar* dst);
|
|
803
815
|
/// Add SelectStmt
|
|
804
816
|
SelectStmt* addSelectStmt(NodeID res, NodeID op1, NodeID op2, NodeID cond);
|
|
817
|
+
void addSelectStmt(SelectStmt* edge, SVFVar* src, SVFVar* dst);
|
|
805
818
|
/// Add Copy edge
|
|
806
819
|
CmpStmt* addCmpStmt(NodeID op1, NodeID op2, NodeID dst, u32_t predict);
|
|
820
|
+
void addCmpStmt(CmpStmt* edge, SVFVar* src, SVFVar* dst);
|
|
807
821
|
/// Add Copy edge
|
|
808
822
|
BinaryOPStmt* addBinaryOPStmt(NodeID op1, NodeID op2, NodeID dst,
|
|
809
823
|
u32_t opcode);
|
|
824
|
+
void addBinaryOPStmt(BinaryOPStmt* edge, SVFVar* src, SVFVar* dst);
|
|
810
825
|
/// Add Unary edge
|
|
811
826
|
UnaryOPStmt* addUnaryOPStmt(NodeID src, NodeID dst, u32_t opcode);
|
|
827
|
+
void addUnaryOPStmt(UnaryOPStmt* edge, SVFVar* src, SVFVar* dst);
|
|
812
828
|
/// Add BranchStmt
|
|
813
829
|
BranchStmt* addBranchStmt(NodeID br, NodeID cond,
|
|
814
830
|
const BranchStmt::SuccAndCondPairVec& succs);
|
|
831
|
+
void addBranchStmt(BranchStmt* edge, SVFVar* src, SVFVar* dst);
|
|
815
832
|
/// Add Load edge
|
|
816
833
|
LoadStmt* addLoadStmt(NodeID src, NodeID dst);
|
|
834
|
+
void addLoadStmt(LoadStmt* edge);
|
|
817
835
|
/// Add Store edge
|
|
818
836
|
StoreStmt* addStoreStmt(NodeID src, NodeID dst, const ICFGNode* val);
|
|
837
|
+
void addStoreStmt(StoreStmt* edge, SVFVar* src, SVFVar* dst);
|
|
819
838
|
/// Add Call edge
|
|
820
839
|
CallPE* addCallPE(NodeID src, NodeID dst, const CallICFGNode* cs,
|
|
821
840
|
const FunEntryICFGNode* entry);
|
|
841
|
+
void addCallPE(CallPE* edge, SVFVar* src, SVFVar* dst);
|
|
822
842
|
/// Add Return edge
|
|
823
843
|
RetPE* addRetPE(NodeID src, NodeID dst, const CallICFGNode* cs,
|
|
824
844
|
const FunExitICFGNode* exit);
|
|
845
|
+
void addRetPE(RetPE* edge, SVFVar* src, SVFVar* dst);
|
|
825
846
|
/// Add Gep edge
|
|
826
847
|
GepStmt* addGepStmt(NodeID src, NodeID dst, const AccessPath& ap,
|
|
827
848
|
bool constGep);
|
|
849
|
+
void addGepStmt(GepStmt* edge);
|
|
828
850
|
/// Add Offset(Gep) edge
|
|
829
851
|
GepStmt* addNormalGepStmt(NodeID src, NodeID dst, const AccessPath& ap);
|
|
830
852
|
/// Add Variant(Gep) edge
|
|
@@ -51,6 +51,7 @@ class SVFBasicBlock;
|
|
|
51
51
|
typedef GenericEdge<SVFVar> GenericPAGEdgeTy;
|
|
52
52
|
class SVFStmt : public GenericPAGEdgeTy
|
|
53
53
|
{
|
|
54
|
+
friend class GraphDBClient;
|
|
54
55
|
|
|
55
56
|
public:
|
|
56
57
|
/// Types of SVFIR statements
|
|
@@ -89,8 +90,54 @@ protected:
|
|
|
89
90
|
{
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
SVFStmt(SVFVar* s, SVFVar* d, GEdgeFlag k, EdgeID eid, SVFVar* value, ICFGNode* icfgNode, bool real = true);
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Set the SVF BasicBlock for the new statements, this is used when loading statements from DB
|
|
97
|
+
*/
|
|
98
|
+
inline void setBasicBlock(const SVFBasicBlock* bb)
|
|
99
|
+
{
|
|
100
|
+
basicBlock = bb;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* set the call edge lanbel counter for the new statements, this is used when loading statements from DB
|
|
105
|
+
*/
|
|
106
|
+
inline void setCallEdgeLabelCounter(u64_t counter)
|
|
107
|
+
{
|
|
108
|
+
callEdgeLabelCounter = counter;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* set the store edge lanbel counter for the new statements, this is used when loading statements from DB
|
|
113
|
+
*/
|
|
114
|
+
inline void setStoreEdgeLabelCounter(u64_t counter)
|
|
115
|
+
{
|
|
116
|
+
storeEdgeLabelCounter = counter;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* set the multi operand edge lanbel counter for the new statements, this is used when loading statements from DB
|
|
121
|
+
*/
|
|
122
|
+
inline void setMultiOpndLabelCounter(u64_t counter)
|
|
123
|
+
{
|
|
124
|
+
multiOpndLabelCounter = counter;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Add a call site Instruction to label mapping, this is used when loading statements from DB
|
|
129
|
+
*/
|
|
130
|
+
static inline void addInst2Labeled(const ICFGNode* cs, u32_t label)
|
|
131
|
+
{
|
|
132
|
+
inst2LabelMap.emplace(cs, label);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
static inline void addVar2Labeled(const SVFVar* var, u32_t label)
|
|
136
|
+
{
|
|
137
|
+
var2LabelMap.emplace(var, label);
|
|
138
|
+
}
|
|
139
|
+
|
|
92
140
|
public:
|
|
93
|
-
static u32_t totalEdgeNum; ///< Total edge number
|
|
94
141
|
|
|
95
142
|
/// Constructor
|
|
96
143
|
SVFStmt(SVFVar* s, SVFVar* d, GEdgeFlag k, bool real = true);
|
|
@@ -222,6 +269,33 @@ private:
|
|
|
222
269
|
static u64_t callEdgeLabelCounter; ///< Call site Instruction counter
|
|
223
270
|
static u64_t storeEdgeLabelCounter; ///< Store Instruction counter
|
|
224
271
|
static u64_t multiOpndLabelCounter; ///< MultiOpndStmt counter
|
|
272
|
+
|
|
273
|
+
public:
|
|
274
|
+
static inline const Inst2LabelMap* getInst2LabelMap()
|
|
275
|
+
{
|
|
276
|
+
return &inst2LabelMap;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
static inline const Var2LabelMap* getVar2LabelMap()
|
|
280
|
+
{
|
|
281
|
+
return &var2LabelMap;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
static inline const u64_t* getCallEdgeLabelCounter()
|
|
285
|
+
{
|
|
286
|
+
return &callEdgeLabelCounter;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
static inline const u64_t* getStoreEdgeLabelCounter()
|
|
290
|
+
{
|
|
291
|
+
return &storeEdgeLabelCounter;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
static inline const u64_t* getMultiOpndLabelCounter()
|
|
295
|
+
{
|
|
296
|
+
return &multiOpndLabelCounter;
|
|
297
|
+
}
|
|
298
|
+
|
|
225
299
|
};
|
|
226
300
|
|
|
227
301
|
/*
|
|
@@ -231,6 +305,7 @@ private:
|
|
|
231
305
|
*/
|
|
232
306
|
class AssignStmt : public SVFStmt
|
|
233
307
|
{
|
|
308
|
+
friend class GraphDBClient;
|
|
234
309
|
|
|
235
310
|
private:
|
|
236
311
|
AssignStmt(); ///< place holder
|
|
@@ -303,6 +378,7 @@ public:
|
|
|
303
378
|
*/
|
|
304
379
|
class AddrStmt: public AssignStmt
|
|
305
380
|
{
|
|
381
|
+
friend class GraphDBClient;
|
|
306
382
|
|
|
307
383
|
private:
|
|
308
384
|
AddrStmt(const AddrStmt&); ///< place holder
|
|
@@ -355,6 +431,8 @@ public:
|
|
|
355
431
|
class CopyStmt: public AssignStmt
|
|
356
432
|
{
|
|
357
433
|
|
|
434
|
+
friend class GraphDBClient;
|
|
435
|
+
|
|
358
436
|
private:
|
|
359
437
|
CopyStmt(const CopyStmt&); ///< place holder
|
|
360
438
|
void operator=(const CopyStmt&); ///< place holder
|
|
@@ -430,6 +508,7 @@ public:
|
|
|
430
508
|
CopyStmt(SVFVar* s, SVFVar* d, CopyKind k) : AssignStmt(s, d, SVFStmt::Copy), copyKind(k) {}
|
|
431
509
|
|
|
432
510
|
virtual const std::string toString() const override;
|
|
511
|
+
|
|
433
512
|
private:
|
|
434
513
|
u32_t copyKind;
|
|
435
514
|
};
|
|
@@ -439,6 +518,7 @@ private:
|
|
|
439
518
|
*/
|
|
440
519
|
class StoreStmt: public AssignStmt
|
|
441
520
|
{
|
|
521
|
+
friend class GraphDBClient;
|
|
442
522
|
|
|
443
523
|
private:
|
|
444
524
|
StoreStmt(const StoreStmt&); ///< place holder
|
|
@@ -465,6 +545,7 @@ public:
|
|
|
465
545
|
StoreStmt(SVFVar* s, SVFVar* d, const ICFGNode* st);
|
|
466
546
|
|
|
467
547
|
virtual const std::string toString() const override;
|
|
548
|
+
|
|
468
549
|
};
|
|
469
550
|
|
|
470
551
|
/*!
|
|
@@ -472,6 +553,7 @@ public:
|
|
|
472
553
|
*/
|
|
473
554
|
class LoadStmt: public AssignStmt
|
|
474
555
|
{
|
|
556
|
+
friend class GraphDBClient;
|
|
475
557
|
|
|
476
558
|
private:
|
|
477
559
|
LoadStmt(const LoadStmt&); ///< place holder
|
|
@@ -505,6 +587,8 @@ public:
|
|
|
505
587
|
*/
|
|
506
588
|
class GepStmt: public AssignStmt
|
|
507
589
|
{
|
|
590
|
+
friend class GraphDBClient;
|
|
591
|
+
|
|
508
592
|
|
|
509
593
|
private:
|
|
510
594
|
GepStmt(const GepStmt &); ///< place holder
|
|
@@ -578,6 +662,7 @@ public:
|
|
|
578
662
|
|
|
579
663
|
virtual const std::string toString() const;
|
|
580
664
|
|
|
665
|
+
|
|
581
666
|
};
|
|
582
667
|
|
|
583
668
|
|
|
@@ -586,6 +671,7 @@ public:
|
|
|
586
671
|
*/
|
|
587
672
|
class CallPE: public AssignStmt
|
|
588
673
|
{
|
|
674
|
+
friend class GraphDBClient;
|
|
589
675
|
|
|
590
676
|
private:
|
|
591
677
|
CallPE(const CallPE&); ///< place holder
|
|
@@ -641,6 +727,7 @@ public:
|
|
|
641
727
|
*/
|
|
642
728
|
class RetPE: public AssignStmt
|
|
643
729
|
{
|
|
730
|
+
friend class GraphDBClient;
|
|
644
731
|
|
|
645
732
|
private:
|
|
646
733
|
RetPE(const RetPE&); ///< place holder
|
|
@@ -689,6 +776,7 @@ public:
|
|
|
689
776
|
//@}
|
|
690
777
|
|
|
691
778
|
virtual const std::string toString() const override;
|
|
779
|
+
|
|
692
780
|
};
|
|
693
781
|
|
|
694
782
|
/*
|
|
@@ -696,6 +784,9 @@ public:
|
|
|
696
784
|
*/
|
|
697
785
|
class MultiOpndStmt : public SVFStmt
|
|
698
786
|
{
|
|
787
|
+
friend class GraphDBClient;
|
|
788
|
+
|
|
789
|
+
|
|
699
790
|
|
|
700
791
|
public:
|
|
701
792
|
typedef std::vector<SVFVar*> OPVars;
|
|
@@ -774,7 +865,7 @@ public:
|
|
|
774
865
|
*/
|
|
775
866
|
class PhiStmt: public MultiOpndStmt
|
|
776
867
|
{
|
|
777
|
-
|
|
868
|
+
friend class GraphDBClient;
|
|
778
869
|
public:
|
|
779
870
|
typedef std::vector<const ICFGNode*> OpICFGNodeVec;
|
|
780
871
|
|
|
@@ -806,8 +897,8 @@ public:
|
|
|
806
897
|
//@}
|
|
807
898
|
|
|
808
899
|
/// constructor
|
|
809
|
-
PhiStmt(SVFVar*
|
|
810
|
-
: MultiOpndStmt(
|
|
900
|
+
PhiStmt(SVFVar* res, const OPVars& opnds, const OpICFGNodeVec& icfgNodes)
|
|
901
|
+
: MultiOpndStmt(res, opnds, SVFStmt::Phi), opICFGNodes(icfgNodes)
|
|
811
902
|
{
|
|
812
903
|
assert(opnds.size() == icfgNodes.size() &&
|
|
813
904
|
"Numbers of operands and their ICFGNodes are not consistent?");
|
|
@@ -820,6 +911,18 @@ public:
|
|
|
820
911
|
"Numbers of operands and their ICFGNodes are not consistent?");
|
|
821
912
|
}
|
|
822
913
|
|
|
914
|
+
void setOpICFGNodeVec(OpICFGNodeVec& icfgNodes)
|
|
915
|
+
{
|
|
916
|
+
assert(opVars.size() == icfgNodes.size() &&
|
|
917
|
+
"Numbers of operands and their ICFGNodes are not consistent?");
|
|
918
|
+
opICFGNodes = icfgNodes;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
inline const OpICFGNodeVec* getOpICFGNodeVec() const
|
|
922
|
+
{
|
|
923
|
+
return &opICFGNodes;
|
|
924
|
+
}
|
|
925
|
+
|
|
823
926
|
/// Return the corresponding ICFGNode of this operand
|
|
824
927
|
inline const ICFGNode* getOpICFGNode(u32_t op_idx) const
|
|
825
928
|
{
|
|
@@ -831,6 +934,7 @@ public:
|
|
|
831
934
|
bool isFunctionRetPhi() const;
|
|
832
935
|
|
|
833
936
|
virtual const std::string toString() const override;
|
|
937
|
+
|
|
834
938
|
};
|
|
835
939
|
|
|
836
940
|
/*!
|
|
@@ -838,7 +942,7 @@ public:
|
|
|
838
942
|
*/
|
|
839
943
|
class SelectStmt: public MultiOpndStmt
|
|
840
944
|
{
|
|
841
|
-
|
|
945
|
+
friend class GraphDBClient;
|
|
842
946
|
private:
|
|
843
947
|
SelectStmt(const SelectStmt&); ///< place holder
|
|
844
948
|
void operator=(const SelectStmt&); ///< place holder
|
|
@@ -867,7 +971,7 @@ public:
|
|
|
867
971
|
//@}
|
|
868
972
|
|
|
869
973
|
/// constructor
|
|
870
|
-
SelectStmt(SVFVar*
|
|
974
|
+
SelectStmt(SVFVar* res, const OPVars& opnds, const SVFVar* cond);
|
|
871
975
|
virtual const std::string toString() const override;
|
|
872
976
|
|
|
873
977
|
inline const SVFVar* getCondition() const
|
|
@@ -882,6 +986,7 @@ public:
|
|
|
882
986
|
{
|
|
883
987
|
return getOpVar(1);
|
|
884
988
|
}
|
|
989
|
+
|
|
885
990
|
};
|
|
886
991
|
|
|
887
992
|
/*!
|
|
@@ -889,7 +994,7 @@ public:
|
|
|
889
994
|
*/
|
|
890
995
|
class CmpStmt: public MultiOpndStmt
|
|
891
996
|
{
|
|
892
|
-
|
|
997
|
+
friend class GraphDBClient;
|
|
893
998
|
private:
|
|
894
999
|
CmpStmt(const CmpStmt&); ///< place holder
|
|
895
1000
|
void operator=(const CmpStmt&); ///< place holder
|
|
@@ -956,7 +1061,7 @@ public:
|
|
|
956
1061
|
//@}
|
|
957
1062
|
|
|
958
1063
|
/// constructor
|
|
959
|
-
CmpStmt(SVFVar*
|
|
1064
|
+
CmpStmt(SVFVar* res, const OPVars& opnds, u32_t pre);
|
|
960
1065
|
|
|
961
1066
|
u32_t getPredicate() const
|
|
962
1067
|
{
|
|
@@ -964,6 +1069,7 @@ public:
|
|
|
964
1069
|
}
|
|
965
1070
|
|
|
966
1071
|
virtual const std::string toString() const override;
|
|
1072
|
+
|
|
967
1073
|
};
|
|
968
1074
|
|
|
969
1075
|
/*!
|
|
@@ -971,7 +1077,7 @@ public:
|
|
|
971
1077
|
*/
|
|
972
1078
|
class BinaryOPStmt: public MultiOpndStmt
|
|
973
1079
|
{
|
|
974
|
-
|
|
1080
|
+
friend class GraphDBClient;
|
|
975
1081
|
private:
|
|
976
1082
|
BinaryOPStmt(const BinaryOPStmt&); ///< place holder
|
|
977
1083
|
void operator=(const BinaryOPStmt&); ///< place holder
|
|
@@ -1022,7 +1128,7 @@ public:
|
|
|
1022
1128
|
//@}
|
|
1023
1129
|
|
|
1024
1130
|
/// constructor
|
|
1025
|
-
BinaryOPStmt(SVFVar*
|
|
1131
|
+
BinaryOPStmt(SVFVar* res, const OPVars& opnds, u32_t oc);
|
|
1026
1132
|
|
|
1027
1133
|
u32_t getOpcode() const
|
|
1028
1134
|
{
|
|
@@ -1030,6 +1136,7 @@ public:
|
|
|
1030
1136
|
}
|
|
1031
1137
|
|
|
1032
1138
|
virtual const std::string toString() const override;
|
|
1139
|
+
|
|
1033
1140
|
};
|
|
1034
1141
|
|
|
1035
1142
|
/*!
|
|
@@ -1037,6 +1144,7 @@ public:
|
|
|
1037
1144
|
*/
|
|
1038
1145
|
class UnaryOPStmt: public SVFStmt
|
|
1039
1146
|
{
|
|
1147
|
+
friend class GraphDBClient;
|
|
1040
1148
|
|
|
1041
1149
|
private:
|
|
1042
1150
|
UnaryOPStmt(const UnaryOPStmt&); ///< place holder
|
|
@@ -1093,6 +1201,7 @@ public:
|
|
|
1093
1201
|
NodeID getResID() const;
|
|
1094
1202
|
|
|
1095
1203
|
virtual const std::string toString() const override;
|
|
1204
|
+
|
|
1096
1205
|
};
|
|
1097
1206
|
|
|
1098
1207
|
/*!
|
|
@@ -1100,6 +1209,7 @@ public:
|
|
|
1100
1209
|
*/
|
|
1101
1210
|
class BranchStmt: public SVFStmt
|
|
1102
1211
|
{
|
|
1212
|
+
friend class GraphDBClient;
|
|
1103
1213
|
|
|
1104
1214
|
public:
|
|
1105
1215
|
typedef std::vector<std::pair<const ICFGNode*, s32_t>> SuccAndCondPairVec;
|
|
@@ -1179,6 +1289,7 @@ public:
|
|
|
1179
1289
|
}
|
|
1180
1290
|
//@}
|
|
1181
1291
|
virtual const std::string toString() const override;
|
|
1292
|
+
|
|
1182
1293
|
};
|
|
1183
1294
|
|
|
1184
1295
|
/*!
|
|
@@ -1186,6 +1297,7 @@ public:
|
|
|
1186
1297
|
*/
|
|
1187
1298
|
class TDForkPE: public CallPE
|
|
1188
1299
|
{
|
|
1300
|
+
friend class GraphDBClient;
|
|
1189
1301
|
|
|
1190
1302
|
private:
|
|
1191
1303
|
TDForkPE(const TDForkPE&); ///< place holder
|
|
@@ -1216,6 +1328,7 @@ public:
|
|
|
1216
1328
|
}
|
|
1217
1329
|
|
|
1218
1330
|
virtual const std::string toString() const;
|
|
1331
|
+
|
|
1219
1332
|
};
|
|
1220
1333
|
|
|
1221
1334
|
/*!
|
|
@@ -1223,6 +1336,7 @@ public:
|
|
|
1223
1336
|
*/
|
|
1224
1337
|
class TDJoinPE: public RetPE
|
|
1225
1338
|
{
|
|
1339
|
+
friend class GraphDBClient;
|
|
1226
1340
|
|
|
1227
1341
|
private:
|
|
1228
1342
|
TDJoinPE(const TDJoinPE&); ///< place holder
|
|
@@ -1253,6 +1367,7 @@ public:
|
|
|
1253
1367
|
}
|
|
1254
1368
|
|
|
1255
1369
|
virtual const std::string toString() const;
|
|
1370
|
+
|
|
1256
1371
|
};
|
|
1257
1372
|
|
|
1258
1373
|
} // End namespace SVF
|