svf-lib 1.0.2105 → 1.0.2107
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/Release-build/bin/ae +0 -0
- package/SVF-linux/Release-build/bin/cfl +0 -0
- package/SVF-linux/Release-build/bin/dvf +0 -0
- package/SVF-linux/Release-build/bin/llvm2svf +0 -0
- package/SVF-linux/Release-build/bin/mta +0 -0
- package/SVF-linux/Release-build/bin/saber +0 -0
- package/SVF-linux/Release-build/bin/svf-ex +0 -0
- package/SVF-linux/Release-build/bin/wpa +0 -0
- package/SVF-linux/Release-build/include/Graphs/ICFGEdge.h +9 -0
- package/SVF-linux/Release-build/lib/libSvfCore.a +0 -0
- package/SVF-linux/Release-build/lib/libSvfLLVM.a +0 -0
- package/SVF-osx/Release-build/bin/ae +0 -0
- package/SVF-osx/Release-build/bin/cfl +0 -0
- package/SVF-osx/Release-build/bin/dvf +0 -0
- package/SVF-osx/Release-build/bin/llvm2svf +0 -0
- package/SVF-osx/Release-build/bin/mta +0 -0
- package/SVF-osx/Release-build/bin/saber +0 -0
- package/SVF-osx/Release-build/bin/svf-ex +0 -0
- package/SVF-osx/Release-build/bin/wpa +0 -0
- package/SVF-osx/Release-build/include/CFL/CFGrammar.h +3 -3
- package/SVF-osx/Release-build/include/CFL/CFLGraphBuilder.h +3 -3
- package/SVF-osx/Release-build/include/DDA/ContextDDA.h +2 -2
- package/SVF-osx/Release-build/include/DDA/DDAClient.h +2 -2
- package/SVF-osx/Release-build/include/DDA/DDAVFSolver.h +5 -5
- package/SVF-osx/Release-build/include/DDA/FlowDDA.h +2 -2
- package/SVF-osx/Release-build/include/Graphs/CFLGraph.h +6 -6
- package/SVF-osx/Release-build/include/Graphs/CallGraph.h +6 -6
- package/SVF-osx/Release-build/include/Graphs/ConsG.h +4 -4
- package/SVF-osx/Release-build/include/Graphs/ConsGEdge.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/ConsGNode.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/GenericGraph.h +8 -8
- package/SVF-osx/Release-build/include/Graphs/ICFG.h +4 -4
- package/SVF-osx/Release-build/include/Graphs/ICFGEdge.h +9 -0
- package/SVF-osx/Release-build/include/Graphs/IRGraph.h +4 -4
- package/SVF-osx/Release-build/include/Graphs/SCC.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/SVFG.h +3 -3
- package/SVF-osx/Release-build/include/Graphs/SVFGNode.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/VFG.h +5 -5
- package/SVF-osx/Release-build/include/Graphs/VFGEdge.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/VFGNode.h +6 -6
- package/SVF-osx/Release-build/include/Graphs/WTO.h +1 -1
- package/SVF-osx/Release-build/include/MSSA/MSSAMuChi.h +1 -1
- package/SVF-osx/Release-build/include/MSSA/MemRegion.h +1 -1
- package/SVF-osx/Release-build/include/MSSA/MemSSA.h +5 -5
- package/SVF-osx/Release-build/include/MTA/LockAnalysis.h +2 -2
- package/SVF-osx/Release-build/include/MTA/MHP.h +5 -5
- package/SVF-osx/Release-build/include/MTA/TCT.h +6 -6
- package/SVF-osx/Release-build/include/MemoryModel/PointerAnalysisImpl.h +5 -5
- package/SVF-osx/Release-build/include/SABER/LeakChecker.h +1 -1
- package/SVF-osx/Release-build/include/SABER/SaberCondAllocator.h +2 -2
- package/SVF-osx/Release-build/include/SABER/SrcSnkDDA.h +2 -2
- package/SVF-osx/Release-build/include/SABER/SrcSnkSolver.h +2 -2
- package/SVF-osx/Release-build/include/SVF-LLVM/DCHG.h +3 -3
- package/SVF-osx/Release-build/include/SVF-LLVM/GEPTypeBridgeIterator.h +2 -2
- package/SVF-osx/Release-build/include/SVFIR/SVFIR.h +13 -13
- package/SVF-osx/Release-build/include/SVFIR/SVFStatements.h +1 -1
- package/SVF-osx/Release-build/include/SVFIR/SVFValue.h +15 -15
- package/SVF-osx/Release-build/include/Util/Casting.h +3 -3
- package/SVF-osx/Release-build/include/Util/GraphReachSolver.h +2 -2
- package/SVF-osx/Release-build/lib/libSvfCore.a +0 -0
- package/SVF-osx/Release-build/lib/libSvfLLVM.a +0 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -192,6 +192,12 @@ public:
|
|
|
192
192
|
{
|
|
193
193
|
callPEs.push_back(callPE);
|
|
194
194
|
}
|
|
195
|
+
/// Return call ICFGNode at the callsite
|
|
196
|
+
inline const CallICFGNode* getCallSite() const
|
|
197
|
+
{
|
|
198
|
+
assert(SVFUtil::isa<CallICFGNode>(getSrcNode()) && "not a CallICFGNode?");
|
|
199
|
+
return SVFUtil::cast<CallICFGNode>(getSrcNode());
|
|
200
|
+
}
|
|
195
201
|
/// Add get parameter edge to this CallCFGEdge
|
|
196
202
|
inline const std::vector<const CallPE*>& getCallPEs() const
|
|
197
203
|
{
|
|
@@ -243,6 +249,9 @@ public:
|
|
|
243
249
|
{
|
|
244
250
|
return retPE;
|
|
245
251
|
}
|
|
252
|
+
/// Return call ICFGNode at the callsite
|
|
253
|
+
const CallICFGNode* getCallSite() const;
|
|
254
|
+
|
|
246
255
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
247
256
|
//@{
|
|
248
257
|
static inline bool classof(const RetCFGEdge*)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -192,7 +192,7 @@ public:
|
|
|
192
192
|
return this->rawProductions;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
inline const Map<Kind,
|
|
195
|
+
inline const Map<Kind, Set<Attribute>>& getKindToAttrsMap() const
|
|
196
196
|
{
|
|
197
197
|
return this->kindToAttrsMap;
|
|
198
198
|
}
|
|
@@ -223,7 +223,7 @@ public:
|
|
|
223
223
|
|
|
224
224
|
void setRawProductions(SymbolMap<Symbol, Productions>& rawProductions);
|
|
225
225
|
|
|
226
|
-
void setKindToAttrsMap(const Map<Kind,
|
|
226
|
+
void setKindToAttrsMap(const Map<Kind, Set<Attribute>>& kindToAttrsMap);
|
|
227
227
|
|
|
228
228
|
void setAttributeKinds(const Set<Kind>& attributeKind);
|
|
229
229
|
|
|
@@ -282,7 +282,7 @@ private:
|
|
|
282
282
|
Map<std::string, Kind> terminals;
|
|
283
283
|
Map<std::string, Kind> EBNFSigns; /// Map contains Signs' String and associated Symbols
|
|
284
284
|
Set<Kind> attributeKinds;
|
|
285
|
-
Map<Kind,
|
|
285
|
+
Map<Kind, Set<Attribute>> kindToAttrsMap;
|
|
286
286
|
SymbolMap<Symbol, Productions> rawProductions;
|
|
287
287
|
u32_t totalKind;
|
|
288
288
|
};
|
|
@@ -60,7 +60,7 @@ protected:
|
|
|
60
60
|
Map<Kind, std::string> kindToLabelMap;
|
|
61
61
|
|
|
62
62
|
/// Map to maintain attributes associated with each kind
|
|
63
|
-
Map<CFGrammar::Kind,
|
|
63
|
+
Map<CFGrammar::Kind, Set<CFGrammar::Attribute>> kindToAttrsMap;
|
|
64
64
|
|
|
65
65
|
Kind current;
|
|
66
66
|
CFLGraph *cflGraph;
|
|
@@ -87,7 +87,7 @@ public:
|
|
|
87
87
|
/// Method to build a CFL graph by copying nodes and edges from any graph
|
|
88
88
|
/// inherited from GenericGraph
|
|
89
89
|
template<class N, class E>
|
|
90
|
-
CFLGraph* build(GenericGraph<N,E>* graph, GrammarBase *grammar, BuildDirection direction = BuildDirection::plain);
|
|
90
|
+
CFLGraph* build(GenericGraph<N, E>* graph, GrammarBase *grammar, BuildDirection direction = BuildDirection::plain);
|
|
91
91
|
|
|
92
92
|
/// Method to build a CFL graph from external file
|
|
93
93
|
CFLGraph* build(std::string fileName, GrammarBase *grammar, BuildDirection direction = BuildDirection::plain);
|
|
@@ -108,7 +108,7 @@ public:
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
/// Returns a reference to the map that associates Kinds with their corresponding attributes
|
|
111
|
-
Map<CFGrammar::Kind,
|
|
111
|
+
Map<CFGrammar::Kind, Set<CFGrammar::Attribute>>& getKindToAttrsMap()
|
|
112
112
|
{
|
|
113
113
|
return this->kindToAttrsMap;
|
|
114
114
|
}
|
|
@@ -51,7 +51,7 @@ typedef CxtStmtDPItem<SVFGNode> CxtLocDPItem;
|
|
|
51
51
|
/*!
|
|
52
52
|
* Context-, Flow- Sensitive Demand-driven Analysis
|
|
53
53
|
*/
|
|
54
|
-
class ContextDDA : public CondPTAImpl<ContextCond>, public DDAVFSolver<CxtVar,CxtPtSet,CxtLocDPItem>
|
|
54
|
+
class ContextDDA : public CondPTAImpl<ContextCond>, public DDAVFSolver<CxtVar, CxtPtSet, CxtLocDPItem>
|
|
55
55
|
{
|
|
56
56
|
|
|
57
57
|
public:
|
|
@@ -90,7 +90,7 @@ public:
|
|
|
90
90
|
ContextCond cxt;
|
|
91
91
|
for (PointsTo::iterator piter = pts.begin(); piter != pts.end(); ++piter)
|
|
92
92
|
{
|
|
93
|
-
CxtVar var(cxt
|
|
93
|
+
CxtVar var(cxt, *piter);
|
|
94
94
|
tmpCPts.set(var);
|
|
95
95
|
}
|
|
96
96
|
return tmpCPts;
|
|
@@ -125,7 +125,7 @@ private:
|
|
|
125
125
|
class FunptrDDAClient : public DDAClient
|
|
126
126
|
{
|
|
127
127
|
private:
|
|
128
|
-
typedef OrderedMap<NodeID,const CallICFGNode*> VTablePtrToCallSiteMap;
|
|
128
|
+
typedef OrderedMap<NodeID, const CallICFGNode*> VTablePtrToCallSiteMap;
|
|
129
129
|
VTablePtrToCallSiteMap vtableToCallSiteMap;
|
|
130
130
|
public:
|
|
131
131
|
FunptrDDAClient(SVFModule* module) : DDAClient(module) {}
|
|
@@ -156,7 +156,7 @@ public:
|
|
|
156
156
|
virtual void performStat(PointerAnalysis* pta);
|
|
157
157
|
|
|
158
158
|
private:
|
|
159
|
-
typedef OrderedMap<NodeID,const CallICFGNode*> VTablePtrToCallSiteMap;
|
|
159
|
+
typedef OrderedMap<NodeID, const CallICFGNode*> VTablePtrToCallSiteMap;
|
|
160
160
|
VTablePtrToCallSiteMap vtableToCallSiteMap;
|
|
161
161
|
PAGNodeSet loadSrcNodes;
|
|
162
162
|
PAGNodeSet storeDstNodes;
|
|
@@ -54,8 +54,8 @@ public:
|
|
|
54
54
|
typedef SVFIR::CallSiteSet CallSiteSet;
|
|
55
55
|
typedef OrderedSet<DPIm> DPTItemSet;
|
|
56
56
|
typedef OrderedMap<DPIm, CPtSet> DPImToCPtSetMap;
|
|
57
|
-
typedef OrderedMap<DPIm,CVar> DPMToCVarMap;
|
|
58
|
-
typedef OrderedMap<DPIm,DPIm> DPMToDPMMap;
|
|
57
|
+
typedef OrderedMap<DPIm, CVar> DPMToCVarMap;
|
|
58
|
+
typedef OrderedMap<DPIm, DPIm> DPMToDPMMap;
|
|
59
59
|
typedef OrderedMap<NodeID, DPTItemSet> LocToDPMVecMap;
|
|
60
60
|
typedef OrderedSet<const SVFGEdge* > ConstSVFGEdgeSet;
|
|
61
61
|
typedef SVFGEdge::SVFGEdgeSetTy SVFGEdgeSet;
|
|
@@ -198,7 +198,7 @@ protected:
|
|
|
198
198
|
startNewPTCompFromLoadSrc(loadpts,dpm);
|
|
199
199
|
for(typename CPtSet::iterator it = loadpts.begin(), eit = loadpts.end(); it!=eit; ++it)
|
|
200
200
|
{
|
|
201
|
-
backtraceAlongIndirectVF(pts,getDPImWithOldCond(dpm
|
|
201
|
+
backtraceAlongIndirectVF(pts,getDPImWithOldCond(dpm, *it,load));
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
else if(const StoreSVFGNode* store = SVFUtil::dyn_cast<StoreSVFGNode>(node))
|
|
@@ -223,7 +223,7 @@ protected:
|
|
|
223
223
|
{
|
|
224
224
|
if(propagateViaObj(*it,getLoadCVar(dpm)))
|
|
225
225
|
{
|
|
226
|
-
backtraceToStoreSrc(pts,getDPImWithOldCond(dpm
|
|
226
|
+
backtraceToStoreSrc(pts,getDPImWithOldCond(dpm, *it,store));
|
|
227
227
|
|
|
228
228
|
if(isStrongUpdate(storepts,store))
|
|
229
229
|
{
|
|
@@ -233,7 +233,7 @@ protected:
|
|
|
233
233
|
else
|
|
234
234
|
{
|
|
235
235
|
DOSTAT(rmSUStat(dpm,store);)
|
|
236
|
-
backtraceAlongIndirectVF(pts,getDPImWithOldCond(dpm
|
|
236
|
+
backtraceAlongIndirectVF(pts,getDPImWithOldCond(dpm, *it,store));
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
else
|
|
@@ -50,7 +50,7 @@ typedef StmtDPItem<SVFGNode> LocDPItem;
|
|
|
50
50
|
/*!
|
|
51
51
|
* Flow sensitive demand-driven analysis on value-flow graph
|
|
52
52
|
*/
|
|
53
|
-
class FlowDDA : public BVDataPTAImpl, public DDAVFSolver<NodeID,PointsTo,LocDPItem>
|
|
53
|
+
class FlowDDA : public BVDataPTAImpl, public DDAVFSolver<NodeID, PointsTo, LocDPItem>
|
|
54
54
|
{
|
|
55
55
|
|
|
56
56
|
public:
|
|
@@ -59,7 +59,7 @@ public:
|
|
|
59
59
|
typedef BVDataPTAImpl::FunctionSet FunctionSet;
|
|
60
60
|
/// Constructor
|
|
61
61
|
FlowDDA(SVFIR* _pag, DDAClient* client): BVDataPTAImpl(_pag, PointerAnalysis::FlowS_DDA),
|
|
62
|
-
DDAVFSolver<NodeID,PointsTo,LocDPItem>(),
|
|
62
|
+
DDAVFSolver<NodeID, PointsTo, LocDPItem>(),
|
|
63
63
|
_client(client)
|
|
64
64
|
{
|
|
65
65
|
}
|
|
@@ -72,7 +72,7 @@ public:
|
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
typedef GenericNode<CFLNode,CFLEdge> GenericCFLNodeTy;
|
|
75
|
+
typedef GenericNode<CFLNode, CFLEdge> GenericCFLNodeTy;
|
|
76
76
|
class CFLNode: public GenericCFLNodeTy
|
|
77
77
|
{
|
|
78
78
|
public:
|
|
@@ -151,13 +151,13 @@ public:
|
|
|
151
151
|
};
|
|
152
152
|
|
|
153
153
|
/// Edge-labeled graph for CFL Reachability analysis
|
|
154
|
-
typedef GenericGraph<CFLNode,CFLEdge> GenericCFLGraphTy;
|
|
154
|
+
typedef GenericGraph<CFLNode, CFLEdge> GenericCFLGraphTy;
|
|
155
155
|
class CFLGraph: public GenericCFLGraphTy
|
|
156
156
|
{
|
|
157
157
|
public:
|
|
158
158
|
typedef CFGrammar::Symbol Symbol;
|
|
159
159
|
typedef CFGrammar::Kind Kind;
|
|
160
|
-
typedef GenericNode<CFLNode,CFLEdge>::GEdgeSetTy CFLEdgeSet;
|
|
160
|
+
typedef GenericNode<CFLNode, CFLEdge>::GEdgeSetTy CFLEdgeSet;
|
|
161
161
|
Kind startKind;
|
|
162
162
|
|
|
163
163
|
CFLGraph(Kind kind)
|
|
@@ -195,17 +195,17 @@ namespace SVF
|
|
|
195
195
|
* GenericGraphTraits specializations for generic graph algorithms.
|
|
196
196
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
197
197
|
*/
|
|
198
|
-
template<> struct GenericGraphTraits<SVF::CFLNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::CFLNode,SVF::CFLEdge>* >
|
|
198
|
+
template<> struct GenericGraphTraits<SVF::CFLNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::CFLNode, SVF::CFLEdge>* >
|
|
199
199
|
{
|
|
200
200
|
};
|
|
201
201
|
|
|
202
202
|
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
203
203
|
template<>
|
|
204
|
-
struct GenericGraphTraits<Inverse<SVF::CFLNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::CFLNode,SVF::CFLEdge>* > >
|
|
204
|
+
struct GenericGraphTraits<Inverse<SVF::CFLNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::CFLNode, SVF::CFLEdge>* > >
|
|
205
205
|
{
|
|
206
206
|
};
|
|
207
207
|
|
|
208
|
-
template<> struct GenericGraphTraits<SVF::CFLGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::CFLNode,SVF::CFLEdge>* >
|
|
208
|
+
template<> struct GenericGraphTraits<SVF::CFLGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::CFLNode, SVF::CFLEdge>* >
|
|
209
209
|
{
|
|
210
210
|
typedef SVF::CFLNode *NodeRef;
|
|
211
211
|
};
|
|
@@ -163,14 +163,14 @@ public:
|
|
|
163
163
|
|
|
164
164
|
virtual const std::string toString() const;
|
|
165
165
|
|
|
166
|
-
typedef GenericNode<CallGraphNode,CallGraphEdge>::GEdgeSetTy CallGraphEdgeSet;
|
|
166
|
+
typedef GenericNode<CallGraphNode, CallGraphEdge>::GEdgeSetTy CallGraphEdgeSet;
|
|
167
167
|
|
|
168
168
|
};
|
|
169
169
|
|
|
170
170
|
/*
|
|
171
171
|
* Call Graph node representing a function
|
|
172
172
|
*/
|
|
173
|
-
typedef GenericNode<CallGraphNode,CallGraphEdge> GenericCallGraphNodeTy;
|
|
173
|
+
typedef GenericNode<CallGraphNode, CallGraphEdge> GenericCallGraphNodeTy;
|
|
174
174
|
class CallGraphNode : public GenericCallGraphNodeTy
|
|
175
175
|
{
|
|
176
176
|
|
|
@@ -214,7 +214,7 @@ public:
|
|
|
214
214
|
/*!
|
|
215
215
|
* Pointer Analysis Call Graph used internally for various pointer analysis
|
|
216
216
|
*/
|
|
217
|
-
typedef GenericGraph<CallGraphNode,CallGraphEdge> GenericCallGraphTy;
|
|
217
|
+
typedef GenericGraph<CallGraphNode, CallGraphEdge> GenericCallGraphTy;
|
|
218
218
|
class CallGraph : public GenericCallGraphTy
|
|
219
219
|
{
|
|
220
220
|
|
|
@@ -451,17 +451,17 @@ namespace SVF
|
|
|
451
451
|
* GenericGraphTraits specializations for generic graph algorithms.
|
|
452
452
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
453
453
|
*/
|
|
454
|
-
template<> struct GenericGraphTraits<SVF::CallGraphNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::CallGraphNode,SVF::CallGraphEdge>* >
|
|
454
|
+
template<> struct GenericGraphTraits<SVF::CallGraphNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::CallGraphNode, SVF::CallGraphEdge>* >
|
|
455
455
|
{
|
|
456
456
|
};
|
|
457
457
|
|
|
458
458
|
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
459
459
|
template<>
|
|
460
|
-
struct GenericGraphTraits<Inverse<SVF::CallGraphNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::CallGraphNode,SVF::CallGraphEdge>* > >
|
|
460
|
+
struct GenericGraphTraits<Inverse<SVF::CallGraphNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::CallGraphNode, SVF::CallGraphEdge>* > >
|
|
461
461
|
{
|
|
462
462
|
};
|
|
463
463
|
|
|
464
|
-
template<> struct GenericGraphTraits<SVF::CallGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::CallGraphNode,SVF::CallGraphEdge>* >
|
|
464
|
+
template<> struct GenericGraphTraits<SVF::CallGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::CallGraphNode, SVF::CallGraphEdge>* >
|
|
465
465
|
{
|
|
466
466
|
typedef SVF::CallGraphNode *NodeRef;
|
|
467
467
|
};
|
|
@@ -41,7 +41,7 @@ namespace SVF
|
|
|
41
41
|
* ConstraintNodes are same as PAGNodes
|
|
42
42
|
* ConstraintEdges are self-defined edges (initialized with ConstraintEdges)
|
|
43
43
|
*/
|
|
44
|
-
class ConstraintGraph : public GenericGraph<ConstraintNode,ConstraintEdge>
|
|
44
|
+
class ConstraintGraph : public GenericGraph<ConstraintNode, ConstraintEdge>
|
|
45
45
|
{
|
|
46
46
|
|
|
47
47
|
public:
|
|
@@ -387,17 +387,17 @@ public:
|
|
|
387
387
|
* GenericGraphTraits specializations for the generic graph algorithms.
|
|
388
388
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
389
389
|
*/
|
|
390
|
-
template<> struct GenericGraphTraits<SVF::ConstraintNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::ConstraintNode,SVF::ConstraintEdge>* >
|
|
390
|
+
template<> struct GenericGraphTraits<SVF::ConstraintNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::ConstraintNode, SVF::ConstraintEdge>* >
|
|
391
391
|
{
|
|
392
392
|
};
|
|
393
393
|
|
|
394
394
|
/// Inverse GenericGraphTraits specializations for Value flow node, it is used for inverse traversal.
|
|
395
395
|
template<>
|
|
396
|
-
struct GenericGraphTraits<Inverse<SVF::ConstraintNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::ConstraintNode,SVF::ConstraintEdge>* > >
|
|
396
|
+
struct GenericGraphTraits<Inverse<SVF::ConstraintNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::ConstraintNode, SVF::ConstraintEdge>* > >
|
|
397
397
|
{
|
|
398
398
|
};
|
|
399
399
|
|
|
400
|
-
template<> struct GenericGraphTraits<SVF::ConstraintGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::ConstraintNode,SVF::ConstraintEdge>* >
|
|
400
|
+
template<> struct GenericGraphTraits<SVF::ConstraintGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::ConstraintNode, SVF::ConstraintEdge>* >
|
|
401
401
|
{
|
|
402
402
|
typedef SVF::ConstraintNode *NodeRef;
|
|
403
403
|
};
|
|
@@ -82,7 +82,7 @@ public:
|
|
|
82
82
|
edge->getEdgeKind() == VariantGep;
|
|
83
83
|
}
|
|
84
84
|
/// Constraint edge type
|
|
85
|
-
typedef GenericNode<ConstraintNode,ConstraintEdge>::GEdgeSetTy ConstraintEdgeSetTy;
|
|
85
|
+
typedef GenericNode<ConstraintNode, ConstraintEdge>::GEdgeSetTy ConstraintEdgeSetTy;
|
|
86
86
|
|
|
87
87
|
};
|
|
88
88
|
|
|
@@ -137,7 +137,7 @@ protected:
|
|
|
137
137
|
/*!
|
|
138
138
|
* Generic node on the graph as base class
|
|
139
139
|
*/
|
|
140
|
-
template<class NodeTy,class EdgeTy>
|
|
140
|
+
template<class NodeTy, class EdgeTy>
|
|
141
141
|
class GenericNode
|
|
142
142
|
{
|
|
143
143
|
friend class SVFIRWriter;
|
|
@@ -506,7 +506,7 @@ inline mapped_iter<ItTy, FuncTy> map_iter(ItTy I, FuncTy F)
|
|
|
506
506
|
/*!
|
|
507
507
|
* GenericGraphTraits for nodes
|
|
508
508
|
*/
|
|
509
|
-
template<class NodeTy,class EdgeTy> struct GenericGraphTraits<SVF::GenericNode<NodeTy,EdgeTy>* >
|
|
509
|
+
template<class NodeTy, class EdgeTy> struct GenericGraphTraits<SVF::GenericNode<NodeTy, EdgeTy>* >
|
|
510
510
|
{
|
|
511
511
|
typedef NodeTy NodeType;
|
|
512
512
|
typedef EdgeTy EdgeType;
|
|
@@ -517,7 +517,7 @@ template<class NodeTy,class EdgeTy> struct GenericGraphTraits<SVF::GenericNode<N
|
|
|
517
517
|
}
|
|
518
518
|
|
|
519
519
|
// nodes_iterator/begin/end - Allow iteration over all nodes in the graph
|
|
520
|
-
typedef mapped_iter<typename SVF::GenericNode<NodeTy,EdgeTy>::iterator, decltype(&edge_dest)> ChildIteratorType;
|
|
520
|
+
typedef mapped_iter<typename SVF::GenericNode<NodeTy, EdgeTy>::iterator, decltype(&edge_dest)> ChildIteratorType;
|
|
521
521
|
|
|
522
522
|
static NodeType* getEntryNode(NodeType* pagN)
|
|
523
523
|
{
|
|
@@ -545,8 +545,8 @@ template<class NodeTy,class EdgeTy> struct GenericGraphTraits<SVF::GenericNode<N
|
|
|
545
545
|
/*!
|
|
546
546
|
* Inverse GenericGraphTraits for node which is used for inverse traversal.
|
|
547
547
|
*/
|
|
548
|
-
template<class NodeTy,class EdgeTy>
|
|
549
|
-
struct GenericGraphTraits<Inverse<SVF::GenericNode<NodeTy,EdgeTy>* > >
|
|
548
|
+
template<class NodeTy, class EdgeTy>
|
|
549
|
+
struct GenericGraphTraits<Inverse<SVF::GenericNode<NodeTy, EdgeTy>* > >
|
|
550
550
|
{
|
|
551
551
|
typedef NodeTy NodeType;
|
|
552
552
|
typedef EdgeTy EdgeType;
|
|
@@ -557,7 +557,7 @@ struct GenericGraphTraits<Inverse<SVF::GenericNode<NodeTy,EdgeTy>* > >
|
|
|
557
557
|
}
|
|
558
558
|
|
|
559
559
|
// nodes_iterator/begin/end - Allow iteration over all nodes in the graph
|
|
560
|
-
typedef mapped_iter<typename SVF::GenericNode<NodeTy,EdgeTy>::iterator, decltype(&edge_dest)> ChildIteratorType;
|
|
560
|
+
typedef mapped_iter<typename SVF::GenericNode<NodeTy, EdgeTy>::iterator, decltype(&edge_dest)> ChildIteratorType;
|
|
561
561
|
|
|
562
562
|
static inline NodeType* getEntryNode(Inverse<NodeType* > G)
|
|
563
563
|
{
|
|
@@ -582,9 +582,9 @@ struct GenericGraphTraits<Inverse<SVF::GenericNode<NodeTy,EdgeTy>* > >
|
|
|
582
582
|
/*!
|
|
583
583
|
* GraphTraints
|
|
584
584
|
*/
|
|
585
|
-
template<class NodeTy,class EdgeTy> struct GenericGraphTraits<SVF::GenericGraph<NodeTy,EdgeTy>* > : public GenericGraphTraits<SVF::GenericNode<NodeTy,EdgeTy>* >
|
|
585
|
+
template<class NodeTy, class EdgeTy> struct GenericGraphTraits<SVF::GenericGraph<NodeTy, EdgeTy>* > : public GenericGraphTraits<SVF::GenericNode<NodeTy, EdgeTy>* >
|
|
586
586
|
{
|
|
587
|
-
typedef SVF::GenericGraph<NodeTy,EdgeTy> GenericGraphTy;
|
|
587
|
+
typedef SVF::GenericGraph<NodeTy, EdgeTy> GenericGraphTy;
|
|
588
588
|
typedef NodeTy NodeType;
|
|
589
589
|
typedef EdgeTy EdgeType;
|
|
590
590
|
|
|
@@ -43,7 +43,7 @@ class CallGraph;
|
|
|
43
43
|
/*!
|
|
44
44
|
* Interprocedural Control-Flow Graph (ICFG)
|
|
45
45
|
*/
|
|
46
|
-
typedef GenericGraph<ICFGNode,ICFGEdge> GenericICFGTy;
|
|
46
|
+
typedef GenericGraph<ICFGNode, ICFGEdge> GenericICFGTy;
|
|
47
47
|
class ICFG : public GenericICFGTy
|
|
48
48
|
{
|
|
49
49
|
friend class ICFGBuilder;
|
|
@@ -364,17 +364,17 @@ namespace SVF
|
|
|
364
364
|
* GenericGraphTraits specializations for generic graph algorithms.
|
|
365
365
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
366
366
|
*/
|
|
367
|
-
template<> struct GenericGraphTraits<SVF::ICFGNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::ICFGNode,SVF::ICFGEdge>* >
|
|
367
|
+
template<> struct GenericGraphTraits<SVF::ICFGNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::ICFGNode, SVF::ICFGEdge>* >
|
|
368
368
|
{
|
|
369
369
|
};
|
|
370
370
|
|
|
371
371
|
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
372
372
|
template<>
|
|
373
|
-
struct GenericGraphTraits<Inverse<SVF::ICFGNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::ICFGNode,SVF::ICFGEdge>* > >
|
|
373
|
+
struct GenericGraphTraits<Inverse<SVF::ICFGNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::ICFGNode, SVF::ICFGEdge>* > >
|
|
374
374
|
{
|
|
375
375
|
};
|
|
376
376
|
|
|
377
|
-
template<> struct GenericGraphTraits<SVF::ICFG*> : public GenericGraphTraits<SVF::GenericGraph<SVF::ICFGNode,SVF::ICFGEdge>* >
|
|
377
|
+
template<> struct GenericGraphTraits<SVF::ICFG*> : public GenericGraphTraits<SVF::GenericGraph<SVF::ICFGNode, SVF::ICFGEdge>* >
|
|
378
378
|
{
|
|
379
379
|
typedef SVF::ICFGNode *NodeRef;
|
|
380
380
|
};
|
|
@@ -192,6 +192,12 @@ public:
|
|
|
192
192
|
{
|
|
193
193
|
callPEs.push_back(callPE);
|
|
194
194
|
}
|
|
195
|
+
/// Return call ICFGNode at the callsite
|
|
196
|
+
inline const CallICFGNode* getCallSite() const
|
|
197
|
+
{
|
|
198
|
+
assert(SVFUtil::isa<CallICFGNode>(getSrcNode()) && "not a CallICFGNode?");
|
|
199
|
+
return SVFUtil::cast<CallICFGNode>(getSrcNode());
|
|
200
|
+
}
|
|
195
201
|
/// Add get parameter edge to this CallCFGEdge
|
|
196
202
|
inline const std::vector<const CallPE*>& getCallPEs() const
|
|
197
203
|
{
|
|
@@ -243,6 +249,9 @@ public:
|
|
|
243
249
|
{
|
|
244
250
|
return retPE;
|
|
245
251
|
}
|
|
252
|
+
/// Return call ICFGNode at the callsite
|
|
253
|
+
const CallICFGNode* getCallSite() const;
|
|
254
|
+
|
|
246
255
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
247
256
|
//@{
|
|
248
257
|
static inline bool classof(const RetCFGEdge*)
|
|
@@ -53,7 +53,7 @@ class IRGraph : public GenericGraph<SVFVar, SVFStmt>
|
|
|
53
53
|
|
|
54
54
|
public:
|
|
55
55
|
typedef Set<const SVFStmt*> SVFStmtSet;
|
|
56
|
-
typedef Map<const SVFValue*,SVFStmtSet> ValueToEdgeMap;
|
|
56
|
+
typedef Map<const SVFValue*, SVFStmtSet> ValueToEdgeMap;
|
|
57
57
|
|
|
58
58
|
protected:
|
|
59
59
|
SVFStmt::KindToSVFStmtMapTy KindToSVFStmtSetMap; ///< SVFIR edge map containing all PAGEdges
|
|
@@ -234,16 +234,16 @@ namespace SVF
|
|
|
234
234
|
* GenericGraphTraits specializations of SVFIR to be used for the generic graph algorithms.
|
|
235
235
|
* Provide graph traits for traversing from a SVFIR node using standard graph traversals.
|
|
236
236
|
*/
|
|
237
|
-
template<> struct GenericGraphTraits<SVF::SVFVar*> : public GenericGraphTraits<SVF::GenericNode<SVF::SVFVar,SVF::SVFStmt>* >
|
|
237
|
+
template<> struct GenericGraphTraits<SVF::SVFVar*> : public GenericGraphTraits<SVF::GenericNode<SVF::SVFVar, SVF::SVFStmt>* >
|
|
238
238
|
{
|
|
239
239
|
};
|
|
240
240
|
|
|
241
241
|
/// Inverse GenericGraphTraits specializations for SVFIR node, it is used for inverse traversal.
|
|
242
|
-
template<> struct GenericGraphTraits<Inverse<SVF::SVFVar *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::SVFVar,SVF::SVFStmt>* > >
|
|
242
|
+
template<> struct GenericGraphTraits<Inverse<SVF::SVFVar *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::SVFVar, SVF::SVFStmt>* > >
|
|
243
243
|
{
|
|
244
244
|
};
|
|
245
245
|
|
|
246
|
-
template<> struct GenericGraphTraits<SVF::IRGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::SVFVar,SVF::SVFStmt>* >
|
|
246
|
+
template<> struct GenericGraphTraits<SVF::IRGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::SVFVar, SVF::SVFStmt>* >
|
|
247
247
|
{
|
|
248
248
|
typedef SVF::SVFVar* NodeRef;
|
|
249
249
|
};
|
|
@@ -113,7 +113,7 @@ public:
|
|
|
113
113
|
NodeBS _subNodes; /// nodes in the scc represented by this node
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
-
typedef Map<NodeID,GNodeSCCInfo > GNODESCCInfoMap;
|
|
116
|
+
typedef Map<NodeID, GNodeSCCInfo > GNODESCCInfoMap;
|
|
117
117
|
typedef Map<NodeID, NodeID> NodeToNodeMap;
|
|
118
118
|
|
|
119
119
|
SCCDetection(const GraphType >)
|
|
@@ -434,8 +434,8 @@ protected:
|
|
|
434
434
|
}
|
|
435
435
|
|
|
436
436
|
/// Add memory SSA PHI SVFG node
|
|
437
|
-
inline void addIntraMSSAPHISVFGNode(ICFGNode* BlockICFGNode, const Map<u32_t,const MRVer*>::const_iterator opVerBegin,
|
|
438
|
-
const Map<u32_t,const MRVer*>::const_iterator opVerEnd, const MRVer* resVer, const NodeID nodeId)
|
|
437
|
+
inline void addIntraMSSAPHISVFGNode(ICFGNode* BlockICFGNode, const Map<u32_t, const MRVer*>::const_iterator opVerBegin,
|
|
438
|
+
const Map<u32_t, const MRVer*>::const_iterator opVerEnd, const MRVer* resVer, const NodeID nodeId)
|
|
439
439
|
{
|
|
440
440
|
IntraMSSAPHISVFGNode* sNode = new IntraMSSAPHISVFGNode(nodeId, resVer);
|
|
441
441
|
addSVFGNode(sNode, BlockICFGNode);
|
|
@@ -481,7 +481,7 @@ namespace SVF
|
|
|
481
481
|
//struct GenericGraphTraits<Inverse<SVF::SVFGNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::SVFGNode,SVF::SVFGEdge>* > > {
|
|
482
482
|
//};
|
|
483
483
|
|
|
484
|
-
template<> struct GenericGraphTraits<SVF::SVFG*> : public GenericGraphTraits<SVF::GenericGraph<SVF::SVFGNode,SVF::SVFGEdge>* >
|
|
484
|
+
template<> struct GenericGraphTraits<SVF::SVFG*> : public GenericGraphTraits<SVF::GenericGraph<SVF::SVFGNode, SVF::SVFGEdge>* >
|
|
485
485
|
{
|
|
486
486
|
typedef SVF::SVFGNode *NodeRef;
|
|
487
487
|
};
|
|
@@ -46,7 +46,7 @@ class CallICFGNode;
|
|
|
46
46
|
/*!
|
|
47
47
|
* Value Flow Graph (VFG)
|
|
48
48
|
*/
|
|
49
|
-
typedef GenericGraph<VFGNode,VFGEdge> GenericVFGTy;
|
|
49
|
+
typedef GenericGraph<VFGNode, VFGEdge> GenericVFGTy;
|
|
50
50
|
class VFG : public GenericVFGTy
|
|
51
51
|
{
|
|
52
52
|
|
|
@@ -60,7 +60,7 @@ public:
|
|
|
60
60
|
typedef OrderedMap<NodeID, VFGNode *> VFGNodeIDToNodeMapTy;
|
|
61
61
|
typedef Set<VFGNode*> VFGNodeSet;
|
|
62
62
|
typedef Map<const PAGNode*, NodeID> PAGNodeToDefMapTy;
|
|
63
|
-
typedef Map<std::pair<NodeID,const CallICFGNode*>, ActualParmVFGNode *> PAGNodeToActualParmMapTy;
|
|
63
|
+
typedef Map<std::pair<NodeID, const CallICFGNode*>, ActualParmVFGNode *> PAGNodeToActualParmMapTy;
|
|
64
64
|
typedef Map<const PAGNode*, ActualRetVFGNode *> PAGNodeToActualRetMapTy;
|
|
65
65
|
typedef Map<const PAGNode*, FormalParmVFGNode *> PAGNodeToFormalParmMapTy;
|
|
66
66
|
typedef Map<const PAGNode*, FormalRetVFGNode *> PAGNodeToFormalRetMapTy;
|
|
@@ -644,17 +644,17 @@ namespace SVF
|
|
|
644
644
|
* GenericGraphTraits specializations for generic graph algorithms.
|
|
645
645
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
646
646
|
*/
|
|
647
|
-
template<> struct GenericGraphTraits<SVF::VFGNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::VFGNode,SVF::VFGEdge>* >
|
|
647
|
+
template<> struct GenericGraphTraits<SVF::VFGNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::VFGNode, SVF::VFGEdge>* >
|
|
648
648
|
{
|
|
649
649
|
};
|
|
650
650
|
|
|
651
651
|
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
652
652
|
template<>
|
|
653
|
-
struct GenericGraphTraits<Inverse<SVF::VFGNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::VFGNode,SVF::VFGEdge>* > >
|
|
653
|
+
struct GenericGraphTraits<Inverse<SVF::VFGNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::VFGNode, SVF::VFGEdge>* > >
|
|
654
654
|
{
|
|
655
655
|
};
|
|
656
656
|
|
|
657
|
-
template<> struct GenericGraphTraits<SVF::VFG*> : public GenericGraphTraits<SVF::GenericGraph<SVF::VFGNode,SVF::VFGEdge>* >
|
|
657
|
+
template<> struct GenericGraphTraits<SVF::VFG*> : public GenericGraphTraits<SVF::GenericGraph<SVF::VFGNode, SVF::VFGEdge>* >
|
|
658
658
|
{
|
|
659
659
|
typedef SVF::VFGNode *NodeRef;
|
|
660
660
|
};
|
|
@@ -114,7 +114,7 @@ public:
|
|
|
114
114
|
return getEdgeKind() == TheadMHPIndirectVF;
|
|
115
115
|
}
|
|
116
116
|
//@}
|
|
117
|
-
typedef GenericNode<VFGNode,VFGEdge>::GEdgeSetTy VFGEdgeSetTy;
|
|
117
|
+
typedef GenericNode<VFGNode, VFGEdge>::GEdgeSetTy VFGEdgeSetTy;
|
|
118
118
|
typedef VFGEdgeSetTy SVFGEdgeSetTy;
|
|
119
119
|
/// Compute the unique edgeFlag value from edge kind and CallSiteID.
|
|
120
120
|
static inline GEdgeFlag makeEdgeFlagWithInvokeID(GEdgeKind k, CallSiteID cs)
|
|
@@ -42,7 +42,7 @@ namespace SVF
|
|
|
42
42
|
* Interprocedural control-flow graph node, representing different kinds of program statements
|
|
43
43
|
* including top-level pointers (ValVar) and address-taken objects (ObjVar)
|
|
44
44
|
*/
|
|
45
|
-
typedef GenericNode<VFGNode,VFGEdge> GenericVFGNodeTy;
|
|
45
|
+
typedef GenericNode<VFGNode, VFGEdge> GenericVFGNodeTy;
|
|
46
46
|
class VFGNode : public GenericVFGNodeTy
|
|
47
47
|
{
|
|
48
48
|
|
|
@@ -318,7 +318,7 @@ public:
|
|
|
318
318
|
class CmpVFGNode: public VFGNode
|
|
319
319
|
{
|
|
320
320
|
public:
|
|
321
|
-
typedef Map<u32_t,const PAGNode*> OPVers;
|
|
321
|
+
typedef Map<u32_t, const PAGNode*> OPVers;
|
|
322
322
|
protected:
|
|
323
323
|
const PAGNode* res;
|
|
324
324
|
OPVers opVers;
|
|
@@ -389,7 +389,7 @@ public:
|
|
|
389
389
|
class BinaryOPVFGNode: public VFGNode
|
|
390
390
|
{
|
|
391
391
|
public:
|
|
392
|
-
typedef Map<u32_t,const PAGNode*> OPVers;
|
|
392
|
+
typedef Map<u32_t, const PAGNode*> OPVers;
|
|
393
393
|
protected:
|
|
394
394
|
const PAGNode* res;
|
|
395
395
|
OPVers opVers;
|
|
@@ -459,7 +459,7 @@ public:
|
|
|
459
459
|
class UnaryOPVFGNode: public VFGNode
|
|
460
460
|
{
|
|
461
461
|
public:
|
|
462
|
-
typedef Map<u32_t,const PAGNode*> OPVers;
|
|
462
|
+
typedef Map<u32_t, const PAGNode*> OPVers;
|
|
463
463
|
protected:
|
|
464
464
|
const PAGNode* res;
|
|
465
465
|
OPVers opVers;
|
|
@@ -630,7 +630,7 @@ class PHIVFGNode : public VFGNode
|
|
|
630
630
|
{
|
|
631
631
|
|
|
632
632
|
public:
|
|
633
|
-
typedef Map<u32_t,const PAGNode*> OPVers;
|
|
633
|
+
typedef Map<u32_t, const PAGNode*> OPVers;
|
|
634
634
|
protected:
|
|
635
635
|
const PAGNode* res;
|
|
636
636
|
OPVers opVers;
|
|
@@ -705,7 +705,7 @@ class IntraPHIVFGNode : public PHIVFGNode
|
|
|
705
705
|
{
|
|
706
706
|
|
|
707
707
|
public:
|
|
708
|
-
typedef Map<u32_t,const ICFGNode*> OPIncomingBBs;
|
|
708
|
+
typedef Map<u32_t, const ICFGNode*> OPIncomingBBs;
|
|
709
709
|
|
|
710
710
|
private:
|
|
711
711
|
OPIncomingBBs opIncomingBBs;
|
|
@@ -714,7 +714,7 @@ protected:
|
|
|
714
714
|
void visit(const WTONodeT& node) override
|
|
715
715
|
{
|
|
716
716
|
_nodeToWTOCycleDepth.insert(
|
|
717
|
-
|
|
717
|
+
std::make_pair(node.getICFGNode(), _wtoCycleDepth));
|
|
718
718
|
}
|
|
719
719
|
|
|
720
720
|
}; // end class WTOCycleDepthBuilder
|
|
@@ -189,27 +189,27 @@ private:
|
|
|
189
189
|
inline void AddLoadMU(const SVFBasicBlock* bb, const LoadStmt* load, const MRSet& mrSet)
|
|
190
190
|
{
|
|
191
191
|
for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
|
|
192
|
-
AddLoadMU(bb,load
|
|
192
|
+
AddLoadMU(bb,load, *iter);
|
|
193
193
|
}
|
|
194
194
|
inline void AddStoreCHI(const SVFBasicBlock* bb, const StoreStmt* store, const MRSet& mrSet)
|
|
195
195
|
{
|
|
196
196
|
for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
|
|
197
|
-
AddStoreCHI(bb,store
|
|
197
|
+
AddStoreCHI(bb,store, *iter);
|
|
198
198
|
}
|
|
199
199
|
inline void AddCallSiteMU(const CallICFGNode* cs, const MRSet& mrSet)
|
|
200
200
|
{
|
|
201
201
|
for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
|
|
202
|
-
AddCallSiteMU(cs
|
|
202
|
+
AddCallSiteMU(cs, *iter);
|
|
203
203
|
}
|
|
204
204
|
inline void AddCallSiteCHI(const CallICFGNode* cs, const MRSet& mrSet)
|
|
205
205
|
{
|
|
206
206
|
for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
|
|
207
|
-
AddCallSiteCHI(cs
|
|
207
|
+
AddCallSiteCHI(cs, *iter);
|
|
208
208
|
}
|
|
209
209
|
inline void AddMSSAPHI(const SVFBasicBlock* bb, const MRSet& mrSet)
|
|
210
210
|
{
|
|
211
211
|
for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
|
|
212
|
-
AddMSSAPHI(bb
|
|
212
|
+
AddMSSAPHI(bb, *iter);
|
|
213
213
|
}
|
|
214
214
|
inline void AddLoadMU(const SVFBasicBlock* bb, const LoadStmt* load, const MemRegion* mr)
|
|
215
215
|
{
|
|
@@ -183,7 +183,7 @@ public:
|
|
|
183
183
|
const CxtLock& lock = *it;
|
|
184
184
|
for(CxtLockSet::const_iterator lit = lockset2.begin(), elit = lockset2.end(); lit!=elit; ++lit)
|
|
185
185
|
{
|
|
186
|
-
if(isAliasedLocks(lock
|
|
186
|
+
if(isAliasedLocks(lock, *lit))
|
|
187
187
|
return true;
|
|
188
188
|
}
|
|
189
189
|
}
|
|
@@ -362,7 +362,7 @@ private:
|
|
|
362
362
|
{
|
|
363
363
|
for(CxtLockSet::const_iterator it = srclockset.begin(), eit = srclockset.end(); it!=eit; ++it)
|
|
364
364
|
{
|
|
365
|
-
addCxtStmtToSpan(tgr
|
|
365
|
+
addCxtStmtToSpan(tgr, *it);
|
|
366
366
|
}
|
|
367
367
|
pushToCTSWorkList(tgr);
|
|
368
368
|
}
|
|
@@ -49,13 +49,13 @@ public:
|
|
|
49
49
|
typedef Set<const SVFFunction*> FunSet;
|
|
50
50
|
typedef FIFOWorkList<CxtThreadStmt> CxtThreadStmtWorkList;
|
|
51
51
|
typedef Set<CxtThreadStmt> CxtThreadStmtSet;
|
|
52
|
-
typedef Map<CxtThreadStmt,NodeBS> ThreadStmtToThreadInterleav;
|
|
53
|
-
typedef Map<const ICFGNode*,CxtThreadStmtSet> InstToThreadStmtSetMap;
|
|
52
|
+
typedef Map<CxtThreadStmt, NodeBS> ThreadStmtToThreadInterleav;
|
|
53
|
+
typedef Map<const ICFGNode*, CxtThreadStmtSet> InstToThreadStmtSetMap;
|
|
54
54
|
typedef SVFLoopAndDomInfo::LoopBBs LoopBBs;
|
|
55
55
|
|
|
56
56
|
typedef Set<CxtStmt> LockSpan;
|
|
57
57
|
|
|
58
|
-
typedef std::pair<const SVFFunction*,const SVFFunction*> FuncPair;
|
|
58
|
+
typedef std::pair<const SVFFunction*, const SVFFunction*> FuncPair;
|
|
59
59
|
typedef Map<FuncPair, bool> FuncPairToBool;
|
|
60
60
|
|
|
61
61
|
/// Constructor
|
|
@@ -284,8 +284,8 @@ public:
|
|
|
284
284
|
|
|
285
285
|
typedef SVFLoopAndDomInfo::LoopBBs LoopBBs;
|
|
286
286
|
typedef TCT::InstVec InstVec;
|
|
287
|
-
typedef Map<CxtStmt,ValDomain> CxtStmtToAliveFlagMap;
|
|
288
|
-
typedef Map<CxtStmt,NodeBS> CxtStmtToTIDMap;
|
|
287
|
+
typedef Map<CxtStmt, ValDomain> CxtStmtToAliveFlagMap;
|
|
288
|
+
typedef Map<CxtStmt, NodeBS> CxtStmtToTIDMap;
|
|
289
289
|
typedef Set<NodePair> ThreadPairSet;
|
|
290
290
|
typedef Map<CxtStmt, LoopBBs> CxtStmtToLoopMap;
|
|
291
291
|
typedef FIFOWorkList<CxtStmt> CxtStmtWorkList;
|
|
@@ -143,9 +143,9 @@ public:
|
|
|
143
143
|
typedef std::vector<const ICFGNode*> InstVec;
|
|
144
144
|
typedef Set<const ICFGNode*> InstSet;
|
|
145
145
|
typedef Set<const CallGraphNode*> PTACGNodeSet;
|
|
146
|
-
typedef Map<CxtThread,TCTNode*> CxtThreadToNodeMap;
|
|
147
|
-
typedef Map<CxtThread,CallStrCxt> CxtThreadToForkCxt;
|
|
148
|
-
typedef Map<CxtThread,const SVFFunction*> CxtThreadToFun;
|
|
146
|
+
typedef Map<CxtThread, TCTNode*> CxtThreadToNodeMap;
|
|
147
|
+
typedef Map<CxtThread, CallStrCxt> CxtThreadToForkCxt;
|
|
148
|
+
typedef Map<CxtThread, const SVFFunction*> CxtThreadToFun;
|
|
149
149
|
typedef Map<const ICFGNode*, LoopBBs> InstToLoopMap;
|
|
150
150
|
typedef FIFOWorkList<CxtThreadProc> CxtThreadProcVec;
|
|
151
151
|
typedef Set<CxtThreadProc> CxtThreadProcSet;
|
|
@@ -588,17 +588,17 @@ namespace SVF
|
|
|
588
588
|
* graphs by the generic graph algorithms.
|
|
589
589
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
590
590
|
*/
|
|
591
|
-
template<> struct GenericGraphTraits<SVF::TCTNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::TCTNode,SVF::TCTEdge>* >
|
|
591
|
+
template<> struct GenericGraphTraits<SVF::TCTNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::TCTNode, SVF::TCTEdge>* >
|
|
592
592
|
{
|
|
593
593
|
};
|
|
594
594
|
|
|
595
595
|
/// Inverse GenericGraphTraits specializations for Value flow node, it is used for inverse traversal.
|
|
596
596
|
template<>
|
|
597
|
-
struct GenericGraphTraits<Inverse<SVF::TCTNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::TCTNode,SVF::TCTEdge>* > >
|
|
597
|
+
struct GenericGraphTraits<Inverse<SVF::TCTNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::TCTNode, SVF::TCTEdge>* > >
|
|
598
598
|
{
|
|
599
599
|
};
|
|
600
600
|
|
|
601
|
-
template<> struct GenericGraphTraits<SVF::TCT*> : public GenericGraphTraits<SVF::GenericGraph<SVF::TCTNode,SVF::TCTEdge>* >
|
|
601
|
+
template<> struct GenericGraphTraits<SVF::TCT*> : public GenericGraphTraits<SVF::GenericGraph<SVF::TCTNode, SVF::TCTEdge>* >
|
|
602
602
|
{
|
|
603
603
|
typedef SVF::TCTNode *NodeRef;
|
|
604
604
|
};
|
|
@@ -245,9 +245,9 @@ public:
|
|
|
245
245
|
typedef CondStdSet<CVar> CPtSet;
|
|
246
246
|
typedef PTData<CVar, Set<CVar>, CVar, CPtSet> PTDataTy;
|
|
247
247
|
typedef MutablePTData<CVar, Set<CVar>, CVar, CPtSet> MutPTDataTy;
|
|
248
|
-
typedef Map<NodeID,PointsTo> PtrToBVPtsMap; /// map a pointer to its BitVector points-to representation
|
|
248
|
+
typedef Map<NodeID, PointsTo> PtrToBVPtsMap; /// map a pointer to its BitVector points-to representation
|
|
249
249
|
typedef Map<NodeID, NodeSet> PtrToNSMap;
|
|
250
|
-
typedef Map<NodeID,CPtSet> PtrToCPtsMap; /// map a pointer to its conditional points-to set
|
|
250
|
+
typedef Map<NodeID, CPtSet> PtrToCPtsMap; /// map a pointer to its conditional points-to set
|
|
251
251
|
|
|
252
252
|
/// Constructor
|
|
253
253
|
CondPTAImpl(SVFIR* pag, PointerAnalysis::PTATY type) : PointerAnalysis(pag, type), normalized(false)
|
|
@@ -328,7 +328,7 @@ public:
|
|
|
328
328
|
{
|
|
329
329
|
for (typename CPtSet::const_iterator it2 = cpts2.begin(); it2 != cpts2.end(); ++it2)
|
|
330
330
|
{
|
|
331
|
-
if(isSameVar(*it1
|
|
331
|
+
if(isSameVar(*it1, *it2))
|
|
332
332
|
return true;
|
|
333
333
|
}
|
|
334
334
|
}
|
|
@@ -346,7 +346,7 @@ public:
|
|
|
346
346
|
NodeBS& fields = pag->getAllFieldsObjVars(cit->get_id());
|
|
347
347
|
for(NodeBS::iterator it = fields.begin(), eit = fields.end(); it!=eit; ++it)
|
|
348
348
|
{
|
|
349
|
-
CVar cvar(cit->get_cond()
|
|
349
|
+
CVar cvar(cit->get_cond(), *it);
|
|
350
350
|
expandedCpts.set(cvar);
|
|
351
351
|
}
|
|
352
352
|
}
|
|
@@ -407,7 +407,7 @@ protected:
|
|
|
407
407
|
bool hasObj = false;
|
|
408
408
|
for (typename CPtSet::const_iterator it1 = cpts1.begin(); it1 != cpts1.end(); ++it1)
|
|
409
409
|
{
|
|
410
|
-
if(isSameVar(*it1
|
|
410
|
+
if(isSameVar(*it1, *it2))
|
|
411
411
|
{
|
|
412
412
|
hasObj = true;
|
|
413
413
|
break;
|
|
@@ -43,7 +43,7 @@ class LeakChecker : public SrcSnkDDA
|
|
|
43
43
|
{
|
|
44
44
|
|
|
45
45
|
public:
|
|
46
|
-
typedef Map<const SVFGNode*,const CallICFGNode*> SVFGNodeToCSIDMap;
|
|
46
|
+
typedef Map<const SVFGNode*, const CallICFGNode*> SVFGNodeToCSIDMap;
|
|
47
47
|
typedef FIFOWorkList<const CallICFGNode*> CSWorkList;
|
|
48
48
|
typedef ProgSlice::VFWorkList WorkList;
|
|
49
49
|
typedef NodeBS SVFGNodeBS;
|
|
@@ -50,10 +50,10 @@ public:
|
|
|
50
50
|
|
|
51
51
|
typedef Z3Expr Condition; /// z3 condition
|
|
52
52
|
typedef Map<u32_t, const ICFGNode*> IndexToTermInstMap; /// id to instruction map for z3
|
|
53
|
-
typedef Map<u32_t,Condition> CondPosMap; ///< map a branch to its Condition
|
|
53
|
+
typedef Map<u32_t, Condition> CondPosMap; ///< map a branch to its Condition
|
|
54
54
|
typedef Map<const SVFBasicBlock*, CondPosMap > BBCondMap; /// map bb to a Condition
|
|
55
55
|
typedef Set<const SVFBasicBlock*> BasicBlockSet;
|
|
56
|
-
typedef Map<const SVFFunction*,
|
|
56
|
+
typedef Map<const SVFFunction*, BasicBlockSet> FunToExitBBsMap; ///< map a function to all its basic blocks calling program exit
|
|
57
57
|
typedef Map<const SVFBasicBlock*, Condition> BBToCondMap; ///< map a basic block to its condition during control-flow guard computation
|
|
58
58
|
typedef FIFOWorkList<const SVFBasicBlock*> CFWorkList; ///< worklist for control-flow guard computation
|
|
59
59
|
typedef Map<const SVFGNode*, Set<const SVFGNode*>> SVFGNodeToSVFGNodeSetMap;
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
namespace SVF
|
|
47
47
|
{
|
|
48
48
|
|
|
49
|
-
typedef GraphReachSolver<SVFG*,CxtDPItem> CFLSrcSnkSolver;
|
|
49
|
+
typedef GraphReachSolver<SVFG*, CxtDPItem> CFLSrcSnkSolver;
|
|
50
50
|
|
|
51
51
|
/*!
|
|
52
52
|
* General source-sink analysis, which serves as a base analysis to be extended for various clients
|
|
@@ -56,7 +56,7 @@ class SrcSnkDDA : public CFLSrcSnkSolver
|
|
|
56
56
|
|
|
57
57
|
public:
|
|
58
58
|
typedef ProgSlice::SVFGNodeSet SVFGNodeSet;
|
|
59
|
-
typedef Map<const SVFGNode*,ProgSlice*> SVFGNodeToSliceMap;
|
|
59
|
+
typedef Map<const SVFGNode*, ProgSlice*> SVFGNodeToSliceMap;
|
|
60
60
|
typedef SVFGNodeSet::const_iterator SVFGNodeSetIter;
|
|
61
61
|
typedef CxtDPItem DPIm;
|
|
62
62
|
typedef Set<DPIm> DPImSet; ///< dpitem set
|
|
@@ -104,7 +104,7 @@ protected:
|
|
|
104
104
|
child_iterator EE = GTraits::child_end(v);
|
|
105
105
|
for (; EI != EE; ++EI)
|
|
106
106
|
{
|
|
107
|
-
FWProcessOutgoingEdge(item
|
|
107
|
+
FWProcessOutgoingEdge(item, *(EI.getCurrent()) );
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -123,7 +123,7 @@ protected:
|
|
|
123
123
|
inv_child_iterator EE = InvGTraits::child_end(v);
|
|
124
124
|
for (; EI != EE; ++EI)
|
|
125
125
|
{
|
|
126
|
-
BWProcessIncomingEdge(item
|
|
126
|
+
BWProcessIncomingEdge(item, *(EI.getCurrent()) );
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -457,17 +457,17 @@ namespace SVF
|
|
|
457
457
|
* GenericGraphTraits specializations for generic graph algorithms.
|
|
458
458
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
459
459
|
*/
|
|
460
|
-
template<> struct GenericGraphTraits<SVF::DCHNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::DCHNode,SVF::DCHEdge>* >
|
|
460
|
+
template<> struct GenericGraphTraits<SVF::DCHNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::DCHNode, SVF::DCHEdge>* >
|
|
461
461
|
{
|
|
462
462
|
};
|
|
463
463
|
|
|
464
464
|
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
465
465
|
template<>
|
|
466
|
-
struct GenericGraphTraits<Inverse<SVF::DCHNode*> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::DCHNode,SVF::DCHEdge>* > >
|
|
466
|
+
struct GenericGraphTraits<Inverse<SVF::DCHNode*> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::DCHNode, SVF::DCHEdge>* > >
|
|
467
467
|
{
|
|
468
468
|
};
|
|
469
469
|
|
|
470
|
-
template<> struct GenericGraphTraits<SVF::DCHGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::DCHNode,SVF::DCHEdge>* >
|
|
470
|
+
template<> struct GenericGraphTraits<SVF::DCHGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::DCHNode, SVF::DCHEdge>* >
|
|
471
471
|
{
|
|
472
472
|
typedef SVF::DCHNode *NodeRef;
|
|
473
473
|
};
|
|
@@ -17,9 +17,9 @@ template<typename ItTy = User::const_op_iterator>
|
|
|
17
17
|
class generic_bridge_gep_type_iterator : public std::iterator<std::forward_iterator_tag, Type*, ptrdiff_t>
|
|
18
18
|
{
|
|
19
19
|
|
|
20
|
-
typedef std::iterator<std::forward_iterator_tag,Type*, ptrdiff_t> super;
|
|
20
|
+
typedef std::iterator<std::forward_iterator_tag, Type*, ptrdiff_t> super;
|
|
21
21
|
ItTy OpIt;
|
|
22
|
-
PointerIntPair<Type*,1> CurTy;
|
|
22
|
+
PointerIntPair<Type*, 1> CurTy;
|
|
23
23
|
unsigned AddrSpace;
|
|
24
24
|
generic_bridge_gep_type_iterator() {}
|
|
25
25
|
public:
|
|
@@ -52,27 +52,27 @@ class SVFIR : public IRGraph
|
|
|
52
52
|
|
|
53
53
|
public:
|
|
54
54
|
typedef Set<const CallICFGNode*> CallSiteSet;
|
|
55
|
-
typedef OrderedMap<const CallICFGNode*,NodeID> CallSiteToFunPtrMap;
|
|
56
|
-
typedef Map<NodeID,CallSiteSet> FunPtrToCallSitesMap;
|
|
57
|
-
typedef Map<NodeID,NodeBS> MemObjToFieldsMap;
|
|
55
|
+
typedef OrderedMap<const CallICFGNode*, NodeID> CallSiteToFunPtrMap;
|
|
56
|
+
typedef Map<NodeID, CallSiteSet> FunPtrToCallSitesMap;
|
|
57
|
+
typedef Map<NodeID, NodeBS> MemObjToFieldsMap;
|
|
58
58
|
typedef std::vector<const SVFStmt*> SVFStmtList;
|
|
59
59
|
typedef std::vector<const SVFVar*> SVFVarList;
|
|
60
|
-
typedef Map<const SVFVar*,PhiStmt*> PHINodeMap;
|
|
61
|
-
typedef Map<const SVFFunction*,SVFVarList> FunToArgsListMap;
|
|
62
|
-
typedef Map<const CallICFGNode*,SVFVarList> CSToArgsListMap;
|
|
63
|
-
typedef Map<const RetICFGNode*,const SVFVar*> CSToRetMap;
|
|
64
|
-
typedef Map<const SVFFunction*,const SVFVar*> FunToRetMap;
|
|
65
|
-
typedef Map<const SVFFunction*,SVFStmtSet> FunToPAGEdgeSetMap;
|
|
66
|
-
typedef Map<const ICFGNode*,SVFStmtList> ICFGNode2SVFStmtsMap;
|
|
60
|
+
typedef Map<const SVFVar*, PhiStmt*> PHINodeMap;
|
|
61
|
+
typedef Map<const SVFFunction*, SVFVarList> FunToArgsListMap;
|
|
62
|
+
typedef Map<const CallICFGNode*, SVFVarList> CSToArgsListMap;
|
|
63
|
+
typedef Map<const RetICFGNode*, const SVFVar*> CSToRetMap;
|
|
64
|
+
typedef Map<const SVFFunction*, const SVFVar*> FunToRetMap;
|
|
65
|
+
typedef Map<const SVFFunction*, SVFStmtSet> FunToPAGEdgeSetMap;
|
|
66
|
+
typedef Map<const ICFGNode*, SVFStmtList> ICFGNode2SVFStmtsMap;
|
|
67
67
|
typedef Map<NodeID, NodeID> NodeToNodeMap;
|
|
68
68
|
typedef std::pair<NodeID, APOffset> NodeOffset;
|
|
69
69
|
typedef std::pair<NodeID, AccessPath> NodeAccessPath;
|
|
70
|
-
typedef Map<NodeOffset,NodeID> NodeOffsetMap;
|
|
71
|
-
typedef Map<NodeAccessPath,NodeID> NodeAccessPathMap;
|
|
70
|
+
typedef Map<NodeOffset, NodeID> NodeOffsetMap;
|
|
71
|
+
typedef Map<NodeAccessPath, NodeID> NodeAccessPathMap;
|
|
72
72
|
typedef Map<const SVFValue*, NodeAccessPathMap> GepValueVarMap;
|
|
73
73
|
typedef std::pair<const SVFType*, std::vector<AccessPath>> SVFTypeLocSetsPair;
|
|
74
74
|
typedef Map<NodeID, SVFTypeLocSetsPair> TypeLocSetsMap;
|
|
75
|
-
typedef Map<NodePair,NodeID> NodePairSetMap;
|
|
75
|
+
typedef Map<NodePair, NodeID> NodePairSetMap;
|
|
76
76
|
|
|
77
77
|
private:
|
|
78
78
|
/// ValueNodes - This map indicates the Node that a particular SVFValue* is
|
|
@@ -214,7 +214,7 @@ public:
|
|
|
214
214
|
}
|
|
215
215
|
//@}
|
|
216
216
|
|
|
217
|
-
typedef GenericNode<SVFVar,SVFStmt>::GEdgeSetTy SVFStmtSetTy;
|
|
217
|
+
typedef GenericNode<SVFVar, SVFStmt>::GEdgeSetTy SVFStmtSetTy;
|
|
218
218
|
typedef Map<EdgeID, SVFStmtSetTy> PAGEdgeToSetMapTy;
|
|
219
219
|
typedef PAGEdgeToSetMapTy KindToSVFStmtMapTy;
|
|
220
220
|
typedef SVFStmtSetTy PAGEdgeSetTy;
|
|
@@ -58,9 +58,9 @@ public:
|
|
|
58
58
|
|
|
59
59
|
private:
|
|
60
60
|
BBList reachableBBs; ///< reachable BasicBlocks from the function entry.
|
|
61
|
-
Map<const SVFBasicBlock*,BBSet> dtBBsMap; ///< map a BasicBlock to BasicBlocks it Dominates
|
|
62
|
-
Map<const SVFBasicBlock*,BBSet> pdtBBsMap; ///< map a BasicBlock to BasicBlocks it PostDominates
|
|
63
|
-
Map<const SVFBasicBlock*,BBSet> dfBBsMap; ///< map a BasicBlock to its Dominate Frontier BasicBlocks
|
|
61
|
+
Map<const SVFBasicBlock*, BBSet> dtBBsMap; ///< map a BasicBlock to BasicBlocks it Dominates
|
|
62
|
+
Map<const SVFBasicBlock*, BBSet> pdtBBsMap; ///< map a BasicBlock to BasicBlocks it PostDominates
|
|
63
|
+
Map<const SVFBasicBlock*, BBSet> dfBBsMap; ///< map a BasicBlock to its Dominate Frontier BasicBlocks
|
|
64
64
|
Map<const SVFBasicBlock*, LoopBBs> bb2LoopMap; ///< map a BasicBlock (if it is in a loop) to all the BasicBlocks in this loop
|
|
65
65
|
Map<const SVFBasicBlock*, u32_t> bb2PdomLevel; ///< map a BasicBlock to its level in pdom tree, used in findNearestCommonPDominator
|
|
66
66
|
Map<const SVFBasicBlock*, const SVFBasicBlock*> bb2PIdom; ///< map a BasicBlock to its immediate dominator in pdom tree, used in findNearestCommonPDominator
|
|
@@ -72,12 +72,12 @@ public:
|
|
|
72
72
|
|
|
73
73
|
virtual ~SVFLoopAndDomInfo() {}
|
|
74
74
|
|
|
75
|
-
inline const Map<const SVFBasicBlock*,BBSet>& getDomFrontierMap() const
|
|
75
|
+
inline const Map<const SVFBasicBlock*, BBSet>& getDomFrontierMap() const
|
|
76
76
|
{
|
|
77
77
|
return dfBBsMap;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
inline Map<const SVFBasicBlock*,BBSet>& getDomFrontierMap()
|
|
80
|
+
inline Map<const SVFBasicBlock*, BBSet>& getDomFrontierMap()
|
|
81
81
|
{
|
|
82
82
|
return dfBBsMap;
|
|
83
83
|
}
|
|
@@ -105,43 +105,43 @@ public:
|
|
|
105
105
|
bb2LoopMap[bb].push_back(loopBB);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
inline const Map<const SVFBasicBlock*,BBSet>& getPostDomTreeMap() const
|
|
108
|
+
inline const Map<const SVFBasicBlock*, BBSet>& getPostDomTreeMap() const
|
|
109
109
|
{
|
|
110
110
|
return pdtBBsMap;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
inline Map<const SVFBasicBlock*,BBSet>& getPostDomTreeMap()
|
|
113
|
+
inline Map<const SVFBasicBlock*, BBSet>& getPostDomTreeMap()
|
|
114
114
|
{
|
|
115
115
|
return pdtBBsMap;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
inline const Map<const SVFBasicBlock*,u32_t>& getBBPDomLevel() const
|
|
118
|
+
inline const Map<const SVFBasicBlock*, u32_t>& getBBPDomLevel() const
|
|
119
119
|
{
|
|
120
120
|
return bb2PdomLevel;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
inline Map<const SVFBasicBlock*,u32_t>& getBBPDomLevel()
|
|
123
|
+
inline Map<const SVFBasicBlock*, u32_t>& getBBPDomLevel()
|
|
124
124
|
{
|
|
125
125
|
return bb2PdomLevel;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
inline const Map<const SVFBasicBlock*,const SVFBasicBlock*>& getBB2PIdom() const
|
|
128
|
+
inline const Map<const SVFBasicBlock*, const SVFBasicBlock*>& getBB2PIdom() const
|
|
129
129
|
{
|
|
130
130
|
return bb2PIdom;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
inline Map<const SVFBasicBlock*,const SVFBasicBlock*>& getBB2PIdom()
|
|
133
|
+
inline Map<const SVFBasicBlock*, const SVFBasicBlock*>& getBB2PIdom()
|
|
134
134
|
{
|
|
135
135
|
return bb2PIdom;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
inline Map<const SVFBasicBlock*,BBSet>& getDomTreeMap()
|
|
139
|
+
inline Map<const SVFBasicBlock*, BBSet>& getDomTreeMap()
|
|
140
140
|
{
|
|
141
141
|
return dtBBsMap;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
inline const Map<const SVFBasicBlock*,BBSet>& getDomTreeMap() const
|
|
144
|
+
inline const Map<const SVFBasicBlock*, BBSet>& getDomTreeMap() const
|
|
145
145
|
{
|
|
146
146
|
return dtBBsMap;
|
|
147
147
|
}
|
|
@@ -487,12 +487,12 @@ public:
|
|
|
487
487
|
return loopAndDom->loopContainsBB(lp,bb);
|
|
488
488
|
}
|
|
489
489
|
|
|
490
|
-
inline const Map<const SVFBasicBlock*,BBSet>& getDomTreeMap() const
|
|
490
|
+
inline const Map<const SVFBasicBlock*, BBSet>& getDomTreeMap() const
|
|
491
491
|
{
|
|
492
492
|
return loopAndDom->getDomTreeMap();
|
|
493
493
|
}
|
|
494
494
|
|
|
495
|
-
inline const Map<const SVFBasicBlock*,BBSet>& getDomFrontierMap() const
|
|
495
|
+
inline const Map<const SVFBasicBlock*, BBSet>& getDomFrontierMap() const
|
|
496
496
|
{
|
|
497
497
|
return loopAndDom->getDomFrontierMap();
|
|
498
498
|
}
|
|
@@ -228,7 +228,7 @@ struct isa_impl_wrap<To, FromTy, FromTy>
|
|
|
228
228
|
// When From == SimpleType, we are as simple as we are going to get.
|
|
229
229
|
static bool doit(const FromTy &Val)
|
|
230
230
|
{
|
|
231
|
-
return isa_impl_cl<To,FromTy>::doit(Val);
|
|
231
|
+
return isa_impl_cl<To, FromTy>::doit(Val);
|
|
232
232
|
}
|
|
233
233
|
};
|
|
234
234
|
|
|
@@ -306,7 +306,7 @@ template<class To, class FromTy>
|
|
|
306
306
|
struct cast_retty_wrap<To, FromTy, FromTy>
|
|
307
307
|
{
|
|
308
308
|
// When the simplified type is equal to the from type, use it directly.
|
|
309
|
-
using ret_type = typename cast_retty_impl<To,FromTy>::ret_type;
|
|
309
|
+
using ret_type = typename cast_retty_impl<To, FromTy>::ret_type;
|
|
310
310
|
};
|
|
311
311
|
|
|
312
312
|
template<class To, class From>
|
|
@@ -330,7 +330,7 @@ template<class To, class From, class SimpleFrom> struct cast_convert_val
|
|
|
330
330
|
}
|
|
331
331
|
};
|
|
332
332
|
|
|
333
|
-
template<class To, class FromTy> struct cast_convert_val<To,FromTy,FromTy>
|
|
333
|
+
template<class To, class FromTy> struct cast_convert_val<To, FromTy, FromTy>
|
|
334
334
|
{
|
|
335
335
|
// This _is_ a simple type, just cast it.
|
|
336
336
|
static typename cast_retty<To, FromTy>::ret_type doit(const FromTy &Val)
|
|
@@ -104,7 +104,7 @@ protected:
|
|
|
104
104
|
child_iterator EE = GTraits::child_end(v);
|
|
105
105
|
for (; EI != EE; ++EI)
|
|
106
106
|
{
|
|
107
|
-
FWProcessOutgoingEdge(item
|
|
107
|
+
FWProcessOutgoingEdge(item, *(EI.getCurrent()) );
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -123,7 +123,7 @@ protected:
|
|
|
123
123
|
inv_child_iterator EE = InvGTraits::child_end(v);
|
|
124
124
|
for (; EI != EE; ++EI)
|
|
125
125
|
{
|
|
126
|
-
BWProcessIncomingEdge(item
|
|
126
|
+
BWProcessIncomingEdge(item, *(EI.getCurrent()) );
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
Binary file
|
|
Binary file
|