svf-lib 1.0.816 → 1.0.820

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.
@@ -163,19 +163,19 @@ public:
163
163
  /// Get a basic block ICFGNode
164
164
  /// TODO:: need to fix the assertions
165
165
  //@{
166
- ICFGNode* getBlockICFGNode(const Instruction* inst);
166
+ ICFGNode* getICFGNode(const Instruction* inst);
167
167
 
168
- CallICFGNode* getCallBlockNode(const Instruction* inst);
168
+ CallICFGNode* getCallICFGNode(const Instruction* inst);
169
169
 
170
- RetICFGNode* getRetBlockNode(const Instruction* inst);
170
+ RetICFGNode* getRetICFGNode(const Instruction* inst);
171
171
 
172
- IntraICFGNode* getIntraBlockNode(const Instruction* inst);
172
+ IntraICFGNode* getIntraICFGNode(const Instruction* inst);
173
173
 
174
- FunEntryICFGNode* getFunEntryBlockNode(const SVFFunction* fun);
174
+ FunEntryICFGNode* getFunEntryICFGNode(const SVFFunction* fun);
175
175
 
176
- FunExitICFGNode* getFunExitBlockNode(const SVFFunction* fun);
176
+ FunExitICFGNode* getFunExitICFGNode(const SVFFunction* fun);
177
177
 
178
- inline GlobalICFGNode* getGlobalBlockNode() const
178
+ inline GlobalICFGNode* getGlobalICFGNode() const
179
179
  {
180
180
  return globalBlockNode;
181
181
  }
@@ -184,14 +184,14 @@ public:
184
184
  private:
185
185
 
186
186
  /// Get/Add IntraBlock ICFGNode
187
- inline IntraICFGNode* getIntraBlockICFGNode(const Instruction* inst)
187
+ inline IntraICFGNode* getIntraBlock(const Instruction* inst)
188
188
  {
189
189
  InstToBlockNodeMapTy::const_iterator it = InstToBlockNodeMap.find(inst);
190
190
  if (it == InstToBlockNodeMap.end())
191
191
  return nullptr;
192
192
  return it->second;
193
193
  }
194
- inline IntraICFGNode* addIntraBlockICFGNode(const Instruction* inst)
194
+ inline IntraICFGNode* addIntraBlock(const Instruction* inst)
195
195
  {
196
196
  IntraICFGNode* sNode = new IntraICFGNode(totalICFGNode++,inst);
197
197
  addICFGNode(sNode);
@@ -200,14 +200,14 @@ private:
200
200
  }
201
201
 
202
202
  /// Get/Add a function entry node
203
- inline FunEntryICFGNode* getFunEntryICFGNode(const SVFFunction* fun)
203
+ inline FunEntryICFGNode* getFunEntryBlock(const SVFFunction* fun)
204
204
  {
205
205
  FunToFunEntryNodeMapTy::const_iterator it = FunToFunEntryNodeMap.find(fun);
206
206
  if (it == FunToFunEntryNodeMap.end())
207
207
  return nullptr;
208
208
  return it->second;
209
209
  }
210
- inline FunEntryICFGNode* addFunEntryICFGNode(const SVFFunction* fun)
210
+ inline FunEntryICFGNode* addFunEntryBlock(const SVFFunction* fun)
211
211
  {
212
212
  FunEntryICFGNode* sNode = new FunEntryICFGNode(totalICFGNode++,fun);
213
213
  addICFGNode(sNode);
@@ -216,14 +216,14 @@ private:
216
216
  }
217
217
 
218
218
  /// Get/Add a function exit node
219
- inline FunExitICFGNode* getFunExitICFGNode(const SVFFunction* fun)
219
+ inline FunExitICFGNode* getFunExitBlock(const SVFFunction* fun)
220
220
  {
221
221
  FunToFunExitNodeMapTy::const_iterator it = FunToFunExitNodeMap.find(fun);
222
222
  if (it == FunToFunExitNodeMap.end())
223
223
  return nullptr;
224
224
  return it->second;
225
225
  }
226
- inline FunExitICFGNode* addFunExitICFGNode(const SVFFunction* fun)
226
+ inline FunExitICFGNode* addFunExitBlock(const SVFFunction* fun)
227
227
  {
228
228
  FunExitICFGNode* sNode = new FunExitICFGNode(totalICFGNode++, fun);
229
229
  addICFGNode(sNode);
@@ -232,14 +232,14 @@ private:
232
232
  }
233
233
 
234
234
  /// Get/Add a call node
235
- inline CallICFGNode* addCallICFGNode(const Instruction* cs)
235
+ inline CallICFGNode* addCallBlock(const Instruction* cs)
236
236
  {
237
237
  CallICFGNode* sNode = new CallICFGNode(totalICFGNode++, cs);
238
238
  addICFGNode(sNode);
239
239
  CSToCallNodeMap[cs] = sNode;
240
240
  return sNode;
241
241
  }
242
- inline CallICFGNode* getCallICFGNode(const Instruction* cs)
242
+ inline CallICFGNode* getCallBlock(const Instruction* cs)
243
243
  {
244
244
  CSToCallNodeMapTy::const_iterator it = CSToCallNodeMap.find(cs);
245
245
  if (it == CSToCallNodeMap.end())
@@ -248,16 +248,16 @@ private:
248
248
  }
249
249
 
250
250
  /// Get/Add a return node
251
- inline RetICFGNode* getRetICFGNode(const Instruction* cs)
251
+ inline RetICFGNode* getRetBlock(const Instruction* cs)
252
252
  {
253
253
  CSToRetNodeMapTy::const_iterator it = CSToRetNodeMap.find(cs);
254
254
  if (it == CSToRetNodeMap.end())
255
255
  return nullptr;
256
256
  return it->second;
257
257
  }
258
- inline RetICFGNode* addRetICFGNode(const Instruction* cs)
258
+ inline RetICFGNode* addRetBlock(const Instruction* cs)
259
259
  {
260
- CallICFGNode* callBlockNode = getCallBlockNode(cs);
260
+ CallICFGNode* callBlockNode = getCallICFGNode(cs);
261
261
  RetICFGNode* sNode = new RetICFGNode(totalICFGNode++, cs, callBlockNode);
262
262
  callBlockNode->setRetICFGNode(sNode);
263
263
  addICFGNode(sNode);
@@ -384,7 +384,7 @@ public:
384
384
  }
385
385
 
386
386
  /// Return callsite
387
- inline const RetICFGNode* getRetICFGNode() const
387
+ inline const RetICFGNode* getRetBlock() const
388
388
  {
389
389
  assert(ret && "RetICFGNode not set?");
390
390
  return ret;
@@ -477,7 +477,7 @@ public:
477
477
  return cs;
478
478
  }
479
479
 
480
- inline const CallICFGNode* getCallBlockNode() const
480
+ inline const CallICFGNode* getCallICFGNode() const
481
481
  {
482
482
  return callBlockNode;
483
483
  }
@@ -397,7 +397,7 @@ protected:
397
397
  inline void addFormalINSVFGNode(const FunEntryICFGNode* funEntry, const MRVer* resVer, const NodeID nodeId)
398
398
  {
399
399
  FormalINSVFGNode* sNode = new FormalINSVFGNode(nodeId, resVer, funEntry);
400
- addSVFGNode(sNode, pag->getICFG()->getFunEntryBlockNode(funEntry->getFun()));
400
+ addSVFGNode(sNode, pag->getICFG()->getFunEntryICFGNode(funEntry->getFun()));
401
401
  setDef(resVer,sNode);
402
402
  funToFormalINMap[funEntry->getFun()].set(sNode->getId());
403
403
  }
@@ -406,7 +406,7 @@ protected:
406
406
  inline void addFormalOUTSVFGNode(const FunExitICFGNode* funExit, const MRVer* ver, const NodeID nodeId)
407
407
  {
408
408
  FormalOUTSVFGNode* sNode = new FormalOUTSVFGNode(nodeId, ver, funExit);
409
- addSVFGNode(sNode,pag->getICFG()->getFunExitBlockNode(funExit->getFun()));
409
+ addSVFGNode(sNode,pag->getICFG()->getFunExitICFGNode(funExit->getFun()));
410
410
  funToFormalOUTMap[funExit->getFun()].set(sNode->getId());
411
411
  }
412
412
 
@@ -414,7 +414,7 @@ protected:
414
414
  inline void addActualINSVFGNode(const CallICFGNode* callsite, const MRVer* ver, const NodeID nodeId)
415
415
  {
416
416
  ActualINSVFGNode* sNode = new ActualINSVFGNode(nodeId, callsite, ver);
417
- addSVFGNode(sNode,pag->getICFG()->getCallBlockNode(callsite->getCallSite()));
417
+ addSVFGNode(sNode,pag->getICFG()->getCallICFGNode(callsite->getCallSite()));
418
418
  callSiteToActualINMap[callsite].set(sNode->getId());
419
419
  }
420
420
 
@@ -422,7 +422,7 @@ protected:
422
422
  inline void addActualOUTSVFGNode(const CallICFGNode* callsite, const MRVer* resVer, const NodeID nodeId)
423
423
  {
424
424
  ActualOUTSVFGNode* sNode = new ActualOUTSVFGNode(nodeId, callsite, resVer);
425
- addSVFGNode(sNode, pag->getICFG()->getRetBlockNode(callsite->getCallSite()));
425
+ addSVFGNode(sNode, pag->getICFG()->getRetICFGNode(callsite->getCallSite()));
426
426
  setDef(resVer,sNode);
427
427
  callSiteToActualOUTMap[callsite].set(sNode->getId());
428
428
  }
@@ -244,7 +244,7 @@ private:
244
244
  inline InterPHISVFGNode* addInterPHIForFP(const FormalParmSVFGNode* fp)
245
245
  {
246
246
  InterPHISVFGNode* sNode = new InterPHISVFGNode(totalVFGNode++,fp);
247
- addSVFGNode(sNode, pag->getICFG()->getFunEntryBlockNode(fp->getFun()));
247
+ addSVFGNode(sNode, pag->getICFG()->getFunEntryICFGNode(fp->getFun()));
248
248
  resetDef(fp->getParam(),sNode);
249
249
  return sNode;
250
250
  }
@@ -252,7 +252,7 @@ private:
252
252
  inline InterPHISVFGNode* addInterPHIForAR(const ActualRetSVFGNode* ar)
253
253
  {
254
254
  InterPHISVFGNode* sNode = new InterPHISVFGNode(totalVFGNode++,ar);
255
- addSVFGNode(sNode, pag->getICFG()->getRetBlockNode(ar->getCallSite()->getCallSite()));
255
+ addSVFGNode(sNode, pag->getICFG()->getRetICFGNode(ar->getCallSite()->getCallSite()));
256
256
  resetDef(ar->getRev(),sNode);
257
257
  return sNode;
258
258
  }
@@ -479,7 +479,7 @@ protected:
479
479
  inline void addNullPtrVFGNode(const PAGNode* pagNode)
480
480
  {
481
481
  NullPtrVFGNode* sNode = new NullPtrVFGNode(totalVFGNode++,pagNode);
482
- addVFGNode(sNode, pag->getICFG()->getGlobalBlockNode());
482
+ addVFGNode(sNode, pag->getICFG()->getGlobalICFGNode());
483
483
  setDef(pagNode,sNode);
484
484
  }
485
485
  /// Add an Address VFG node
@@ -524,7 +524,7 @@ protected:
524
524
  inline void addActualParmVFGNode(const PAGNode* aparm, const CallICFGNode* cs)
525
525
  {
526
526
  ActualParmVFGNode* sNode = new ActualParmVFGNode(totalVFGNode++,aparm,cs);
527
- addVFGNode(sNode, pag->getICFG()->getCallBlockNode(cs->getCallSite()));
527
+ addVFGNode(sNode, pag->getICFG()->getCallICFGNode(cs->getCallSite()));
528
528
  PAGNodeToActualParmMap[std::make_pair(aparm->getId(),cs)] = sNode;
529
529
  /// do not set def here, this node is not a variable definition
530
530
  }
@@ -532,7 +532,7 @@ protected:
532
532
  inline void addFormalParmVFGNode(const PAGNode* fparm, const SVFFunction* fun, CallPESet& callPEs)
533
533
  {
534
534
  FormalParmVFGNode* sNode = new FormalParmVFGNode(totalVFGNode++,fparm,fun);
535
- addVFGNode(sNode, pag->getICFG()->getFunEntryBlockNode(fun));
535
+ addVFGNode(sNode, pag->getICFG()->getFunEntryICFGNode(fun));
536
536
  for(CallPESet::const_iterator it = callPEs.begin(), eit=callPEs.end();
537
537
  it!=eit; ++it)
538
538
  sNode->addCallPE(*it);
@@ -546,7 +546,7 @@ protected:
546
546
  inline void addFormalRetVFGNode(const PAGNode* uniqueFunRet, const SVFFunction* fun, RetPESet& retPEs)
547
547
  {
548
548
  FormalRetVFGNode *sNode = new FormalRetVFGNode(totalVFGNode++, uniqueFunRet, fun);
549
- addVFGNode(sNode, pag->getICFG()->getFunExitBlockNode(fun));
549
+ addVFGNode(sNode, pag->getICFG()->getFunExitICFGNode(fun));
550
550
  for (RetPESet::const_iterator it = retPEs.begin(), eit = retPEs.end(); it != eit; ++it)
551
551
  sNode->addRetPE(*it);
552
552
 
@@ -564,7 +564,7 @@ protected:
564
564
  inline void addActualRetVFGNode(const PAGNode* ret,const CallICFGNode* cs)
565
565
  {
566
566
  ActualRetVFGNode* sNode = new ActualRetVFGNode(totalVFGNode++,ret,cs);
567
- addVFGNode(sNode, pag->getICFG()->getRetBlockNode(cs->getCallSite()));
567
+ addVFGNode(sNode, pag->getICFG()->getRetICFGNode(cs->getCallSite()));
568
568
  setDef(ret,sNode);
569
569
  PAGNodeToActualRetMap[ret] = sNode;
570
570
  }
@@ -35,7 +35,7 @@ public:
35
35
  private:
36
36
  // Get CallICFGNode
37
37
  inline CallICFGNode* getCBN(const Instruction* inst) {
38
- return _la->getTCT()->getCallBlockNode(inst);
38
+ return _la->getTCT()->getCallICFGNode(inst);
39
39
  }
40
40
  const Instruction *getPreviousMemoryAccessInst( const Instruction *I) {
41
41
  I = I->getPrevNode();
@@ -63,7 +63,7 @@ public:
63
63
 
64
64
  // Get CallICFGNode
65
65
  inline CallICFGNode* getCBN(const Instruction* inst) {
66
- return tct->getCallBlockNode(inst);
66
+ return tct->getCallICFGNode(inst);
67
67
  }
68
68
 
69
69
  /// Whether the function is connected from main function in thread call graph
@@ -381,7 +381,7 @@ private:
381
381
  }
382
382
  // Get CallICFGNode
383
383
  inline CallICFGNode* getCBN(const Instruction* inst) {
384
- return tct->getCallBlockNode(inst);
384
+ return tct->getCallICFGNode(inst);
385
385
  }
386
386
  /// Mark thread flags for cxtStmt
387
387
  //@{
@@ -123,8 +123,8 @@ public:
123
123
  {
124
124
  }
125
125
 
126
- CallICFGNode* getCallBlockNode(const Instruction* inst) {
127
- return pta->getICFG()->getCallBlockNode(inst);
126
+ CallICFGNode* getCallICFGNode(const Instruction* inst) {
127
+ return pta->getICFG()->getCallICFGNode(inst);
128
128
  }
129
129
  const SVFFunction* getSVFFun(const Function* fun) const {
130
130
  return LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(fun);
@@ -148,8 +148,8 @@ public:
148
148
  destroy();
149
149
  }
150
150
  /// Get CallICFGNode given inst
151
- CallICFGNode* getCallBlockNode(const Instruction* inst) {
152
- return pta->getICFG()->getCallBlockNode(inst);
151
+ CallICFGNode* getCallICFGNode(const Instruction* inst) {
152
+ return pta->getICFG()->getCallICFGNode(inst);
153
153
  }
154
154
  /// Get SVFFuntion given Function
155
155
  const SVFFunction* getSVFFun(const Function* fun) const {
@@ -493,14 +493,14 @@ private:
493
493
  /// Add function arguments
494
494
  inline void addFunArgs(const SVFFunction* fun, const SVFVar* arg)
495
495
  {
496
- FunEntryICFGNode* funEntryBlockNode = icfg->getFunEntryBlockNode(fun);
496
+ FunEntryICFGNode* funEntryBlockNode = icfg->getFunEntryICFGNode(fun);
497
497
  funEntryBlockNode->addFormalParms(arg);
498
498
  funArgsListMap[fun].push_back(arg);
499
499
  }
500
500
  /// Add function returns
501
501
  inline void addFunRet(const SVFFunction* fun, const SVFVar* ret)
502
502
  {
503
- FunExitICFGNode* funExitBlockNode = icfg->getFunExitBlockNode(fun);
503
+ FunExitICFGNode* funExitBlockNode = icfg->getFunExitICFGNode(fun);
504
504
  funExitBlockNode->addFormalRet(ret);
505
505
  funRetMap[fun] = ret;
506
506
  }
@@ -84,20 +84,20 @@ private:
84
84
  void addICFGInterEdges(const Instruction* cs, const SVFFunction* callee);
85
85
 
86
86
  /// Add a call node
87
- inline CallICFGNode* getOrAddCallICFGNode(const Instruction* cs)
87
+ inline CallICFGNode* getCallICFGNode(const Instruction* cs)
88
88
  {
89
- return icfg->getCallBlockNode(cs);
89
+ return icfg->getCallICFGNode(cs);
90
90
  }
91
91
  /// Add a return node
92
- inline RetICFGNode* getOrAddRetICFGNode(const Instruction* cs)
92
+ inline RetICFGNode* getRetICFGNode(const Instruction* cs)
93
93
  {
94
- return icfg->getRetBlockNode(cs);
94
+ return icfg->getRetICFGNode(cs);
95
95
  }
96
96
 
97
97
  /// Add and get IntraBlock ICFGNode
98
98
  IntraICFGNode* getOrAddIntraBlockICFGNode(const Instruction* inst)
99
99
  {
100
- return icfg->getIntraBlockNode(inst);
100
+ return icfg->getIntraICFGNode(inst);
101
101
  }
102
102
  };
103
103
 
@@ -348,7 +348,7 @@ public:
348
348
  {
349
349
  IntraICFGNode* node;
350
350
  if(const Instruction* inst = SVFUtil::dyn_cast<Instruction>(curVal))
351
- node = pag->getICFG()->getIntraBlockNode(inst);
351
+ node = pag->getICFG()->getIntraICFGNode(inst);
352
352
  else
353
353
  node = nullptr;
354
354
  StoreStmt *edge = pag->addStoreStmt(src, dst, node);
Binary file
@@ -163,19 +163,19 @@ public:
163
163
  /// Get a basic block ICFGNode
164
164
  /// TODO:: need to fix the assertions
165
165
  //@{
166
- ICFGNode* getBlockICFGNode(const Instruction* inst);
166
+ ICFGNode* getICFGNode(const Instruction* inst);
167
167
 
168
- CallICFGNode* getCallBlockNode(const Instruction* inst);
168
+ CallICFGNode* getCallICFGNode(const Instruction* inst);
169
169
 
170
- RetICFGNode* getRetBlockNode(const Instruction* inst);
170
+ RetICFGNode* getRetICFGNode(const Instruction* inst);
171
171
 
172
- IntraICFGNode* getIntraBlockNode(const Instruction* inst);
172
+ IntraICFGNode* getIntraICFGNode(const Instruction* inst);
173
173
 
174
- FunEntryICFGNode* getFunEntryBlockNode(const SVFFunction* fun);
174
+ FunEntryICFGNode* getFunEntryICFGNode(const SVFFunction* fun);
175
175
 
176
- FunExitICFGNode* getFunExitBlockNode(const SVFFunction* fun);
176
+ FunExitICFGNode* getFunExitICFGNode(const SVFFunction* fun);
177
177
 
178
- inline GlobalICFGNode* getGlobalBlockNode() const
178
+ inline GlobalICFGNode* getGlobalICFGNode() const
179
179
  {
180
180
  return globalBlockNode;
181
181
  }
@@ -184,14 +184,14 @@ public:
184
184
  private:
185
185
 
186
186
  /// Get/Add IntraBlock ICFGNode
187
- inline IntraICFGNode* getIntraBlockICFGNode(const Instruction* inst)
187
+ inline IntraICFGNode* getIntraBlock(const Instruction* inst)
188
188
  {
189
189
  InstToBlockNodeMapTy::const_iterator it = InstToBlockNodeMap.find(inst);
190
190
  if (it == InstToBlockNodeMap.end())
191
191
  return nullptr;
192
192
  return it->second;
193
193
  }
194
- inline IntraICFGNode* addIntraBlockICFGNode(const Instruction* inst)
194
+ inline IntraICFGNode* addIntraBlock(const Instruction* inst)
195
195
  {
196
196
  IntraICFGNode* sNode = new IntraICFGNode(totalICFGNode++,inst);
197
197
  addICFGNode(sNode);
@@ -200,14 +200,14 @@ private:
200
200
  }
201
201
 
202
202
  /// Get/Add a function entry node
203
- inline FunEntryICFGNode* getFunEntryICFGNode(const SVFFunction* fun)
203
+ inline FunEntryICFGNode* getFunEntryBlock(const SVFFunction* fun)
204
204
  {
205
205
  FunToFunEntryNodeMapTy::const_iterator it = FunToFunEntryNodeMap.find(fun);
206
206
  if (it == FunToFunEntryNodeMap.end())
207
207
  return nullptr;
208
208
  return it->second;
209
209
  }
210
- inline FunEntryICFGNode* addFunEntryICFGNode(const SVFFunction* fun)
210
+ inline FunEntryICFGNode* addFunEntryBlock(const SVFFunction* fun)
211
211
  {
212
212
  FunEntryICFGNode* sNode = new FunEntryICFGNode(totalICFGNode++,fun);
213
213
  addICFGNode(sNode);
@@ -216,14 +216,14 @@ private:
216
216
  }
217
217
 
218
218
  /// Get/Add a function exit node
219
- inline FunExitICFGNode* getFunExitICFGNode(const SVFFunction* fun)
219
+ inline FunExitICFGNode* getFunExitBlock(const SVFFunction* fun)
220
220
  {
221
221
  FunToFunExitNodeMapTy::const_iterator it = FunToFunExitNodeMap.find(fun);
222
222
  if (it == FunToFunExitNodeMap.end())
223
223
  return nullptr;
224
224
  return it->second;
225
225
  }
226
- inline FunExitICFGNode* addFunExitICFGNode(const SVFFunction* fun)
226
+ inline FunExitICFGNode* addFunExitBlock(const SVFFunction* fun)
227
227
  {
228
228
  FunExitICFGNode* sNode = new FunExitICFGNode(totalICFGNode++, fun);
229
229
  addICFGNode(sNode);
@@ -232,14 +232,14 @@ private:
232
232
  }
233
233
 
234
234
  /// Get/Add a call node
235
- inline CallICFGNode* addCallICFGNode(const Instruction* cs)
235
+ inline CallICFGNode* addCallBlock(const Instruction* cs)
236
236
  {
237
237
  CallICFGNode* sNode = new CallICFGNode(totalICFGNode++, cs);
238
238
  addICFGNode(sNode);
239
239
  CSToCallNodeMap[cs] = sNode;
240
240
  return sNode;
241
241
  }
242
- inline CallICFGNode* getCallICFGNode(const Instruction* cs)
242
+ inline CallICFGNode* getCallBlock(const Instruction* cs)
243
243
  {
244
244
  CSToCallNodeMapTy::const_iterator it = CSToCallNodeMap.find(cs);
245
245
  if (it == CSToCallNodeMap.end())
@@ -248,16 +248,16 @@ private:
248
248
  }
249
249
 
250
250
  /// Get/Add a return node
251
- inline RetICFGNode* getRetICFGNode(const Instruction* cs)
251
+ inline RetICFGNode* getRetBlock(const Instruction* cs)
252
252
  {
253
253
  CSToRetNodeMapTy::const_iterator it = CSToRetNodeMap.find(cs);
254
254
  if (it == CSToRetNodeMap.end())
255
255
  return nullptr;
256
256
  return it->second;
257
257
  }
258
- inline RetICFGNode* addRetICFGNode(const Instruction* cs)
258
+ inline RetICFGNode* addRetBlock(const Instruction* cs)
259
259
  {
260
- CallICFGNode* callBlockNode = getCallBlockNode(cs);
260
+ CallICFGNode* callBlockNode = getCallICFGNode(cs);
261
261
  RetICFGNode* sNode = new RetICFGNode(totalICFGNode++, cs, callBlockNode);
262
262
  callBlockNode->setRetICFGNode(sNode);
263
263
  addICFGNode(sNode);
@@ -384,7 +384,7 @@ public:
384
384
  }
385
385
 
386
386
  /// Return callsite
387
- inline const RetICFGNode* getRetICFGNode() const
387
+ inline const RetICFGNode* getRetBlock() const
388
388
  {
389
389
  assert(ret && "RetICFGNode not set?");
390
390
  return ret;
@@ -477,7 +477,7 @@ public:
477
477
  return cs;
478
478
  }
479
479
 
480
- inline const CallICFGNode* getCallBlockNode() const
480
+ inline const CallICFGNode* getCallICFGNode() const
481
481
  {
482
482
  return callBlockNode;
483
483
  }
@@ -397,7 +397,7 @@ protected:
397
397
  inline void addFormalINSVFGNode(const FunEntryICFGNode* funEntry, const MRVer* resVer, const NodeID nodeId)
398
398
  {
399
399
  FormalINSVFGNode* sNode = new FormalINSVFGNode(nodeId, resVer, funEntry);
400
- addSVFGNode(sNode, pag->getICFG()->getFunEntryBlockNode(funEntry->getFun()));
400
+ addSVFGNode(sNode, pag->getICFG()->getFunEntryICFGNode(funEntry->getFun()));
401
401
  setDef(resVer,sNode);
402
402
  funToFormalINMap[funEntry->getFun()].set(sNode->getId());
403
403
  }
@@ -406,7 +406,7 @@ protected:
406
406
  inline void addFormalOUTSVFGNode(const FunExitICFGNode* funExit, const MRVer* ver, const NodeID nodeId)
407
407
  {
408
408
  FormalOUTSVFGNode* sNode = new FormalOUTSVFGNode(nodeId, ver, funExit);
409
- addSVFGNode(sNode,pag->getICFG()->getFunExitBlockNode(funExit->getFun()));
409
+ addSVFGNode(sNode,pag->getICFG()->getFunExitICFGNode(funExit->getFun()));
410
410
  funToFormalOUTMap[funExit->getFun()].set(sNode->getId());
411
411
  }
412
412
 
@@ -414,7 +414,7 @@ protected:
414
414
  inline void addActualINSVFGNode(const CallICFGNode* callsite, const MRVer* ver, const NodeID nodeId)
415
415
  {
416
416
  ActualINSVFGNode* sNode = new ActualINSVFGNode(nodeId, callsite, ver);
417
- addSVFGNode(sNode,pag->getICFG()->getCallBlockNode(callsite->getCallSite()));
417
+ addSVFGNode(sNode,pag->getICFG()->getCallICFGNode(callsite->getCallSite()));
418
418
  callSiteToActualINMap[callsite].set(sNode->getId());
419
419
  }
420
420
 
@@ -422,7 +422,7 @@ protected:
422
422
  inline void addActualOUTSVFGNode(const CallICFGNode* callsite, const MRVer* resVer, const NodeID nodeId)
423
423
  {
424
424
  ActualOUTSVFGNode* sNode = new ActualOUTSVFGNode(nodeId, callsite, resVer);
425
- addSVFGNode(sNode, pag->getICFG()->getRetBlockNode(callsite->getCallSite()));
425
+ addSVFGNode(sNode, pag->getICFG()->getRetICFGNode(callsite->getCallSite()));
426
426
  setDef(resVer,sNode);
427
427
  callSiteToActualOUTMap[callsite].set(sNode->getId());
428
428
  }
@@ -244,7 +244,7 @@ private:
244
244
  inline InterPHISVFGNode* addInterPHIForFP(const FormalParmSVFGNode* fp)
245
245
  {
246
246
  InterPHISVFGNode* sNode = new InterPHISVFGNode(totalVFGNode++,fp);
247
- addSVFGNode(sNode, pag->getICFG()->getFunEntryBlockNode(fp->getFun()));
247
+ addSVFGNode(sNode, pag->getICFG()->getFunEntryICFGNode(fp->getFun()));
248
248
  resetDef(fp->getParam(),sNode);
249
249
  return sNode;
250
250
  }
@@ -252,7 +252,7 @@ private:
252
252
  inline InterPHISVFGNode* addInterPHIForAR(const ActualRetSVFGNode* ar)
253
253
  {
254
254
  InterPHISVFGNode* sNode = new InterPHISVFGNode(totalVFGNode++,ar);
255
- addSVFGNode(sNode, pag->getICFG()->getRetBlockNode(ar->getCallSite()->getCallSite()));
255
+ addSVFGNode(sNode, pag->getICFG()->getRetICFGNode(ar->getCallSite()->getCallSite()));
256
256
  resetDef(ar->getRev(),sNode);
257
257
  return sNode;
258
258
  }
@@ -479,7 +479,7 @@ protected:
479
479
  inline void addNullPtrVFGNode(const PAGNode* pagNode)
480
480
  {
481
481
  NullPtrVFGNode* sNode = new NullPtrVFGNode(totalVFGNode++,pagNode);
482
- addVFGNode(sNode, pag->getICFG()->getGlobalBlockNode());
482
+ addVFGNode(sNode, pag->getICFG()->getGlobalICFGNode());
483
483
  setDef(pagNode,sNode);
484
484
  }
485
485
  /// Add an Address VFG node
@@ -524,7 +524,7 @@ protected:
524
524
  inline void addActualParmVFGNode(const PAGNode* aparm, const CallICFGNode* cs)
525
525
  {
526
526
  ActualParmVFGNode* sNode = new ActualParmVFGNode(totalVFGNode++,aparm,cs);
527
- addVFGNode(sNode, pag->getICFG()->getCallBlockNode(cs->getCallSite()));
527
+ addVFGNode(sNode, pag->getICFG()->getCallICFGNode(cs->getCallSite()));
528
528
  PAGNodeToActualParmMap[std::make_pair(aparm->getId(),cs)] = sNode;
529
529
  /// do not set def here, this node is not a variable definition
530
530
  }
@@ -532,7 +532,7 @@ protected:
532
532
  inline void addFormalParmVFGNode(const PAGNode* fparm, const SVFFunction* fun, CallPESet& callPEs)
533
533
  {
534
534
  FormalParmVFGNode* sNode = new FormalParmVFGNode(totalVFGNode++,fparm,fun);
535
- addVFGNode(sNode, pag->getICFG()->getFunEntryBlockNode(fun));
535
+ addVFGNode(sNode, pag->getICFG()->getFunEntryICFGNode(fun));
536
536
  for(CallPESet::const_iterator it = callPEs.begin(), eit=callPEs.end();
537
537
  it!=eit; ++it)
538
538
  sNode->addCallPE(*it);
@@ -546,7 +546,7 @@ protected:
546
546
  inline void addFormalRetVFGNode(const PAGNode* uniqueFunRet, const SVFFunction* fun, RetPESet& retPEs)
547
547
  {
548
548
  FormalRetVFGNode *sNode = new FormalRetVFGNode(totalVFGNode++, uniqueFunRet, fun);
549
- addVFGNode(sNode, pag->getICFG()->getFunExitBlockNode(fun));
549
+ addVFGNode(sNode, pag->getICFG()->getFunExitICFGNode(fun));
550
550
  for (RetPESet::const_iterator it = retPEs.begin(), eit = retPEs.end(); it != eit; ++it)
551
551
  sNode->addRetPE(*it);
552
552
 
@@ -564,7 +564,7 @@ protected:
564
564
  inline void addActualRetVFGNode(const PAGNode* ret,const CallICFGNode* cs)
565
565
  {
566
566
  ActualRetVFGNode* sNode = new ActualRetVFGNode(totalVFGNode++,ret,cs);
567
- addVFGNode(sNode, pag->getICFG()->getRetBlockNode(cs->getCallSite()));
567
+ addVFGNode(sNode, pag->getICFG()->getRetICFGNode(cs->getCallSite()));
568
568
  setDef(ret,sNode);
569
569
  PAGNodeToActualRetMap[ret] = sNode;
570
570
  }
@@ -35,7 +35,7 @@ public:
35
35
  private:
36
36
  // Get CallICFGNode
37
37
  inline CallICFGNode* getCBN(const Instruction* inst) {
38
- return _la->getTCT()->getCallBlockNode(inst);
38
+ return _la->getTCT()->getCallICFGNode(inst);
39
39
  }
40
40
  const Instruction *getPreviousMemoryAccessInst( const Instruction *I) {
41
41
  I = I->getPrevNode();
@@ -63,7 +63,7 @@ public:
63
63
 
64
64
  // Get CallICFGNode
65
65
  inline CallICFGNode* getCBN(const Instruction* inst) {
66
- return tct->getCallBlockNode(inst);
66
+ return tct->getCallICFGNode(inst);
67
67
  }
68
68
 
69
69
  /// Whether the function is connected from main function in thread call graph
@@ -381,7 +381,7 @@ private:
381
381
  }
382
382
  // Get CallICFGNode
383
383
  inline CallICFGNode* getCBN(const Instruction* inst) {
384
- return tct->getCallBlockNode(inst);
384
+ return tct->getCallICFGNode(inst);
385
385
  }
386
386
  /// Mark thread flags for cxtStmt
387
387
  //@{
@@ -123,8 +123,8 @@ public:
123
123
  {
124
124
  }
125
125
 
126
- CallICFGNode* getCallBlockNode(const Instruction* inst) {
127
- return pta->getICFG()->getCallBlockNode(inst);
126
+ CallICFGNode* getCallICFGNode(const Instruction* inst) {
127
+ return pta->getICFG()->getCallICFGNode(inst);
128
128
  }
129
129
  const SVFFunction* getSVFFun(const Function* fun) const {
130
130
  return LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(fun);
@@ -148,8 +148,8 @@ public:
148
148
  destroy();
149
149
  }
150
150
  /// Get CallICFGNode given inst
151
- CallICFGNode* getCallBlockNode(const Instruction* inst) {
152
- return pta->getICFG()->getCallBlockNode(inst);
151
+ CallICFGNode* getCallICFGNode(const Instruction* inst) {
152
+ return pta->getICFG()->getCallICFGNode(inst);
153
153
  }
154
154
  /// Get SVFFuntion given Function
155
155
  const SVFFunction* getSVFFun(const Function* fun) const {
@@ -493,14 +493,14 @@ private:
493
493
  /// Add function arguments
494
494
  inline void addFunArgs(const SVFFunction* fun, const SVFVar* arg)
495
495
  {
496
- FunEntryICFGNode* funEntryBlockNode = icfg->getFunEntryBlockNode(fun);
496
+ FunEntryICFGNode* funEntryBlockNode = icfg->getFunEntryICFGNode(fun);
497
497
  funEntryBlockNode->addFormalParms(arg);
498
498
  funArgsListMap[fun].push_back(arg);
499
499
  }
500
500
  /// Add function returns
501
501
  inline void addFunRet(const SVFFunction* fun, const SVFVar* ret)
502
502
  {
503
- FunExitICFGNode* funExitBlockNode = icfg->getFunExitBlockNode(fun);
503
+ FunExitICFGNode* funExitBlockNode = icfg->getFunExitICFGNode(fun);
504
504
  funExitBlockNode->addFormalRet(ret);
505
505
  funRetMap[fun] = ret;
506
506
  }
@@ -437,12 +437,20 @@ public:
437
437
  assert(isVariantFieldGep()==false && "Can't retrieve the LocationSet if using a variable field index (pointer arithmetic) for struct field access ");
438
438
  return ls;
439
439
  }
440
-
440
+ inline const LocationSet::OffsetValueVec& getOffsetValueVec() const
441
+ {
442
+ return getLocationSet().getOffsetValueVec();
443
+ }
444
+ /// Return TRUE if this is a constant location set.
445
+ inline bool isConstantOffset() const{
446
+ return getLocationSet().isConstantOffset();
447
+ }
448
+ /// Return accumulated constant offset (when accessing array or struct) if this offset is a constant.
441
449
  inline s64_t accumulateConstantOffset() const
442
450
  {
443
- return ls.accumulateConstantOffset();
451
+ return getLocationSet().accumulateConstantOffset();
444
452
  }
445
- /// offset of the gep statement
453
+ /// Field index of the gep statement if it access the field of a struct
446
454
  inline s64_t getConstantFieldIdx() const
447
455
  {
448
456
  return getLocationSet().accumulateConstantFieldIdx();
@@ -344,18 +344,7 @@ public:
344
344
  /// Get struct info
345
345
  //@{
346
346
  ///Get an iterator for StructInfo, designed as internal methods
347
- TypeToFieldInfoMap::iterator getStructInfoIter(const Type *T)
348
- {
349
- assert(T);
350
- TypeToFieldInfoMap::iterator it = typeToFieldInfo.find(T);
351
- if (it != typeToFieldInfo.end())
352
- return it;
353
- else
354
- {
355
- collectTypeInfo(T);
356
- return typeToFieldInfo.find(T);
357
- }
358
- }
347
+ TypeToFieldInfoMap::iterator getStructInfoIter(const Type *T);
359
348
 
360
349
  ///Get a reference to StructInfo.
361
350
  inline StInfo* getStructInfo(const Type *T)
@@ -364,8 +353,12 @@ public:
364
353
  }
365
354
 
366
355
  ///Get a reference to the components of struct_info.
367
- /// Flatterned full offset information of a struct including its array fields
368
- const std::vector<u32_t>& getFlattenedOffsetVec(const StructType *T);
356
+ /// Number of flattenned elements of an array or struct
357
+ const u32_t getNumOfFlattenElements(const Type *T);
358
+ /// Number of flattenned fields of a struct
359
+ const u32_t getNumOfFlattenFields(const StructType *T);
360
+ /// Flatterned element idx of an array or struct by considering stride
361
+ const std::vector<u32_t>& getFlattenedElemIdxVec(const Type *T);
369
362
  /// Flatterned field index information of a struct ignoring any array field
370
363
  const std::vector<u32_t>& getFlattenedFieldIdxVec(const StructType *T);
371
364
 
@@ -513,14 +506,18 @@ class StInfo
513
506
  private:
514
507
  /// flattened field indices of a struct (ignoring arrays)
515
508
  std::vector<u32_t> fldIdxVec;
516
- /// flattened full offset (including array strides)
517
- std::vector<u32_t> fullOffsetVec;
509
+ /// flattened element indices including structs and arrays by considering strides
510
+ std::vector<u32_t> elemIdxVec;
518
511
  /// Types of all fields of a struct
519
512
  Map<u32_t, const Type*> fldIdx2TypeMap;
520
513
  /// All field infos after flattening a struct
521
514
  std::vector<FlattenedFieldInfo> finfo;
522
515
  /// stride represents the number of repetitive elements if this StInfo represent an ArrayType. stride is 1 by default.
523
516
  u32_t stride;
517
+ /// number of elements after flattenning (including array elements)
518
+ u32_t numOfFlattenElements;
519
+ /// number of fields after flattenning (ignoring array elements)
520
+ u32_t numOfFlattenFields;
524
521
  /// Max field limit
525
522
  static u32_t maxFieldLimit;
526
523
 
@@ -530,7 +527,7 @@ private:
530
527
 
531
528
  public:
532
529
  /// Constructor
533
- StInfo(u32_t s) : stride(s)
530
+ StInfo(u32_t s) : stride(s), numOfFlattenElements(s), numOfFlattenFields(s)
534
531
  {
535
532
  }
536
533
  /// Destructor
@@ -552,28 +549,16 @@ public:
552
549
  /// OriginalFieldType of b with field_idx 1 : Struct A
553
550
  /// FlatternedFieldType of b with field_idx 1 : int
554
551
  //{@
555
- inline const Type* getOriginalFieldType(u32_t fldIdx)
556
- {
557
- Map<u32_t, const Type*>::const_iterator it = fldIdx2TypeMap.find(fldIdx);
558
- if(it!=fldIdx2TypeMap.end())
559
- return it->second;
560
- return nullptr;
561
- }
562
- inline const Type* getFlatternedFieldType(u32_t fldIdx)
563
- {
564
- for(FlattenedFieldInfo& fallenedFld : finfo){
565
- if(fallenedFld.getFlattenFldIdx() == fldIdx)
566
- return fallenedFld.getFlattenElemTy();
567
- }
568
- return nullptr;
569
- }
552
+ const Type* getOriginalFieldType(u32_t fldIdx);
553
+ const Type* getFlatternedFieldType(u32_t fldIdx);
554
+
570
555
  inline std::vector<u32_t>& getFlattenedFieldIdxVec()
571
556
  {
572
557
  return fldIdxVec;
573
558
  }
574
- inline std::vector<u32_t>& getFlattenedOffsetVec()
559
+ inline std::vector<u32_t>& getFlattenedElemIdxVec()
575
560
  {
576
- return fullOffsetVec;
561
+ return elemIdxVec;
577
562
  }
578
563
  inline std::vector<FlattenedFieldInfo>& getFlattenedFieldInfoVec()
579
564
  {
@@ -581,16 +566,27 @@ public:
581
566
  }
582
567
  //@}
583
568
 
584
- /// Add field (index and offset) with its corresponding type
585
- inline void addFldWithType(u32_t fldIdx, const Type* type, u32_t fullOffset)
569
+ /// Add field index and element index and their corresponding type
570
+ void addFldWithType(u32_t fldIdx, const Type* type, u32_t elemIdx);
571
+
572
+ /// Set number of fields and elements of an aggrate
573
+ inline void setNumOfFieldsAndElems(u32_t nf, u32_t ne)
586
574
  {
587
- fldIdxVec.push_back(fldIdx);
588
- fullOffsetVec.push_back(fullOffset);
589
- fldIdx2TypeMap[fldIdx] = type;
575
+ numOfFlattenFields = nf;
576
+ numOfFlattenElements = ne;
590
577
  }
591
578
 
592
- /// Array Type can have
593
- inline u32_t getStride() const {
579
+ /// Return number of elements after flattenning (including array elements)
580
+ inline u32_t getNumOfFlattenElements() const {
581
+ return numOfFlattenElements;
582
+ }
583
+
584
+ /// Return the number of fields after flattenning (ignoring array elements)
585
+ inline u32_t getNumOfFlattenFields() const {
586
+ return numOfFlattenFields;
587
+ }
588
+ /// Return the stride
589
+ inline u32_t getStride() const{
594
590
  return stride;
595
591
  }
596
592
  };
@@ -84,20 +84,20 @@ private:
84
84
  void addICFGInterEdges(const Instruction* cs, const SVFFunction* callee);
85
85
 
86
86
  /// Add a call node
87
- inline CallICFGNode* getOrAddCallICFGNode(const Instruction* cs)
87
+ inline CallICFGNode* getCallICFGNode(const Instruction* cs)
88
88
  {
89
- return icfg->getCallBlockNode(cs);
89
+ return icfg->getCallICFGNode(cs);
90
90
  }
91
91
  /// Add a return node
92
- inline RetICFGNode* getOrAddRetICFGNode(const Instruction* cs)
92
+ inline RetICFGNode* getRetICFGNode(const Instruction* cs)
93
93
  {
94
- return icfg->getRetBlockNode(cs);
94
+ return icfg->getRetICFGNode(cs);
95
95
  }
96
96
 
97
97
  /// Add and get IntraBlock ICFGNode
98
98
  IntraICFGNode* getOrAddIntraBlockICFGNode(const Instruction* inst)
99
99
  {
100
- return icfg->getIntraBlockNode(inst);
100
+ return icfg->getIntraICFGNode(inst);
101
101
  }
102
102
  };
103
103
 
@@ -348,7 +348,7 @@ public:
348
348
  {
349
349
  IntraICFGNode* node;
350
350
  if(const Instruction* inst = SVFUtil::dyn_cast<Instruction>(curVal))
351
- node = pag->getICFG()->getIntraBlockNode(inst);
351
+ node = pag->getICFG()->getIntraICFGNode(inst);
352
352
  else
353
353
  node = nullptr;
354
354
  StoreStmt *edge = pag->addStoreStmt(src, dst, node);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.816",
3
+ "version": "1.0.820",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {