svf-lib 1.0.744 → 1.0.745

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.
Binary file
@@ -151,7 +151,7 @@ public:
151
151
  NodeID srcID = addr->getPAGSrcNodeID();
152
152
  /// whether this object is set field-insensitive during pre-analysis
153
153
  if (isFieldInsensitive(srcID))
154
- srcID = getFIObjNode(srcID);
154
+ srcID = getFIObjVar(srcID);
155
155
 
156
156
  CxtVar var(dpm.getCond(),srcID);
157
157
  addDDAPts(pts,var);
@@ -93,7 +93,7 @@ public:
93
93
  NodeID srcID = addr->getPAGSrcNodeID();
94
94
  /// whether this object is set field-insensitive during pre-analysis
95
95
  if (isFieldInsensitive(srcID))
96
- srcID = getFIObjNode(srcID);
96
+ srcID = getFIObjVar(srcID);
97
97
 
98
98
  addDDAPts(pts,srcID);
99
99
  DBOUT(DDDA, SVFUtil::outs() << "\t add points-to target " << srcID << " to dpm ");
@@ -67,9 +67,9 @@ protected:
67
67
 
68
68
  void destroy();
69
69
 
70
- PAGEdge::PAGEdgeSetTy& getPAGEdgeSet(PAGEdge::PEDGEK kind)
70
+ PAGEdge::SVFStmtSetTy& getPAGEdgeSet(PAGEdge::PEDGEK kind)
71
71
  {
72
- return pag->getPTAEdgeSet(kind);
72
+ return pag->getPTASVFStmtSet(kind);
73
73
  }
74
74
 
75
75
  /// Wappers used internally, not expose to Andernsen Pass
@@ -314,9 +314,9 @@ public:
314
314
  {
315
315
  return pag->getAllFieldsObjNode(id);
316
316
  }
317
- inline NodeID getBaseObjNode(NodeID id)
317
+ inline NodeID getBaseObjVar(NodeID id)
318
318
  {
319
- return pag->getBaseObjNode(id);
319
+ return pag->getBaseObjVar(id);
320
320
  }
321
321
  inline bool isSingleFieldObj(NodeID id) const
322
322
  {
@@ -324,18 +324,18 @@ public:
324
324
  return (mem->getMaxFieldOffsetLimit() == 1);
325
325
  }
326
326
  /// Get a field of a memory object
327
- inline NodeID getGepObjNode(NodeID id, const LocationSet& ls)
327
+ inline NodeID getGepObjVar(NodeID id, const LocationSet& ls)
328
328
  {
329
- NodeID gep = pag->getGepObjNode(id,ls);
329
+ NodeID gep = pag->getGepObjVar(id,ls);
330
330
  /// Create a node when it is (1) not exist on graph and (2) not merged
331
331
  if(sccRepNode(gep)==gep && hasConstraintNode(gep)==false)
332
332
  addConstraintNode(new ConstraintNode(gep),gep);
333
333
  return gep;
334
334
  }
335
335
  /// Get a field-insensitive node of a memory object
336
- inline NodeID getFIObjNode(NodeID id)
336
+ inline NodeID getFIObjVar(NodeID id)
337
337
  {
338
- NodeID fi = pag->getFIObjNode(id);
338
+ NodeID fi = pag->getFIObjVar(id);
339
339
  /// Create a node when it is (1) not exist on graph and (2) not merged
340
340
  if (sccRepNode(fi) == fi && hasConstraintNode(fi)==false)
341
341
  addConstraintNode(new ConstraintNode(fi),fi);
@@ -67,7 +67,7 @@ public:
67
67
  typedef Set<const CallPE *> CallPESet;
68
68
  typedef Set<const RetPE *> RetPESet;
69
69
  typedef std::list<const VFGNode*> VFGNodeList;
70
- typedef std::list<const SVFStmt*> PAGEdgeList;
70
+ typedef std::list<const SVFStmt*> SVFStmtList;
71
71
 
72
72
  public:
73
73
  /// Constructor
@@ -118,7 +118,7 @@ public:
118
118
  pagEdges.push_back(edge);
119
119
  }
120
120
 
121
- inline const PAGEdgeList& getPAGEdges() const
121
+ inline const SVFStmtList& getPAGEdges() const
122
122
  {
123
123
  return pagEdges;
124
124
  }
@@ -132,7 +132,7 @@ protected:
132
132
  const SVFFunction* fun;
133
133
  const BasicBlock* bb;
134
134
  VFGNodeList VFGNodes; //< a list of VFGNodes
135
- PAGEdgeList pagEdges; //< a list of PAGEdges
135
+ SVFStmtList pagEdges; //< a list of PAGEdges
136
136
 
137
137
  };
138
138
 
@@ -48,12 +48,12 @@ typedef SVFStmt PAGEdge;
48
48
  class IRGraph : public GenericGraph<SVFVar,SVFStmt>
49
49
  {
50
50
  public:
51
- typedef Set<const SVFStmt*> PAGEdgeSet;
52
- typedef Map<const Value*,PAGEdgeSet> ValueToEdgeMap;
51
+ typedef Set<const SVFStmt*> SVFStmtSet;
52
+ typedef Map<const Value*,SVFStmtSet> ValueToEdgeMap;
53
53
 
54
54
  protected:
55
- SVFStmt::PAGKindToEdgeSetMapTy PAGEdgeKindToSetMap; // < SVFIR edge map containing all PAGEdges
56
- SVFStmt::PAGKindToEdgeSetMapTy PTAPAGEdgeKindToSetMap; // < SVFIR edge map containing only pointer-related edges, i.e, both RHS and RHS are of pointer type
55
+ SVFStmt::KindToSVFStmtMapTy KindToSVFStmtSetMap; // < SVFIR edge map containing all PAGEdges
56
+ SVFStmt::KindToSVFStmtMapTy KindToPTASVFStmtSetMap; // < SVFIR edge map containing only pointer-related edges, i.e, both RHS and RHS are of pointer type
57
57
  bool fromFile; ///< Whether the SVFIR is built according to user specified data from a txt file
58
58
  NodeID nodeNumAfterPAGBuild; // initial node number after building SVFIR, excluding later added nodes, e.g., gepobj nodes
59
59
  u32_t totalPTAPAGEdge;
@@ -80,7 +80,7 @@ protected:
80
80
  /// Map a value to a set of edges
81
81
  inline void mapValueToEdge(const Value *V, SVFStmt *edge)
82
82
  {
83
- auto inserted = valueToEdgeMap.emplace(V, PAGEdgeSet{edge});
83
+ auto inserted = valueToEdgeMap.emplace(V, SVFStmtSet{edge});
84
84
  if (!inserted.second) {
85
85
  inserted.first->second.emplace(edge);
86
86
  }
@@ -94,7 +94,7 @@ public:
94
94
  IRGraph(bool buildFromFile): fromFile(buildFromFile), nodeNumAfterPAGBuild(0), totalPTAPAGEdge(0){
95
95
  symInfo = SymbolTableInfo::SymbolInfo();
96
96
  // insert dummy value if a correct value cannot be found
97
- valueToEdgeMap[nullptr] = PAGEdgeSet();
97
+ valueToEdgeMap[nullptr] = SVFStmtSet();
98
98
  }
99
99
 
100
100
  virtual ~IRGraph();
@@ -105,7 +105,7 @@ public:
105
105
  return fromFile;
106
106
  }
107
107
  /// Get all SVFIR Edges that corresponds to an LLVM value
108
- inline const PAGEdgeSet& getValueEdges(const Value *V)
108
+ inline const SVFStmtSet& getValueEdges(const Value *V)
109
109
  {
110
110
  auto it = valueToEdgeMap.find(V);
111
111
  if (it == valueToEdgeMap.end()) {
@@ -79,7 +79,7 @@ public:
79
79
  typedef VFGEdge::VFGEdgeSetTy::iterator VFGNodeIter;
80
80
  typedef VFGNodeIDToNodeMapTy::iterator iterator;
81
81
  typedef VFGNodeIDToNodeMapTy::const_iterator const_iterator;
82
- typedef SVFIR::PAGEdgeSet PAGEdgeSet;
82
+ typedef SVFIR::SVFStmtSet SVFStmtSet;
83
83
  typedef Set<const VFGNode*> GlobalVFGNodeSet;
84
84
  typedef Set<const PAGNode*> PAGNodeSet;
85
85
 
@@ -427,12 +427,12 @@ protected:
427
427
  void addVFGNodes();
428
428
 
429
429
  /// Get PAGEdge set
430
- virtual inline PAGEdge::PAGEdgeSetTy& getPAGEdgeSet(PAGEdge::PEDGEK kind)
430
+ virtual inline PAGEdge::SVFStmtSetTy& getPAGEdgeSet(PAGEdge::PEDGEK kind)
431
431
  {
432
432
  if (isPtrOnlySVFG())
433
- return pag->getPTAEdgeSet(kind);
433
+ return pag->getPTASVFStmtSet(kind);
434
434
  else
435
- return pag->getEdgeSet(kind);
435
+ return pag->getSVFStmtSet(kind);
436
436
  }
437
437
 
438
438
  virtual inline bool isInterestedPAGNode(const PAGNode* node) const
@@ -169,7 +169,7 @@ public:
169
169
  typedef Map<NodeID, NodeBS> NodeToPTSSMap;
170
170
 
171
171
  /// SVFIR edge list
172
- typedef SVFIR::PAGEdgeList PAGEdgeList;
172
+ typedef SVFIR::SVFStmtList SVFStmtList;
173
173
  /// Call Graph SCC
174
174
  typedef SCCDetection<PTACallGraph*> SCC;
175
175
 
@@ -466,9 +466,9 @@ public:
466
466
  }
467
467
  //@}
468
468
  /// Whether this instruction has SVFIR Edge
469
- bool hasPAGEdgeList(const Instruction* inst);
469
+ bool hasSVFStmtList(const Instruction* inst);
470
470
  /// Given an instruction, get all its the PAGEdge (statement) in sequence
471
- PAGEdgeList& getPAGEdgesFromInst(const Instruction* inst);
471
+ SVFStmtList& getPAGEdgesFromInst(const Instruction* inst);
472
472
 
473
473
  /// getModRefInfo APIs
474
474
  //@{
@@ -94,7 +94,7 @@ public:
94
94
  typedef Map<const MemRegion*, MRVERSION> MemRegToCounterMap;
95
95
 
96
96
  /// SVFIR edge list
97
- typedef SVFIR::PAGEdgeList PAGEdgeList;
97
+ typedef SVFIR::SVFStmtList SVFStmtList;
98
98
 
99
99
  /// Statistics
100
100
  //@{
@@ -346,17 +346,17 @@ public:
346
346
  {
347
347
  return (SVFUtil::isa<FIObjVar>(pag->getGNode(id)));
348
348
  }
349
- inline NodeID getBaseObjNode(NodeID id)
349
+ inline NodeID getBaseObjVar(NodeID id)
350
350
  {
351
- return pag->getBaseObjNode(id);
351
+ return pag->getBaseObjVar(id);
352
352
  }
353
- inline NodeID getFIObjNode(NodeID id)
353
+ inline NodeID getFIObjVar(NodeID id)
354
354
  {
355
- return pag->getFIObjNode(id);
355
+ return pag->getFIObjVar(id);
356
356
  }
357
- inline NodeID getGepObjNode(NodeID id, const LocationSet& ls)
357
+ inline NodeID getGepObjVar(NodeID id, const LocationSet& ls)
358
358
  {
359
- return pag->getGepObjNode(id,ls);
359
+ return pag->getGepObjVar(id,ls);
360
360
  }
361
361
  virtual inline const NodeBS& getAllFieldsObjNode(NodeID id)
362
362
  {
@@ -352,7 +352,7 @@ public:
352
352
  expandedCpts = cpts;;
353
353
  for(typename CPtSet::const_iterator cit = cpts.begin(), ecit=cpts.end(); cit!=ecit; ++cit)
354
354
  {
355
- if(pag->getBaseObjNode(cit->get_id())==cit->get_id())
355
+ if(pag->getBaseObjVar(cit->get_id())==cit->get_id())
356
356
  {
357
357
  NodeBS& fields = pag->getAllFieldsObjNode(cit->get_id());
358
358
  for(NodeBS::iterator it = fields.begin(), eit = fields.end(); it!=eit; ++it)
@@ -53,33 +53,32 @@ public:
53
53
  typedef OrderedMap<const CallBlockNode*,NodeID> CallSiteToFunPtrMap;
54
54
  typedef Map<NodeID,CallSiteSet> FunPtrToCallSitesMap;
55
55
  typedef Map<NodeID,NodeBS> MemObjToFieldsMap;
56
- typedef std::vector<const SVFStmt*> PAGEdgeList;
57
- typedef std::vector<const SVFVar*> PAGNodeList;
58
- typedef std::vector<const CopyStmt*> CopyPEList;
56
+ typedef std::vector<const SVFStmt*> SVFStmtList;
57
+ typedef std::vector<const SVFVar*> SVFVarList;
59
58
  typedef Map<const SVFVar*,PhiStmt*> PHINodeMap;
60
- typedef Map<const SVFFunction*,PAGNodeList> FunToArgsListMap;
61
- typedef Map<const CallBlockNode*,PAGNodeList> CSToArgsListMap;
59
+ typedef Map<const SVFFunction*,SVFVarList> FunToArgsListMap;
60
+ typedef Map<const CallBlockNode*,SVFVarList> CSToArgsListMap;
62
61
  typedef Map<const RetBlockNode*,const SVFVar*> CSToRetMap;
63
62
  typedef Map<const SVFFunction*,const SVFVar*> FunToRetMap;
64
- typedef Map<const SVFFunction*,PAGEdgeSet> FunToPAGEdgeSetMap;
65
- typedef Map<const ICFGNode*,PAGEdgeList> Inst2PAGEdgesMap;
63
+ typedef Map<const SVFFunction*,SVFStmtSet> FunToPAGEdgeSetMap;
64
+ typedef Map<const ICFGNode*,SVFStmtList> Inst2PAGEdgesMap;
66
65
  typedef Map<NodeID, NodeID> NodeToNodeMap;
67
66
  typedef std::pair<NodeID, Size_t> NodeOffset;
68
67
  typedef std::pair<NodeID, LocationSet> NodeLocationSet;
69
68
  typedef Map<NodeOffset,NodeID> NodeOffsetMap;
70
69
  typedef Map<NodeLocationSet,NodeID> NodeLocationSetMap;
71
- typedef Map<const Value*, NodeLocationSetMap> GepValPNMap;
70
+ typedef Map<const Value*, NodeLocationSetMap> GepValueVarMap;
72
71
  typedef Map<NodePair,NodeID> NodePairSetMap;
73
72
 
74
73
  private:
75
74
  /// ValueNodes - This map indicates the Node that a particular Value* is
76
75
  /// represented by. This contains entries for all pointers.
77
- Inst2PAGEdgesMap inst2PAGEdgesMap; ///< Map a instruction to its PAGEdges
78
- Inst2PAGEdgesMap inst2PTAPAGEdgesMap; ///< Map a instruction to its PointerAnalysis related PAGEdges
79
- GepValPNMap GepValNodeMap; ///< Map a pair<base,off> to a gep value node id
80
- NodeLocationSetMap GepObjNodeMap; ///< Map a pair<base,off> to a gep obj node id
76
+ Inst2PAGEdgesMap inst2SVFStmtsMap; ///< Map a instruction to its PAGEdges
77
+ Inst2PAGEdgesMap inst2PTASVFStmtsMap; ///< Map a instruction to its PointerAnalysis related PAGEdges
78
+ GepValueVarMap GepValObjMap; ///< Map a pair<base,off> to a gep value node id
79
+ NodeLocationSetMap GepObjVarMap; ///< Map a pair<base,off> to a gep obj node id
81
80
  MemObjToFieldsMap memToFieldsMap; ///< Map a mem object id to all its fields
82
- PAGEdgeSet globPAGEdgesSet; ///< Global PAGEdges without control flow information
81
+ SVFStmtSet globSVFStmtSet; ///< Global PAGEdges without control flow information
83
82
  PHINodeMap phiNodeMap; ///< A set of phi copy edges
84
83
  FunToArgsListMap funArgsListMap; ///< Map a function to a list of all its formal parameters
85
84
  CSToArgsListMap callSiteArgsListMap; ///< Map a callsite to a list of all its actual parameters
@@ -124,10 +123,10 @@ public:
124
123
  {
125
124
  return memToFieldsMap;
126
125
  }
127
- /// Return GepObjNodeMap
126
+ /// Return GepObjVarMap
128
127
  inline NodeLocationSetMap& getGepObjNodeMap()
129
128
  {
130
- return GepObjNodeMap;
129
+ return GepObjVarMap;
131
130
  }
132
131
  /// Return ICFG
133
132
  inline ICFG* getICFG()
@@ -160,46 +159,46 @@ public:
160
159
  /// Get/set methods to get SVFStmts based on their kinds and ICFGNodes
161
160
  //@{
162
161
  /// Get edges set according to its kind
163
- inline SVFStmt::PAGEdgeSetTy& getEdgeSet(SVFStmt::PEDGEK kind)
162
+ inline SVFStmt::SVFStmtSetTy& getSVFStmtSet(SVFStmt::PEDGEK kind)
164
163
  {
165
- return PAGEdgeKindToSetMap[kind];
164
+ return KindToSVFStmtSetMap[kind];
166
165
  }
167
166
  /// Get PTA edges set according to its kind
168
- inline SVFStmt::PAGEdgeSetTy& getPTAEdgeSet(SVFStmt::PEDGEK kind)
167
+ inline SVFStmt::SVFStmtSetTy& getPTASVFStmtSet(SVFStmt::PEDGEK kind)
169
168
  {
170
- return PTAPAGEdgeKindToSetMap[kind];
169
+ return KindToPTASVFStmtSetMap[kind];
171
170
  }
172
171
  /// Whether this instruction has SVFIR Edge
173
- inline bool hasPAGEdgeList(const ICFGNode* inst) const
172
+ inline bool hasSVFStmtList(const ICFGNode* inst) const
174
173
  {
175
- return inst2PAGEdgesMap.find(inst)!=inst2PAGEdgesMap.end();
174
+ return inst2SVFStmtsMap.find(inst)!=inst2SVFStmtsMap.end();
176
175
  }
177
- inline bool hasPTAPAGEdgeList(const ICFGNode* inst) const
176
+ inline bool hasPTASVFStmtList(const ICFGNode* inst) const
178
177
  {
179
- return inst2PTAPAGEdgesMap.find(inst)!=inst2PTAPAGEdgesMap.end();
178
+ return inst2PTASVFStmtsMap.find(inst)!=inst2PTASVFStmtsMap.end();
180
179
  }
181
180
  /// Given an instruction, get all its PAGEdges
182
- inline PAGEdgeList& getInstPAGEdgeList(const ICFGNode* inst)
181
+ inline SVFStmtList& getSVFStmtList(const ICFGNode* inst)
183
182
  {
184
- return inst2PAGEdgesMap[inst];
183
+ return inst2SVFStmtsMap[inst];
185
184
  }
186
185
  /// Given an instruction, get all its PTA PAGEdges
187
- inline PAGEdgeList& getInstPTAPAGEdgeList(const ICFGNode* inst)
186
+ inline SVFStmtList& getPTASVFStmtList(const ICFGNode* inst)
188
187
  {
189
- return inst2PTAPAGEdgesMap[inst];
188
+ return inst2PTASVFStmtsMap[inst];
190
189
  }
191
190
  /// Add a SVFStmt into instruction map
192
- inline void addToInstPAGEdgeList(ICFGNode* inst, SVFStmt* edge)
191
+ inline void addToSVFStmtList(ICFGNode* inst, SVFStmt* edge)
193
192
  {
194
193
  edge->setICFGNode(inst);
195
- inst2PAGEdgesMap[inst].push_back(edge);
194
+ inst2SVFStmtsMap[inst].push_back(edge);
196
195
  if (edge->isPTAEdge())
197
- inst2PTAPAGEdgesMap[inst].push_back(edge);
196
+ inst2PTASVFStmtsMap[inst].push_back(edge);
198
197
  }
199
198
  /// Get global PAGEdges (not in a procedure)
200
- inline PAGEdgeSet& getGlobalPAGEdgeSet()
199
+ inline SVFStmtSet& getGlobalSVFStmtSet()
201
200
  {
202
- return globPAGEdgesSet;
201
+ return globSVFStmtSet;
203
202
  }
204
203
  /// Get all callsites
205
204
  inline const CallSiteSet& getCallSiteSet() const
@@ -223,7 +222,7 @@ public:
223
222
  return funArgsListMap;
224
223
  }
225
224
  /// Get function arguments list
226
- inline const PAGNodeList& getFunArgsList(const SVFFunction* func) const
225
+ inline const SVFVarList& getFunArgsList(const SVFFunction* func) const
227
226
  {
228
227
  FunToArgsListMap::const_iterator it = funArgsListMap.find(func);
229
228
  assert(it != funArgsListMap.end() && "this function doesn't have arguments");
@@ -240,7 +239,7 @@ public:
240
239
  return callSiteArgsListMap;
241
240
  }
242
241
  /// Get callsite argument list
243
- inline const PAGNodeList& getCallSiteArgsList(const CallBlockNode* cs) const
242
+ inline const SVFVarList& getCallSiteArgsList(const CallBlockNode* cs) const
244
243
  {
245
244
  CSToArgsListMap::const_iterator it = callSiteArgsListMap.find(cs);
246
245
  assert(it != callSiteArgsListMap.end() && "this call site doesn't have arguments");
@@ -284,19 +283,19 @@ public:
284
283
  //@{
285
284
  inline Size_t getFieldValNodeNum() const
286
285
  {
287
- return GepValNodeMap.size();
286
+ return GepValObjMap.size();
288
287
  }
289
288
  inline Size_t getFieldObjNodeNum() const
290
289
  {
291
- return GepObjNodeMap.size();
290
+ return GepObjVarMap.size();
292
291
  }
293
292
  //@}
294
293
 
295
294
  /// Due to constaint expression, curInst is used to distinguish different instructions (e.g., memorycpy) when creating GepValVar.
296
- inline NodeID getGepValNode(const Value* curInst, NodeID base, const LocationSet& ls) const
295
+ inline NodeID getGepValVar(const Value* curInst, NodeID base, const LocationSet& ls) const
297
296
  {
298
- GepValPNMap::const_iterator iter = GepValNodeMap.find(curInst);
299
- if(iter==GepValNodeMap.end()){
297
+ GepValueVarMap::const_iterator iter = GepValObjMap.find(curInst);
298
+ if(iter==GepValObjMap.end()){
300
299
  return UINT_MAX;
301
300
  }
302
301
  else{
@@ -344,8 +343,8 @@ public:
344
343
  inline SVFStmt* getIntraPAGEdge(SVFVar* src, SVFVar* dst, SVFStmt::PEDGEK kind)
345
344
  {
346
345
  SVFStmt edge(src,dst,kind);
347
- const SVFStmt::PAGEdgeSetTy& edgeSet = getEdgeSet(kind);
348
- SVFStmt::PAGEdgeSetTy::const_iterator it = edgeSet.find(&edge);
346
+ const SVFStmt::SVFStmtSetTy& edgeSet = getSVFStmtSet(kind);
347
+ SVFStmt::SVFStmtSetTy::const_iterator it = edgeSet.find(&edge);
349
348
  assert(it != edgeSet.end() && "can not find pag edge");
350
349
  return (*it);
351
350
  }
@@ -370,21 +369,21 @@ public:
370
369
  //@}
371
370
 
372
371
  /// Get a field SVFIR Object node according to base mem obj and offset
373
- NodeID getGepObjNode(const MemObj* obj, const LocationSet& ls);
372
+ NodeID getGepObjVar(const MemObj* obj, const LocationSet& ls);
374
373
  /// Get a field obj SVFIR node according to a mem obj and a given offset
375
- NodeID getGepObjNode(NodeID id, const LocationSet& ls) ;
374
+ NodeID getGepObjVar(NodeID id, const LocationSet& ls) ;
376
375
  /// Get a field-insensitive obj SVFIR node according to a mem obj
377
376
  //@{
378
- inline NodeID getFIObjNode(const MemObj* obj) const
377
+ inline NodeID getFIObjVar(const MemObj* obj) const
379
378
  {
380
379
  return obj->getId();
381
380
  }
382
- inline NodeID getFIObjNode(NodeID id) const
381
+ inline NodeID getFIObjVar(NodeID id) const
383
382
  {
384
383
  SVFVar* node = pag->getGNode(id);
385
384
  assert(SVFUtil::isa<ObjVar>(node) && "need an object node");
386
385
  ObjVar* obj = SVFUtil::cast<ObjVar>(node);
387
- return getFIObjNode(obj->getMemObj());
386
+ return getFIObjVar(obj->getMemObj());
388
387
  }
389
388
  //@}
390
389
 
@@ -438,9 +437,9 @@ public:
438
437
  /// Base and Offset methods for Value and Object node
439
438
  //@{
440
439
  /// Get a base pointer node given a field pointer
441
- NodeID getBaseValNode(NodeID nodeId);
440
+ NodeID getBaseValVar(NodeID nodeId);
442
441
  LocationSet getLocationSetFromBaseNode(NodeID nodeId);
443
- inline NodeID getBaseObjNode(NodeID id) const
442
+ inline NodeID getBaseObjVar(NodeID id) const
444
443
  {
445
444
  return getBaseObj(id)->getId();
446
445
  }
@@ -481,12 +480,12 @@ private:
481
480
 
482
481
  /// Map a SVFStatement type to a set of corresponding SVF statements
483
482
  inline void addToStmt2TypeMap(SVFStmt* edge) {
484
- bool added = PAGEdgeKindToSetMap[edge->getEdgeKind()].insert(edge).second;
483
+ bool added = KindToSVFStmtSetMap[edge->getEdgeKind()].insert(edge).second;
485
484
  assert(added && "duplicated edge, not added!!!");
486
485
  if (edge->isPTAEdge())
487
486
  {
488
487
  totalPTAPAGEdge++;
489
- PTAPAGEdgeKindToSetMap[edge->getEdgeKind()].insert(edge);
488
+ KindToPTASVFStmtSetMap[edge->getEdgeKind()].insert(edge);
490
489
  }
491
490
  }
492
491
  /// Get/set method for function/callsite arguments and returns
@@ -553,9 +552,9 @@ private:
553
552
  return addNode(node,i);
554
553
  }
555
554
 
556
- /// Add a temp field value node, this method can only invoked by getGepValNode
555
+ /// Add a temp field value node, this method can only invoked by getGepValVar
557
556
  NodeID addGepValNode(const Value* curInst,const Value* val, const LocationSet& ls, NodeID i, const Type *type, u32_t fieldidx);
558
- /// Add a field obj node, this method can only invoked by getGepObjNode
557
+ /// Add a field obj node, this method can only invoked by getGepObjVar
559
558
  NodeID addGepObjNode(const MemObj* obj, const LocationSet& ls);
560
559
  /// Add a field-insensitive node, this method can only invoked by getFIGepObjNode
561
560
  NodeID addFIObjNode(const MemObj* obj);
@@ -616,7 +615,7 @@ private:
616
615
  /// Add global PAGEdges (not in a procedure)
617
616
  inline void addGlobalPAGEdge(const SVFStmt* edge)
618
617
  {
619
- globPAGEdgesSet.insert(edge);
618
+ globSVFStmtSet.insert(edge);
620
619
  }
621
620
  /// Add callsites
622
621
  inline void addCallSite(const CallBlockNode* call)
@@ -626,33 +625,33 @@ private:
626
625
  /// Add an edge into SVFIR
627
626
  //@{
628
627
  /// Add Address edge
629
- AddrStmt* addAddrPE(NodeID src, NodeID dst);
628
+ AddrStmt* addAddrStmt(NodeID src, NodeID dst);
630
629
  /// Add Copy edge
631
- CopyStmt* addCopyPE(NodeID src, NodeID dst);
630
+ CopyStmt* addCopyStmt(NodeID src, NodeID dst);
632
631
  /// Add phi node information
633
- PhiStmt* addPhiNode(NodeID res, NodeID opnd);
632
+ PhiStmt* addPhiStmt(NodeID res, NodeID opnd);
634
633
  /// Add Copy edge
635
- CmpStmt* addCmpPE(NodeID op1, NodeID op2, NodeID dst, u32_t opcode);
634
+ CmpStmt* addCmpStmt(NodeID op1, NodeID op2, NodeID dst, u32_t opcode);
636
635
  /// Add Copy edge
637
- BinaryOPStmt* addBinaryOPPE(NodeID op1, NodeID op2, NodeID dst, u32_t opcode);
636
+ BinaryOPStmt* addBinaryOPStmt(NodeID op1, NodeID op2, NodeID dst, u32_t opcode);
638
637
  /// Add Unary edge
639
- UnaryOPStmt* addUnaryOPPE(NodeID src, NodeID dst, u32_t opcode);
638
+ UnaryOPStmt* addUnaryOPStmt(NodeID src, NodeID dst, u32_t opcode);
640
639
  /// Add BranchStmt
641
640
  BranchStmt* addBranchStmt(NodeID br, NodeID cond, std::vector<const ICFGNode*> succs);
642
641
  /// Add Load edge
643
- LoadStmt* addLoadPE(NodeID src, NodeID dst);
642
+ LoadStmt* addLoadStmt(NodeID src, NodeID dst);
644
643
  /// Add Store edge
645
- StoreStmt* addStorePE(NodeID src, NodeID dst, const IntraBlockNode* val);
644
+ StoreStmt* addStoreStmt(NodeID src, NodeID dst, const IntraBlockNode* val);
646
645
  /// Add Call edge
647
646
  CallPE* addCallPE(NodeID src, NodeID dst, const CallBlockNode* cs);
648
647
  /// Add Return edge
649
648
  RetPE* addRetPE(NodeID src, NodeID dst, const CallBlockNode* cs);
650
649
  /// Add Gep edge
651
- GepStmt* addGepPE(NodeID src, NodeID dst, const LocationSet& ls, bool constGep);
650
+ GepStmt* addGepStmt(NodeID src, NodeID dst, const LocationSet& ls, bool constGep);
652
651
  /// Add Offset(Gep) edge
653
- NormalGepStmt* addNormalGepPE(NodeID src, NodeID dst, const LocationSet& ls);
652
+ NormalGepStmt* addNormalGepStmt(NodeID src, NodeID dst, const LocationSet& ls);
654
653
  /// Add Variant(Gep) edge
655
- VariantGepStmt* addVariantGepPE(NodeID src, NodeID dst);
654
+ VariantGepStmt* addVariantGepStmt(NodeID src, NodeID dst);
656
655
  /// Add Thread fork edge for parameter passing
657
656
  TDForkPE* addThreadForkPE(NodeID src, NodeID dst, const CallBlockNode* cs);
658
657
  /// Add Thread join edge for parameter passing
@@ -660,7 +659,7 @@ private:
660
659
  //@}
661
660
 
662
661
  /// Set a pointer points-to black hole (e.g. int2ptr)
663
- SVFStmt* addBlackHoleAddrPE(NodeID node);
662
+ SVFStmt* addBlackHoleAddrStmt(NodeID node);
664
663
  };
665
664
 
666
665
  typedef SVFIR PAG;
@@ -175,9 +175,10 @@ public:
175
175
  }
176
176
  //@}
177
177
 
178
- typedef GenericNode<SVFVar,SVFStmt>::GEdgeSetTy PAGEdgeSetTy;
179
- typedef Map<EdgeID, PAGEdgeSetTy> PAGEdgeToSetMapTy;
180
- typedef PAGEdgeToSetMapTy PAGKindToEdgeSetMapTy;
178
+ typedef GenericNode<SVFVar,SVFStmt>::GEdgeSetTy SVFStmtSetTy;
179
+ typedef Map<EdgeID, SVFStmtSetTy> PAGEdgeToSetMapTy;
180
+ typedef PAGEdgeToSetMapTy KindToSVFStmtMapTy;
181
+ typedef SVFStmtSetTy PAGEdgeSetTy;
181
182
 
182
183
  private:
183
184
  typedef Map<const ICFGNode*, u32_t> Inst2LabelMap;
@@ -76,8 +76,8 @@ public:
76
76
 
77
77
  protected:
78
78
  const Value* value; ///< value of this SVFIR node
79
- SVFStmt::PAGKindToEdgeSetMapTy InEdgeKindToSetMap;
80
- SVFStmt::PAGKindToEdgeSetMapTy OutEdgeKindToSetMap;
79
+ SVFStmt::KindToSVFStmtMapTy InEdgeKindToSetMap;
80
+ SVFStmt::KindToSVFStmtMapTy OutEdgeKindToSetMap;
81
81
  bool isTLPointer; /// top-level pointer
82
82
  bool isATPointer; /// address-taken pointer
83
83
 
@@ -158,13 +158,13 @@ public:
158
158
  }
159
159
 
160
160
  /// Get incoming SVFIR edges
161
- inline SVFStmt::PAGEdgeSetTy& getIncomingEdges(SVFStmt::PEDGEK kind)
161
+ inline SVFStmt::SVFStmtSetTy& getIncomingEdges(SVFStmt::PEDGEK kind)
162
162
  {
163
163
  return InEdgeKindToSetMap[kind];
164
164
  }
165
165
 
166
166
  /// Get outgoing SVFIR edges
167
- inline SVFStmt::PAGEdgeSetTy& getOutgoingEdges(SVFStmt::PEDGEK kind)
167
+ inline SVFStmt::SVFStmtSetTy& getOutgoingEdges(SVFStmt::PEDGEK kind)
168
168
  {
169
169
  return OutEdgeKindToSetMap[kind];
170
170
  }
@@ -172,7 +172,7 @@ public:
172
172
  /// Has incoming SVFIR edges
173
173
  inline bool hasIncomingEdges(SVFStmt::PEDGEK kind) const
174
174
  {
175
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
175
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
176
176
  if (it != InEdgeKindToSetMap.end())
177
177
  return (!it->second.empty());
178
178
  else
@@ -182,7 +182,7 @@ public:
182
182
  /// Has incoming VariantGepEdges
183
183
  inline bool hasIncomingVariantGepEdge() const
184
184
  {
185
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = InEdgeKindToSetMap.find(SVFStmt::VariantGep);
185
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(SVFStmt::VariantGep);
186
186
  if (it != InEdgeKindToSetMap.end())
187
187
  {
188
188
  return (!it->second.empty());
@@ -191,17 +191,17 @@ public:
191
191
  }
192
192
 
193
193
  /// Get incoming SVFStmt iterator
194
- inline SVFStmt::PAGEdgeSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
194
+ inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
195
195
  {
196
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
196
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
197
197
  assert(it!=InEdgeKindToSetMap.end() && "The node does not have such kind of edge");
198
198
  return it->second.begin();
199
199
  }
200
200
 
201
201
  /// Get incoming SVFStmt iterator
202
- inline SVFStmt::PAGEdgeSetTy::iterator getIncomingEdgesEnd(SVFStmt::PEDGEK kind) const
202
+ inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd(SVFStmt::PEDGEK kind) const
203
203
  {
204
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
204
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
205
205
  assert(it!=InEdgeKindToSetMap.end() && "The node does not have such kind of edge");
206
206
  return it->second.end();
207
207
  }
@@ -209,7 +209,7 @@ public:
209
209
  /// Has outgoing SVFIR edges
210
210
  inline bool hasOutgoingEdges(SVFStmt::PEDGEK kind) const
211
211
  {
212
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
212
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
213
213
  if (it != OutEdgeKindToSetMap.end())
214
214
  return (!it->second.empty());
215
215
  else
@@ -217,17 +217,17 @@ public:
217
217
  }
218
218
 
219
219
  /// Get outgoing SVFStmt iterator
220
- inline SVFStmt::PAGEdgeSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
220
+ inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
221
221
  {
222
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
222
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
223
223
  assert(it!=OutEdgeKindToSetMap.end() && "The node does not have such kind of edge");
224
224
  return it->second.begin();
225
225
  }
226
226
 
227
227
  /// Get outgoing SVFStmt iterator
228
- inline SVFStmt::PAGEdgeSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
228
+ inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
229
229
  {
230
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
230
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
231
231
  assert(it!=OutEdgeKindToSetMap.end() && "The node does not have such kind of edge");
232
232
  return it->second.end();
233
233
  }
@@ -269,13 +269,13 @@ public:
269
269
 
270
270
  public:
271
271
 
272
- NodeID getGepValNode(const Value* val, const LocationSet& ls, const Type *baseType, u32_t fieldidx);
272
+ NodeID getGepValVar(const Value* val, const LocationSet& ls, const Type *baseType, u32_t fieldidx);
273
273
 
274
274
  void setCurrentBBAndValueForPAGEdge(PAGEdge* edge);
275
275
 
276
276
  inline PAGEdge* addBlackHoleAddrEdge(NodeID node)
277
277
  {
278
- PAGEdge *edge = pag->addBlackHoleAddrPE(node);
278
+ PAGEdge *edge = pag->addBlackHoleAddrStmt(node);
279
279
  setCurrentBBAndValueForPAGEdge(edge);
280
280
  return edge;
281
281
  }
@@ -283,42 +283,42 @@ public:
283
283
  /// Add Address edge
284
284
  inline AddrStmt* addAddrEdge(NodeID src, NodeID dst)
285
285
  {
286
- AddrStmt *edge = pag->addAddrPE(src, dst);
286
+ AddrStmt *edge = pag->addAddrStmt(src, dst);
287
287
  setCurrentBBAndValueForPAGEdge(edge);
288
288
  return edge;
289
289
  }
290
290
  /// Add Copy edge
291
291
  inline CopyStmt* addCopyEdge(NodeID src, NodeID dst)
292
292
  {
293
- CopyStmt *edge = pag->addCopyPE(src, dst);
293
+ CopyStmt *edge = pag->addCopyStmt(src, dst);
294
294
  setCurrentBBAndValueForPAGEdge(edge);
295
295
  return edge;
296
296
  }
297
297
  /// Add Copy edge
298
- inline PhiStmt* addPhiNode(NodeID res, NodeID opnd)
298
+ inline PhiStmt* addPhiStmt(NodeID res, NodeID opnd)
299
299
  {
300
- PhiStmt *edge = pag->addPhiNode(res,opnd);
300
+ PhiStmt *edge = pag->addPhiStmt(res,opnd);
301
301
  setCurrentBBAndValueForPAGEdge(edge);
302
302
  return edge;
303
303
  }
304
304
  /// Add Copy edge
305
305
  inline CmpStmt* addCmpEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
306
306
  {
307
- CmpStmt *edge = pag->addCmpPE(op1, op2, dst, opcode);
307
+ CmpStmt *edge = pag->addCmpStmt(op1, op2, dst, opcode);
308
308
  setCurrentBBAndValueForPAGEdge(edge);
309
309
  return edge;
310
310
  }
311
311
  /// Add Copy edge
312
312
  inline BinaryOPStmt* addBinaryOPEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
313
313
  {
314
- BinaryOPStmt *edge = pag->addBinaryOPPE(op1, op2, dst, opcode);
314
+ BinaryOPStmt *edge = pag->addBinaryOPStmt(op1, op2, dst, opcode);
315
315
  setCurrentBBAndValueForPAGEdge(edge);
316
316
  return edge;
317
317
  }
318
318
  /// Add Unary edge
319
319
  inline UnaryOPStmt* addUnaryOPEdge(NodeID src, NodeID dst, u32_t opcode)
320
320
  {
321
- UnaryOPStmt *edge = pag->addUnaryOPPE(src, dst, opcode);
321
+ UnaryOPStmt *edge = pag->addUnaryOPStmt(src, dst, opcode);
322
322
  setCurrentBBAndValueForPAGEdge(edge);
323
323
  return edge;
324
324
  }
@@ -331,7 +331,7 @@ public:
331
331
  /// Add Load edge
332
332
  inline LoadStmt* addLoadEdge(NodeID src, NodeID dst)
333
333
  {
334
- LoadStmt *edge = pag->addLoadPE(src, dst);
334
+ LoadStmt *edge = pag->addLoadStmt(src, dst);
335
335
  setCurrentBBAndValueForPAGEdge(edge);
336
336
  return edge;
337
337
  }
@@ -343,7 +343,7 @@ public:
343
343
  node = pag->getICFG()->getIntraBlockNode(inst);
344
344
  else
345
345
  node = nullptr;
346
- StoreStmt *edge = pag->addStorePE(src, dst, node);
346
+ StoreStmt *edge = pag->addStoreStmt(src, dst, node);
347
347
  setCurrentBBAndValueForPAGEdge(edge);
348
348
  return edge;
349
349
  }
@@ -364,21 +364,21 @@ public:
364
364
  /// Add Gep edge
365
365
  inline GepStmt* addGepEdge(NodeID src, NodeID dst, const LocationSet& ls, bool constGep)
366
366
  {
367
- GepStmt *edge = pag->addGepPE(src, dst, ls, constGep);
367
+ GepStmt *edge = pag->addGepStmt(src, dst, ls, constGep);
368
368
  setCurrentBBAndValueForPAGEdge(edge);
369
369
  return edge;
370
370
  }
371
371
  /// Add Offset(Gep) edge
372
372
  inline NormalGepStmt* addNormalGepEdge(NodeID src, NodeID dst, const LocationSet& ls)
373
373
  {
374
- NormalGepStmt *edge = pag->addNormalGepPE(src, dst, ls);
374
+ NormalGepStmt *edge = pag->addNormalGepStmt(src, dst, ls);
375
375
  setCurrentBBAndValueForPAGEdge(edge);
376
376
  return edge;
377
377
  }
378
378
  /// Add Variant(Gep) edge
379
379
  inline VariantGepStmt* addVariantGepEdge(NodeID src, NodeID dst)
380
380
  {
381
- VariantGepStmt *edge = pag->addVariantGepPE(src, dst);
381
+ VariantGepStmt *edge = pag->addVariantGepStmt(src, dst);
382
382
  setCurrentBBAndValueForPAGEdge(edge);
383
383
  return edge;
384
384
  }
@@ -99,7 +99,7 @@ private:
99
99
  SVF::Size_t locationSetOffset = std::stoi(llvm::cast<llvm::MDString>(mdNode->getOperand(1))->getString().str());
100
100
 
101
101
  LocationSet locationSet = LocationSet(locationSetOffset);
102
- SVF::NodeID gepnodeId = pag->getGepObjNode(baseNodeId, locationSet);
102
+ SVF::NodeID gepnodeId = pag->getGepObjVar(baseNodeId, locationSet);
103
103
 
104
104
  assert(nodeId == gepnodeId && "nodeId != gepnodeId");
105
105
  }
@@ -97,8 +97,8 @@ protected:
97
97
  const NodeBS &getGepObjs(NodeID base);
98
98
 
99
99
  /// Returns the GEP object node(s) of base for ls. This may include clones.
100
- /// If there are no GEP objects, then getGepObjNode is called on the SVFIR
101
- /// (through base's getGepObjNode) which will create one.
100
+ /// If there are no GEP objects, then getGepObjVar is called on the SVFIR
101
+ /// (through base's getGepObjVar) which will create one.
102
102
  const NodeBS getGepObjClones(NodeID base, unsigned offset);
103
103
 
104
104
  /// Initialise the pointees of p at loc (which is type tildet *). reuse indicates
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.744",
3
+ "version": "1.0.745",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {