svf-lib 1.0.2143 → 1.0.2145
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-osx/Release-build/include/CFL/CFGrammar.h +3 -3
- package/SVF-osx/Release-build/include/CFL/CFLGraphBuilder.h +9 -9
- 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 +3 -3
- 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/IRGraph.h +4 -4
- package/SVF-osx/Release-build/include/Graphs/PTACallGraph.h +3 -3
- 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/MSSA/MSSAMuChi.h +6 -6
- 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 +6 -6
- 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/SVF-LLVM/LLVMModule.h +4 -4
- 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/include/WPA/FlowSensitive.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
|
@@ -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,
|
|
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
|
}
|
|
@@ -130,13 +130,13 @@ public:
|
|
|
130
130
|
|
|
131
131
|
private:
|
|
132
132
|
/// Connects VGep (Variable GEP)
|
|
133
|
-
void connectVGep(CFLGraph *cflGraph,
|
|
133
|
+
void connectVGep(CFLGraph *cflGraph, ConstraintGraph *graph, ConstraintNode *src, ConstraintNode *dst, u32_t level, SVFIR* pag);
|
|
134
134
|
|
|
135
135
|
/// Handles edges, with the exception of the GEP
|
|
136
|
-
void addBiCFLEdge(CFLGraph *cflGraph,
|
|
136
|
+
void addBiCFLEdge(CFLGraph *cflGraph, ConstraintNode* src, ConstraintNode* dst, CFGrammar::Kind label);
|
|
137
137
|
|
|
138
138
|
/// Adds bidirectional GEP edges with attributes
|
|
139
|
-
void addBiGepCFLEdge(CFLGraph *cflGraph,
|
|
139
|
+
void addBiGepCFLEdge(CFLGraph *cflGraph, ConstraintNode* src, ConstraintNode* dst, CFGrammar::Attribute attri);
|
|
140
140
|
};
|
|
141
141
|
|
|
142
142
|
/// VFCFLGraphBuilder: a CFLGraphBuilder specialized for handling value-flow
|
|
@@ -153,13 +153,13 @@ public:
|
|
|
153
153
|
|
|
154
154
|
private:
|
|
155
155
|
/// Connects VGep (Variable GEP)
|
|
156
|
-
void connectVGep(CFLGraph *cflGraph,
|
|
156
|
+
void connectVGep(CFLGraph *cflGraph, ConstraintGraph *graph, ConstraintNode *src, ConstraintNode *dst, u32_t level, SVFIR* pag);
|
|
157
157
|
|
|
158
158
|
/// Handles edges, with the exception of the GEP
|
|
159
|
-
void addBiCFLEdge(CFLGraph *cflGraph,
|
|
159
|
+
void addBiCFLEdge(CFLGraph *cflGraph, ConstraintNode* src, ConstraintNode* dst, CFGrammar::Kind label);
|
|
160
160
|
|
|
161
161
|
/// Adds bidirectional GEP edges with attributes
|
|
162
|
-
void addBiGepCFLEdge(CFLGraph *cflGraph,
|
|
162
|
+
void addBiGepCFLEdge(CFLGraph *cflGraph, ConstraintNode* src, ConstraintNode* dst, CFGrammar::Attribute attri);
|
|
163
163
|
};
|
|
164
164
|
|
|
165
165
|
|
|
@@ -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,
|
|
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,
|
|
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,
|
|
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,
|
|
58
|
-
typedef OrderedMap<DPIm,
|
|
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,
|
|
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,
|
|
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,
|
|
75
|
+
typedef GenericNode<CFLNode,CFLEdge> GenericCFLNodeTy;
|
|
76
76
|
class CFLNode: public GenericCFLNodeTy
|
|
77
77
|
{
|
|
78
78
|
public:
|
|
@@ -169,13 +169,13 @@ public:
|
|
|
169
169
|
};
|
|
170
170
|
|
|
171
171
|
/// Edge-labeled graph for CFL Reachability analysis
|
|
172
|
-
typedef GenericGraph<CFLNode,
|
|
172
|
+
typedef GenericGraph<CFLNode,CFLEdge> GenericCFLGraphTy;
|
|
173
173
|
class CFLGraph: public GenericCFLGraphTy
|
|
174
174
|
{
|
|
175
175
|
public:
|
|
176
176
|
typedef CFGrammar::Symbol Symbol;
|
|
177
177
|
typedef CFGrammar::Kind Kind;
|
|
178
|
-
typedef GenericNode<CFLNode,
|
|
178
|
+
typedef GenericNode<CFLNode,CFLEdge>::GEdgeSetTy CFLEdgeSet;
|
|
179
179
|
Kind startKind;
|
|
180
180
|
|
|
181
181
|
CFLGraph(Kind kind)
|
|
@@ -213,17 +213,17 @@ namespace SVF
|
|
|
213
213
|
* GenericGraphTraits specializations for generic graph algorithms.
|
|
214
214
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
215
215
|
*/
|
|
216
|
-
template<> struct GenericGraphTraits<SVF::CFLNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::CFLNode,
|
|
216
|
+
template<> struct GenericGraphTraits<SVF::CFLNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::CFLNode,SVF::CFLEdge>* >
|
|
217
217
|
{
|
|
218
218
|
};
|
|
219
219
|
|
|
220
220
|
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
221
221
|
template<>
|
|
222
|
-
struct GenericGraphTraits<Inverse<SVF::CFLNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::CFLNode,
|
|
222
|
+
struct GenericGraphTraits<Inverse<SVF::CFLNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::CFLNode,SVF::CFLEdge>* > >
|
|
223
223
|
{
|
|
224
224
|
};
|
|
225
225
|
|
|
226
|
-
template<> struct GenericGraphTraits<SVF::CFLGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::CFLNode,
|
|
226
|
+
template<> struct GenericGraphTraits<SVF::CFLGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::CFLNode,SVF::CFLEdge>* >
|
|
227
227
|
{
|
|
228
228
|
typedef SVF::CFLNode *NodeRef;
|
|
229
229
|
};
|
|
@@ -244,17 +244,17 @@ namespace SVF
|
|
|
244
244
|
* GenericGraphTraits specializations for generic graph algorithms.
|
|
245
245
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
246
246
|
*/
|
|
247
|
-
template<> struct GenericGraphTraits<SVF::CallGraphNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::CallGraphNode,
|
|
247
|
+
template<> struct GenericGraphTraits<SVF::CallGraphNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::CallGraphNode,SVF::CallGraphEdge>* >
|
|
248
248
|
{
|
|
249
249
|
};
|
|
250
250
|
|
|
251
251
|
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
252
252
|
template<>
|
|
253
|
-
struct GenericGraphTraits<Inverse<SVF::CallGraphNode*> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::CallGraphNode,
|
|
253
|
+
struct GenericGraphTraits<Inverse<SVF::CallGraphNode*> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::CallGraphNode,SVF::CallGraphEdge>* > >
|
|
254
254
|
{
|
|
255
255
|
};
|
|
256
256
|
|
|
257
|
-
template<> struct GenericGraphTraits<SVF::CallGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::CallGraphNode,
|
|
257
|
+
template<> struct GenericGraphTraits<SVF::CallGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::CallGraphNode,SVF::CallGraphEdge>* >
|
|
258
258
|
{
|
|
259
259
|
typedef SVF::CallGraphNode*NodeRef;
|
|
260
260
|
};
|
|
@@ -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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
85
|
+
typedef GenericNode<ConstraintNode,ConstraintEdge>::GEdgeSetTy ConstraintEdgeSetTy;
|
|
86
86
|
|
|
87
87
|
};
|
|
88
88
|
|
|
@@ -389,7 +389,7 @@ protected:
|
|
|
389
389
|
/*!
|
|
390
390
|
* Generic node on the graph as base class
|
|
391
391
|
*/
|
|
392
|
-
template<class NodeTy,
|
|
392
|
+
template<class NodeTy,class EdgeTy>
|
|
393
393
|
class GenericNode: public SVFBaseNode
|
|
394
394
|
{
|
|
395
395
|
friend class SVFIRWriter;
|
|
@@ -753,7 +753,7 @@ inline mapped_iter<ItTy, FuncTy> map_iter(ItTy I, FuncTy F)
|
|
|
753
753
|
/*!
|
|
754
754
|
* GenericGraphTraits for nodes
|
|
755
755
|
*/
|
|
756
|
-
template<class NodeTy,
|
|
756
|
+
template<class NodeTy,class EdgeTy> struct GenericGraphTraits<SVF::GenericNode<NodeTy,EdgeTy>* >
|
|
757
757
|
{
|
|
758
758
|
typedef NodeTy NodeType;
|
|
759
759
|
typedef EdgeTy EdgeType;
|
|
@@ -764,7 +764,7 @@ template<class NodeTy, class EdgeTy> struct GenericGraphTraits<SVF::GenericNode<
|
|
|
764
764
|
}
|
|
765
765
|
|
|
766
766
|
// nodes_iterator/begin/end - Allow iteration over all nodes in the graph
|
|
767
|
-
typedef mapped_iter<typename SVF::GenericNode<NodeTy,
|
|
767
|
+
typedef mapped_iter<typename SVF::GenericNode<NodeTy,EdgeTy>::iterator, decltype(&edge_dest)> ChildIteratorType;
|
|
768
768
|
|
|
769
769
|
static NodeType* getEntryNode(NodeType* pagN)
|
|
770
770
|
{
|
|
@@ -792,8 +792,8 @@ template<class NodeTy, class EdgeTy> struct GenericGraphTraits<SVF::GenericNode<
|
|
|
792
792
|
/*!
|
|
793
793
|
* Inverse GenericGraphTraits for node which is used for inverse traversal.
|
|
794
794
|
*/
|
|
795
|
-
template<class NodeTy,
|
|
796
|
-
struct GenericGraphTraits<Inverse<SVF::GenericNode<NodeTy,
|
|
795
|
+
template<class NodeTy,class EdgeTy>
|
|
796
|
+
struct GenericGraphTraits<Inverse<SVF::GenericNode<NodeTy,EdgeTy>* > >
|
|
797
797
|
{
|
|
798
798
|
typedef NodeTy NodeType;
|
|
799
799
|
typedef EdgeTy EdgeType;
|
|
@@ -804,7 +804,7 @@ struct GenericGraphTraits<Inverse<SVF::GenericNode<NodeTy, EdgeTy>* > >
|
|
|
804
804
|
}
|
|
805
805
|
|
|
806
806
|
// nodes_iterator/begin/end - Allow iteration over all nodes in the graph
|
|
807
|
-
typedef mapped_iter<typename SVF::GenericNode<NodeTy,
|
|
807
|
+
typedef mapped_iter<typename SVF::GenericNode<NodeTy,EdgeTy>::iterator, decltype(&edge_dest)> ChildIteratorType;
|
|
808
808
|
|
|
809
809
|
static inline NodeType* getEntryNode(Inverse<NodeType* > G)
|
|
810
810
|
{
|
|
@@ -829,9 +829,9 @@ struct GenericGraphTraits<Inverse<SVF::GenericNode<NodeTy, EdgeTy>* > >
|
|
|
829
829
|
/*!
|
|
830
830
|
* GraphTraints
|
|
831
831
|
*/
|
|
832
|
-
template<class NodeTy,
|
|
832
|
+
template<class NodeTy,class EdgeTy> struct GenericGraphTraits<SVF::GenericGraph<NodeTy,EdgeTy>* > : public GenericGraphTraits<SVF::GenericNode<NodeTy,EdgeTy>* >
|
|
833
833
|
{
|
|
834
|
-
typedef SVF::GenericGraph<NodeTy,
|
|
834
|
+
typedef SVF::GenericGraph<NodeTy,EdgeTy> GenericGraphTy;
|
|
835
835
|
typedef NodeTy NodeType;
|
|
836
836
|
typedef EdgeTy EdgeType;
|
|
837
837
|
|
|
@@ -43,7 +43,7 @@ class PTACallGraph;
|
|
|
43
43
|
/*!
|
|
44
44
|
* Interprocedural Control-Flow Graph (ICFG)
|
|
45
45
|
*/
|
|
46
|
-
typedef GenericGraph<ICFGNode,
|
|
46
|
+
typedef GenericGraph<ICFGNode,ICFGEdge> GenericICFGTy;
|
|
47
47
|
class ICFG : public GenericICFGTy
|
|
48
48
|
{
|
|
49
49
|
friend class ICFGBuilder;
|
|
@@ -311,17 +311,17 @@ namespace SVF
|
|
|
311
311
|
* GenericGraphTraits specializations for generic graph algorithms.
|
|
312
312
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
313
313
|
*/
|
|
314
|
-
template<> struct GenericGraphTraits<SVF::ICFGNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::ICFGNode,
|
|
314
|
+
template<> struct GenericGraphTraits<SVF::ICFGNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::ICFGNode,SVF::ICFGEdge>* >
|
|
315
315
|
{
|
|
316
316
|
};
|
|
317
317
|
|
|
318
318
|
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
319
319
|
template<>
|
|
320
|
-
struct GenericGraphTraits<Inverse<SVF::ICFGNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::ICFGNode,
|
|
320
|
+
struct GenericGraphTraits<Inverse<SVF::ICFGNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::ICFGNode,SVF::ICFGEdge>* > >
|
|
321
321
|
{
|
|
322
322
|
};
|
|
323
323
|
|
|
324
|
-
template<> struct GenericGraphTraits<SVF::ICFG*> : public GenericGraphTraits<SVF::GenericGraph<SVF::ICFGNode,
|
|
324
|
+
template<> struct GenericGraphTraits<SVF::ICFG*> : public GenericGraphTraits<SVF::GenericGraph<SVF::ICFGNode,SVF::ICFGEdge>* >
|
|
325
325
|
{
|
|
326
326
|
typedef SVF::ICFGNode *NodeRef;
|
|
327
327
|
};
|
|
@@ -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*,
|
|
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,
|
|
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,
|
|
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,
|
|
246
|
+
template<> struct GenericGraphTraits<SVF::IRGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::SVFVar,SVF::SVFStmt>* >
|
|
247
247
|
{
|
|
248
248
|
typedef SVF::SVFVar* NodeRef;
|
|
249
249
|
};
|
|
@@ -474,17 +474,17 @@ namespace SVF
|
|
|
474
474
|
* GenericGraphTraits specializations for generic graph algorithms.
|
|
475
475
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
476
476
|
*/
|
|
477
|
-
template<> struct GenericGraphTraits<SVF::PTACallGraphNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::PTACallGraphNode,
|
|
477
|
+
template<> struct GenericGraphTraits<SVF::PTACallGraphNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::PTACallGraphNode,SVF::PTACallGraphEdge>* >
|
|
478
478
|
{
|
|
479
479
|
};
|
|
480
480
|
|
|
481
481
|
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
482
482
|
template<>
|
|
483
|
-
struct GenericGraphTraits<Inverse<SVF::PTACallGraphNode*> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::PTACallGraphNode,
|
|
483
|
+
struct GenericGraphTraits<Inverse<SVF::PTACallGraphNode*> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::PTACallGraphNode,SVF::PTACallGraphEdge>* > >
|
|
484
484
|
{
|
|
485
485
|
};
|
|
486
486
|
|
|
487
|
-
template<> struct GenericGraphTraits<SVF::PTACallGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::PTACallGraphNode,
|
|
487
|
+
template<> struct GenericGraphTraits<SVF::PTACallGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::PTACallGraphNode,SVF::PTACallGraphEdge>* >
|
|
488
488
|
{
|
|
489
489
|
typedef SVF::PTACallGraphNode*NodeRef;
|
|
490
490
|
};
|
|
@@ -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,
|
|
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,
|
|
438
|
-
const Map<u32_t,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
45
|
+
typedef GenericNode<VFGNode,VFGEdge> GenericVFGNodeTy;
|
|
46
46
|
class VFGNode : public GenericVFGNodeTy
|
|
47
47
|
{
|
|
48
48
|
|
|
@@ -337,7 +337,7 @@ public:
|
|
|
337
337
|
class CmpVFGNode: public VFGNode
|
|
338
338
|
{
|
|
339
339
|
public:
|
|
340
|
-
typedef Map<u32_t,
|
|
340
|
+
typedef Map<u32_t,const PAGNode*> OPVers;
|
|
341
341
|
protected:
|
|
342
342
|
const PAGNode* res;
|
|
343
343
|
OPVers opVers;
|
|
@@ -412,7 +412,7 @@ public:
|
|
|
412
412
|
class BinaryOPVFGNode: public VFGNode
|
|
413
413
|
{
|
|
414
414
|
public:
|
|
415
|
-
typedef Map<u32_t,
|
|
415
|
+
typedef Map<u32_t,const PAGNode*> OPVers;
|
|
416
416
|
protected:
|
|
417
417
|
const PAGNode* res;
|
|
418
418
|
OPVers opVers;
|
|
@@ -486,7 +486,7 @@ public:
|
|
|
486
486
|
class UnaryOPVFGNode: public VFGNode
|
|
487
487
|
{
|
|
488
488
|
public:
|
|
489
|
-
typedef Map<u32_t,
|
|
489
|
+
typedef Map<u32_t,const PAGNode*> OPVers;
|
|
490
490
|
protected:
|
|
491
491
|
const PAGNode* res;
|
|
492
492
|
OPVers opVers;
|
|
@@ -669,7 +669,7 @@ class PHIVFGNode : public VFGNode
|
|
|
669
669
|
{
|
|
670
670
|
|
|
671
671
|
public:
|
|
672
|
-
typedef Map<u32_t,
|
|
672
|
+
typedef Map<u32_t,const PAGNode*> OPVers;
|
|
673
673
|
protected:
|
|
674
674
|
const PAGNode* res;
|
|
675
675
|
OPVers opVers;
|
|
@@ -748,7 +748,7 @@ class IntraPHIVFGNode : public PHIVFGNode
|
|
|
748
748
|
{
|
|
749
749
|
|
|
750
750
|
public:
|
|
751
|
-
typedef Map<u32_t,
|
|
751
|
+
typedef Map<u32_t,const ICFGNode*> OPIncomingBBs;
|
|
752
752
|
|
|
753
753
|
private:
|
|
754
754
|
OPIncomingBBs opIncomingBBs;
|
|
@@ -448,7 +448,7 @@ public:
|
|
|
448
448
|
virtual void dump()
|
|
449
449
|
{
|
|
450
450
|
SVFUtil::outs() << "MR_" << this->getMR()->getMRID() << "V_" << this->getResVer()->getSSAVersion() <<
|
|
451
|
-
|
|
451
|
+
" = CHI(MR_" << this->getMR()->getMRID() << "V_" << opVer->getSSAVersion() << ") \t" <<
|
|
452
452
|
this->getMR()->dumpStr() << "\n";
|
|
453
453
|
}
|
|
454
454
|
};
|
|
@@ -507,7 +507,7 @@ public:
|
|
|
507
507
|
virtual void dump()
|
|
508
508
|
{
|
|
509
509
|
SVFUtil::outs() << this->getMR()->getMRID() << "V_" << this->getResVer()->getSSAVersion() <<
|
|
510
|
-
|
|
510
|
+
" = STCHI(MR_" << this->getMR()->getMRID() << "V_" << this->getOpVer()->getSSAVersion() << ") \t" <<
|
|
511
511
|
this->getMR()->dumpStr() << "\n";
|
|
512
512
|
}
|
|
513
513
|
};
|
|
@@ -566,7 +566,7 @@ public:
|
|
|
566
566
|
virtual void dump()
|
|
567
567
|
{
|
|
568
568
|
SVFUtil::outs() << this->getMR()->getMRID() << "V_" << this->getResVer()->getSSAVersion() <<
|
|
569
|
-
|
|
569
|
+
" = CALCHI(MR_" << this->getMR()->getMRID() << "V_" << this->getOpVer()->getSSAVersion() << ") \t" <<
|
|
570
570
|
this->getMR()->dumpStr() << "\n";
|
|
571
571
|
}
|
|
572
572
|
};
|
|
@@ -617,7 +617,7 @@ public:
|
|
|
617
617
|
virtual void dump()
|
|
618
618
|
{
|
|
619
619
|
SVFUtil::outs() << this->getMR()->getMRID() << "V_" << this->getResVer()->getSSAVersion() <<
|
|
620
|
-
|
|
620
|
+
" = ENCHI(MR_" << this->getMR()->getMRID() << "V_" << this->getOpVer()->getSSAVersion() << ") \t" <<
|
|
621
621
|
this->getMR()->dumpStr() << "\n";
|
|
622
622
|
}
|
|
623
623
|
};
|
|
@@ -630,7 +630,7 @@ class MSSAPHI : public MSSADEF
|
|
|
630
630
|
{
|
|
631
631
|
|
|
632
632
|
public:
|
|
633
|
-
typedef Map<u32_t,
|
|
633
|
+
typedef Map<u32_t,const MRVer*> OPVers;
|
|
634
634
|
private:
|
|
635
635
|
const SVFBasicBlock* bb;
|
|
636
636
|
OPVers opVers;
|
|
@@ -708,7 +708,7 @@ public:
|
|
|
708
708
|
virtual void dump()
|
|
709
709
|
{
|
|
710
710
|
SVFUtil::outs() << this->getMR()->getMRID() << "V_" << this->getResVer()->getSSAVersion() <<
|
|
711
|
-
|
|
711
|
+
" = PHI(";
|
|
712
712
|
for(OPVers::iterator it = opVers.begin(), eit = opVers.end(); it!=eit; ++it)
|
|
713
713
|
SVFUtil::outs() << "MR_" << this->getMR()->getMRID() << "V_" << it->second->getSSAVersion() << ", ";
|
|
714
714
|
|
|
@@ -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,
|
|
53
|
-
typedef Map<const ICFGNode*,
|
|
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*,
|
|
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,
|
|
288
|
-
typedef Map<CxtStmt,
|
|
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;
|
|
@@ -161,9 +161,9 @@ public:
|
|
|
161
161
|
typedef std::vector<const ICFGNode*> InstVec;
|
|
162
162
|
typedef Set<const ICFGNode*> InstSet;
|
|
163
163
|
typedef Set<const PTACallGraphNode*> PTACGNodeSet;
|
|
164
|
-
typedef Map<CxtThread,
|
|
165
|
-
typedef Map<CxtThread,
|
|
166
|
-
typedef Map<CxtThread,
|
|
164
|
+
typedef Map<CxtThread,TCTNode*> CxtThreadToNodeMap;
|
|
165
|
+
typedef Map<CxtThread,CallStrCxt> CxtThreadToForkCxt;
|
|
166
|
+
typedef Map<CxtThread,const SVFFunction*> CxtThreadToFun;
|
|
167
167
|
typedef Map<const ICFGNode*, LoopBBs> InstToLoopMap;
|
|
168
168
|
typedef FIFOWorkList<CxtThreadProc> CxtThreadProcVec;
|
|
169
169
|
typedef Set<CxtThreadProc> CxtThreadProcSet;
|
|
@@ -606,17 +606,17 @@ namespace SVF
|
|
|
606
606
|
* graphs by the generic graph algorithms.
|
|
607
607
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
608
608
|
*/
|
|
609
|
-
template<> struct GenericGraphTraits<SVF::TCTNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::TCTNode,
|
|
609
|
+
template<> struct GenericGraphTraits<SVF::TCTNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::TCTNode,SVF::TCTEdge>* >
|
|
610
610
|
{
|
|
611
611
|
};
|
|
612
612
|
|
|
613
613
|
/// Inverse GenericGraphTraits specializations for Value flow node, it is used for inverse traversal.
|
|
614
614
|
template<>
|
|
615
|
-
struct GenericGraphTraits<Inverse<SVF::TCTNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::TCTNode,
|
|
615
|
+
struct GenericGraphTraits<Inverse<SVF::TCTNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::TCTNode,SVF::TCTEdge>* > >
|
|
616
616
|
{
|
|
617
617
|
};
|
|
618
618
|
|
|
619
|
-
template<> struct GenericGraphTraits<SVF::TCT*> : public GenericGraphTraits<SVF::GenericGraph<SVF::TCTNode,
|
|
619
|
+
template<> struct GenericGraphTraits<SVF::TCT*> : public GenericGraphTraits<SVF::GenericGraph<SVF::TCTNode,SVF::TCTEdge>* >
|
|
620
620
|
{
|
|
621
621
|
typedef SVF::TCTNode *NodeRef;
|
|
622
622
|
};
|
|
@@ -249,9 +249,9 @@ public:
|
|
|
249
249
|
typedef CondStdSet<CVar> CPtSet;
|
|
250
250
|
typedef PTData<CVar, Set<CVar>, CVar, CPtSet> PTDataTy;
|
|
251
251
|
typedef MutablePTData<CVar, Set<CVar>, CVar, CPtSet> MutPTDataTy;
|
|
252
|
-
typedef Map<NodeID,
|
|
252
|
+
typedef Map<NodeID,PointsTo> PtrToBVPtsMap; /// map a pointer to its BitVector points-to representation
|
|
253
253
|
typedef Map<NodeID, NodeSet> PtrToNSMap;
|
|
254
|
-
typedef Map<NodeID,
|
|
254
|
+
typedef Map<NodeID,CPtSet> PtrToCPtsMap; /// map a pointer to its conditional points-to set
|
|
255
255
|
|
|
256
256
|
/// Constructor
|
|
257
257
|
CondPTAImpl(SVFIR* pag, PointerAnalysis::PTATY type) : PointerAnalysis(pag, type), normalized(false)
|
|
@@ -332,7 +332,7 @@ public:
|
|
|
332
332
|
{
|
|
333
333
|
for (typename CPtSet::const_iterator it2 = cpts2.begin(); it2 != cpts2.end(); ++it2)
|
|
334
334
|
{
|
|
335
|
-
if(isSameVar(*it1
|
|
335
|
+
if(isSameVar(*it1,*it2))
|
|
336
336
|
return true;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
@@ -350,7 +350,7 @@ public:
|
|
|
350
350
|
NodeBS& fields = pag->getAllFieldsObjVars(cit->get_id());
|
|
351
351
|
for(NodeBS::iterator it = fields.begin(), eit = fields.end(); it!=eit; ++it)
|
|
352
352
|
{
|
|
353
|
-
CVar cvar(cit->get_cond()
|
|
353
|
+
CVar cvar(cit->get_cond(),*it);
|
|
354
354
|
expandedCpts.set(cvar);
|
|
355
355
|
}
|
|
356
356
|
}
|
|
@@ -411,7 +411,7 @@ protected:
|
|
|
411
411
|
bool hasObj = false;
|
|
412
412
|
for (typename CPtSet::const_iterator it1 = cpts1.begin(); it1 != cpts1.end(); ++it1)
|
|
413
413
|
{
|
|
414
|
-
if(isSameVar(*it1
|
|
414
|
+
if(isSameVar(*it1,*it2))
|
|
415
415
|
{
|
|
416
416
|
hasObj = true;
|
|
417
417
|
break;
|
|
@@ -43,7 +43,7 @@ class LeakChecker : public SrcSnkDDA
|
|
|
43
43
|
{
|
|
44
44
|
|
|
45
45
|
public:
|
|
46
|
-
typedef Map<const SVFGNode*,
|
|
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,
|
|
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;
|
|
@@ -86,11 +86,11 @@ public:
|
|
|
86
86
|
//@{
|
|
87
87
|
inline Condition condAnd(const Condition& lhs, const Condition& rhs)
|
|
88
88
|
{
|
|
89
|
-
return Condition::AND(lhs,
|
|
89
|
+
return Condition::AND(lhs,rhs);
|
|
90
90
|
}
|
|
91
91
|
inline Condition condOr(const Condition& lhs, const Condition& rhs)
|
|
92
92
|
{
|
|
93
|
-
return Condition::OR(lhs,
|
|
93
|
+
return Condition::OR(lhs,rhs);
|
|
94
94
|
}
|
|
95
95
|
inline Condition condNeg(const Condition& cond)
|
|
96
96
|
{
|
|
@@ -151,7 +151,7 @@ public:
|
|
|
151
151
|
bool funcEq = (keyFunc == valueFunc);
|
|
152
152
|
(void)funcEq; // Suppress warning of unused variable under release build
|
|
153
153
|
assert(funcEq && "two basicblocks should be in the same function!");
|
|
154
|
-
return keyFunc->postDominate(bbKey,
|
|
154
|
+
return keyFunc->postDominate(bbKey,bbValue);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
inline bool dominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
|
|
@@ -161,7 +161,7 @@ public:
|
|
|
161
161
|
bool funcEq = (keyFunc == valueFunc);
|
|
162
162
|
(void)funcEq; // Suppress warning of unused variable under release build
|
|
163
163
|
assert(funcEq && "two basicblocks should be in the same function!");
|
|
164
|
-
return keyFunc->dominate(bbKey,
|
|
164
|
+
return keyFunc->dominate(bbKey,bbValue);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
/// Guard Computation for a value-flow (between two basic blocks)
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
namespace SVF
|
|
47
47
|
{
|
|
48
48
|
|
|
49
|
-
typedef GraphReachSolver<SVFG*,
|
|
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*,
|
|
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
|
}
|
|
@@ -458,17 +458,17 @@ namespace SVF
|
|
|
458
458
|
* GenericGraphTraits specializations for generic graph algorithms.
|
|
459
459
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
460
460
|
*/
|
|
461
|
-
template<> struct GenericGraphTraits<SVF::DCHNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::DCHNode,
|
|
461
|
+
template<> struct GenericGraphTraits<SVF::DCHNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::DCHNode,SVF::DCHEdge>* >
|
|
462
462
|
{
|
|
463
463
|
};
|
|
464
464
|
|
|
465
465
|
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
466
466
|
template<>
|
|
467
|
-
struct GenericGraphTraits<Inverse<SVF::DCHNode*> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::DCHNode,
|
|
467
|
+
struct GenericGraphTraits<Inverse<SVF::DCHNode*> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::DCHNode,SVF::DCHEdge>* > >
|
|
468
468
|
{
|
|
469
469
|
};
|
|
470
470
|
|
|
471
|
-
template<> struct GenericGraphTraits<SVF::DCHGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::DCHNode,
|
|
471
|
+
template<> struct GenericGraphTraits<SVF::DCHGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::DCHNode,SVF::DCHEdge>* >
|
|
472
472
|
{
|
|
473
473
|
typedef SVF::DCHNode *NodeRef;
|
|
474
474
|
};
|
|
@@ -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,
|
|
20
|
+
typedef std::iterator<std::forward_iterator_tag,Type*, ptrdiff_t> super;
|
|
21
21
|
ItTy OpIt;
|
|
22
|
-
PointerIntPair<Type*,
|
|
22
|
+
PointerIntPair<Type*,1> CurTy;
|
|
23
23
|
unsigned AddrSpace;
|
|
24
24
|
generic_bridge_gep_type_iterator() {}
|
|
25
25
|
public:
|
|
@@ -168,22 +168,22 @@ public:
|
|
|
168
168
|
inline void addFunctionMap(const Function* func, SVFFunction* svfFunc)
|
|
169
169
|
{
|
|
170
170
|
LLVMFunc2SVFFunc[func] = svfFunc;
|
|
171
|
-
setValueAttr(func,
|
|
171
|
+
setValueAttr(func,svfFunc);
|
|
172
172
|
}
|
|
173
173
|
inline void addBasicBlockMap(const BasicBlock* bb, SVFBasicBlock* svfBB)
|
|
174
174
|
{
|
|
175
175
|
LLVMBB2SVFBB[bb] = svfBB;
|
|
176
|
-
setValueAttr(bb,
|
|
176
|
+
setValueAttr(bb,svfBB);
|
|
177
177
|
}
|
|
178
178
|
inline void addInstructionMap(const Instruction* inst, SVFInstruction* svfInst)
|
|
179
179
|
{
|
|
180
180
|
LLVMInst2SVFInst[inst] = svfInst;
|
|
181
|
-
setValueAttr(inst,
|
|
181
|
+
setValueAttr(inst,svfInst);
|
|
182
182
|
}
|
|
183
183
|
inline void addArgumentMap(const Argument* arg, SVFArgument* svfArg)
|
|
184
184
|
{
|
|
185
185
|
LLVMArgument2SVFArgument[arg] = svfArg;
|
|
186
|
-
setValueAttr(arg,
|
|
186
|
+
setValueAttr(arg,svfArg);
|
|
187
187
|
}
|
|
188
188
|
inline void addGlobalValueMap(const GlobalValue* glob, SVFGlobalValue* svfglob)
|
|
189
189
|
{
|
|
@@ -53,27 +53,27 @@ class SVFIR : public IRGraph
|
|
|
53
53
|
|
|
54
54
|
public:
|
|
55
55
|
typedef Set<const CallICFGNode*> CallSiteSet;
|
|
56
|
-
typedef OrderedMap<const CallICFGNode*,
|
|
57
|
-
typedef Map<NodeID,
|
|
58
|
-
typedef Map<NodeID,
|
|
56
|
+
typedef OrderedMap<const CallICFGNode*,NodeID> CallSiteToFunPtrMap;
|
|
57
|
+
typedef Map<NodeID,CallSiteSet> FunPtrToCallSitesMap;
|
|
58
|
+
typedef Map<NodeID,NodeBS> MemObjToFieldsMap;
|
|
59
59
|
typedef std::vector<const SVFStmt*> SVFStmtList;
|
|
60
60
|
typedef std::vector<const SVFVar*> SVFVarList;
|
|
61
|
-
typedef Map<const SVFVar*,
|
|
62
|
-
typedef Map<const SVFFunction*,
|
|
63
|
-
typedef Map<const CallICFGNode*,
|
|
64
|
-
typedef Map<const RetICFGNode*,
|
|
65
|
-
typedef Map<const SVFFunction*,
|
|
66
|
-
typedef Map<const SVFFunction*,
|
|
67
|
-
typedef Map<const ICFGNode*,
|
|
61
|
+
typedef Map<const SVFVar*,PhiStmt*> PHINodeMap;
|
|
62
|
+
typedef Map<const SVFFunction*,SVFVarList> FunToArgsListMap;
|
|
63
|
+
typedef Map<const CallICFGNode*,SVFVarList> CSToArgsListMap;
|
|
64
|
+
typedef Map<const RetICFGNode*,const SVFVar*> CSToRetMap;
|
|
65
|
+
typedef Map<const SVFFunction*,const SVFVar*> FunToRetMap;
|
|
66
|
+
typedef Map<const SVFFunction*,SVFStmtSet> FunToPAGEdgeSetMap;
|
|
67
|
+
typedef Map<const ICFGNode*,SVFStmtList> ICFGNode2SVFStmtsMap;
|
|
68
68
|
typedef Map<NodeID, NodeID> NodeToNodeMap;
|
|
69
69
|
typedef std::pair<NodeID, APOffset> NodeOffset;
|
|
70
70
|
typedef std::pair<NodeID, AccessPath> NodeAccessPath;
|
|
71
|
-
typedef Map<NodeOffset,
|
|
72
|
-
typedef Map<NodeAccessPath,
|
|
71
|
+
typedef Map<NodeOffset,NodeID> NodeOffsetMap;
|
|
72
|
+
typedef Map<NodeAccessPath,NodeID> NodeAccessPathMap;
|
|
73
73
|
typedef Map<const SVFValue*, NodeAccessPathMap> GepValueVarMap;
|
|
74
74
|
typedef std::pair<const SVFType*, std::vector<AccessPath>> SVFTypeLocSetsPair;
|
|
75
75
|
typedef Map<NodeID, SVFTypeLocSetsPair> TypeLocSetsMap;
|
|
76
|
-
typedef Map<NodePair,
|
|
76
|
+
typedef Map<NodePair,NodeID> NodePairSetMap;
|
|
77
77
|
|
|
78
78
|
private:
|
|
79
79
|
/// 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,
|
|
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*,
|
|
62
|
-
Map<const SVFBasicBlock*,
|
|
63
|
-
Map<const SVFBasicBlock*,
|
|
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*,
|
|
75
|
+
inline const Map<const SVFBasicBlock*,BBSet>& getDomFrontierMap() const
|
|
76
76
|
{
|
|
77
77
|
return dfBBsMap;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
inline Map<const SVFBasicBlock*,
|
|
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*,
|
|
108
|
+
inline const Map<const SVFBasicBlock*,BBSet>& getPostDomTreeMap() const
|
|
109
109
|
{
|
|
110
110
|
return pdtBBsMap;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
inline Map<const SVFBasicBlock*,
|
|
113
|
+
inline Map<const SVFBasicBlock*,BBSet>& getPostDomTreeMap()
|
|
114
114
|
{
|
|
115
115
|
return pdtBBsMap;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
inline const Map<const SVFBasicBlock*,
|
|
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*,
|
|
123
|
+
inline Map<const SVFBasicBlock*,u32_t>& getBBPDomLevel()
|
|
124
124
|
{
|
|
125
125
|
return bb2PdomLevel;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
inline const Map<const SVFBasicBlock*,
|
|
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*,
|
|
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*,
|
|
139
|
+
inline Map<const SVFBasicBlock*,BBSet>& getDomTreeMap()
|
|
140
140
|
{
|
|
141
141
|
return dtBBsMap;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
inline const Map<const SVFBasicBlock*,
|
|
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*,
|
|
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*,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
}
|
|
@@ -247,11 +247,11 @@ protected:
|
|
|
247
247
|
//@{
|
|
248
248
|
inline const PointsTo& getDFInPtsSet(const SVFGNode* stmt, const NodeID node)
|
|
249
249
|
{
|
|
250
|
-
return getDFPTDataTy()->getDFInPtsSet(stmt->getId(),
|
|
250
|
+
return getDFPTDataTy()->getDFInPtsSet(stmt->getId(),node);
|
|
251
251
|
}
|
|
252
252
|
inline const PointsTo& getDFOutPtsSet(const SVFGNode* stmt, const NodeID node)
|
|
253
253
|
{
|
|
254
|
-
return getDFPTDataTy()->getDFOutPtsSet(stmt->getId(),
|
|
254
|
+
return getDFPTDataTy()->getDFOutPtsSet(stmt->getId(),node);
|
|
255
255
|
}
|
|
256
256
|
//@}
|
|
257
257
|
|
|
Binary file
|
|
Binary file
|