svf-lib 1.0.2090 → 1.0.2092

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
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -169,14 +169,8 @@ void dumpPointsToList(const PointsToList& ptl);
169
169
  /// Return true if it is an llvm intrinsic instruction
170
170
  bool isIntrinsicInst(const SVFInstruction* inst);
171
171
  bool isIntrinsicInst(const ICFGNode* inst);
172
-
173
172
  //@}
174
173
 
175
- /// Whether an instruction is a call or invoke instruction
176
- inline bool isCallSite(const SVFInstruction* inst)
177
- {
178
- return SVFUtil::isa<SVFCallInst>(inst);
179
- }
180
174
  /// Whether an instruction is a call or invoke instruction
181
175
  inline bool isCallSite(const SVFValue* val)
182
176
  {
@@ -207,31 +201,15 @@ inline bool isNonInstricCallSite(const ICFGNode* inst)
207
201
  }
208
202
 
209
203
 
210
-
211
204
  /// Return callsite given an instruction
212
205
  CallSite getSVFCallSite(const ICFGNode* inst);
213
206
 
214
- /// Return callsite given an instruction
215
- inline CallSite getSVFCallSite(const SVFInstruction* inst)
216
- {
217
- assert(isCallSite(inst) && "not a callsite?");
218
- CallSite cs(inst);
219
- return cs;
220
- }
221
207
 
222
208
  /// Match arguments for callsite at caller and callee
223
209
  /// if the arg size does not match then we do not need to connect this parameter
224
210
  /// unless the callee is a variadic function (the first parameter of variadic function is its parameter number)
225
- bool matchArgs(const CallSite cs, const SVFFunction* callee);
211
+ bool matchArgs(const CallICFGNode* cs, const SVFFunction* callee);
226
212
 
227
- /// Return LLVM callsite given a value
228
- inline CallSite getSVFCallSite(const SVFValue* value)
229
- {
230
- assert(isCallSite(value) && "not a callsite?");
231
- const SVFCallInst* svfInst = SVFUtil::cast<SVFCallInst>(value);
232
- CallSite cs(svfInst);
233
- return cs;
234
- }
235
213
 
236
214
  /// Split into two substrings around the first occurrence of a separator string.
237
215
  inline std::vector<std::string> split(const std::string& s, char separator)
@@ -423,7 +401,7 @@ inline bool isArgOfUncalledFunction(const SVFValue* svfval)
423
401
 
424
402
  /// Return thread fork function
425
403
  //@{
426
- inline const SVFValue* getForkedFun(const SVFInstruction *inst)
404
+ inline const SVFValue* getForkedFun(const ICFGNode *inst)
427
405
  {
428
406
  return ThreadAPI::getThreadAPI()->getForkedFun(inst);
429
407
  }
@@ -488,7 +466,7 @@ inline bool isReallocExtCall(const CallSite cs)
488
466
 
489
467
  /// Return true if this is a thread creation call
490
468
  ///@{
491
- inline bool isThreadForkCall(const SVFInstruction *inst)
469
+ inline bool isThreadForkCall(const ICFGNode *inst)
492
470
  {
493
471
  return ThreadAPI::getThreadAPI()->isTDFork(inst);
494
472
  }
@@ -496,49 +474,49 @@ inline bool isThreadForkCall(const SVFInstruction *inst)
496
474
 
497
475
  /// Return true if this is a thread join call
498
476
  ///@{
499
- inline bool isThreadJoinCall(const CallSite cs)
477
+ inline bool isThreadJoinCall(const ICFGNode* cs)
500
478
  {
501
- return ThreadAPI::getThreadAPI()->isTDJoin(cs.getInstruction());
479
+ return ThreadAPI::getThreadAPI()->isTDJoin(cs);
502
480
  }
503
481
  //@}
504
482
 
505
483
  /// Return true if this is a thread exit call
506
484
  ///@{
507
- inline bool isThreadExitCall(const CallSite cs)
485
+ inline bool isThreadExitCall(const ICFGNode* cs)
508
486
  {
509
- return ThreadAPI::getThreadAPI()->isTDExit(cs.getInstruction());
487
+ return ThreadAPI::getThreadAPI()->isTDExit(cs);
510
488
  }
511
489
  //@}
512
490
 
513
491
  /// Return true if this is a lock acquire call
514
492
  ///@{
515
- inline bool isLockAquireCall(const CallSite cs)
493
+ inline bool isLockAquireCall(const ICFGNode* cs)
516
494
  {
517
- return ThreadAPI::getThreadAPI()->isTDAcquire(cs.getInstruction());
495
+ return ThreadAPI::getThreadAPI()->isTDAcquire(cs);
518
496
  }
519
497
  //@}
520
498
 
521
499
  /// Return true if this is a lock acquire call
522
500
  ///@{
523
- inline bool isLockReleaseCall(const CallSite cs)
501
+ inline bool isLockReleaseCall(const ICFGNode* cs)
524
502
  {
525
- return ThreadAPI::getThreadAPI()->isTDRelease(cs.getInstruction());
503
+ return ThreadAPI::getThreadAPI()->isTDRelease(cs);
526
504
  }
527
505
  //@}
528
506
 
529
507
  /// Return true if this is a barrier wait call
530
508
  //@{
531
- inline bool isBarrierWaitCall(const CallSite cs)
509
+ inline bool isBarrierWaitCall(const ICFGNode* cs)
532
510
  {
533
- return ThreadAPI::getThreadAPI()->isTDBarWait(cs.getInstruction());
511
+ return ThreadAPI::getThreadAPI()->isTDBarWait(cs);
534
512
  }
535
513
  //@}
536
514
 
537
515
  /// Return sole argument of the thread routine
538
516
  //@{
539
- inline const SVFValue* getActualParmAtForkSite(const CallSite cs)
517
+ inline const SVFValue* getActualParmAtForkSite(const ICFGNode* cs)
540
518
  {
541
- return ThreadAPI::getThreadAPI()->getActualParmAtForkSite(cs.getInstruction());
519
+ return ThreadAPI::getThreadAPI()->getActualParmAtForkSite(cs);
542
520
  }
543
521
  //@}
544
522
 
@@ -37,6 +37,7 @@ namespace SVF
37
37
 
38
38
  class SVFModule;
39
39
  class ICFGNode;
40
+ class CallICFGNode;
40
41
 
41
42
  /*
42
43
  * ThreadAPI class contains interfaces for pthread programs
@@ -121,8 +122,6 @@ public:
121
122
  /// Return the callee/callsite/func
122
123
  //@{
123
124
  const SVFFunction* getCallee(const ICFGNode *inst) const;
124
- const SVFFunction* getCallee(const SVFInstruction *inst) const;
125
- const CallSite getSVFCallSite(const SVFInstruction *inst) const;
126
125
  const CallSite getSVFCallSite(const ICFGNode *inst) const;
127
126
  //@}
128
127
 
@@ -132,10 +131,6 @@ public:
132
131
  {
133
132
  return getType(getCallee(inst)) == TD_FORK;
134
133
  }
135
- inline bool isTDFork(const SVFInstruction* cs) const
136
- {
137
- return getType(getCallee(cs)) == TD_FORK;
138
- }
139
134
  //@}
140
135
 
141
136
  /// Return arguments/attributes of pthread_create / hare_parallel_for
@@ -148,13 +143,6 @@ public:
148
143
  CallSite cs = getSVFCallSite(inst);
149
144
  return cs.getArgument(0);
150
145
  }
151
- inline const SVFValue* getForkedThread(const SVFInstruction* inst) const
152
- {
153
- assert(isTDFork(inst) && "not a thread fork function!");
154
- CallSite cs = getSVFCallSite(inst);
155
- return cs.getArgument(0);
156
- }
157
-
158
146
  /// Return the third argument of the call,
159
147
  /// Note that, it could be function type or a void* pointer
160
148
  inline const SVFValue* getForkedFun(const ICFGNode *inst) const
@@ -163,12 +151,6 @@ public:
163
151
  CallSite cs = getSVFCallSite(inst);
164
152
  return cs.getArgument(2);
165
153
  }
166
- inline const SVFValue* getForkedFun(const SVFInstruction* inst) const
167
- {
168
- assert(isTDFork(inst) && "not a thread fork function!");
169
- CallSite cs = getSVFCallSite(inst);
170
- return cs.getArgument(2);
171
- }
172
154
 
173
155
  /// Return the forth argument of the call,
174
156
  /// Note that, it is the sole argument of start routine ( a void* pointer )
@@ -178,12 +160,6 @@ public:
178
160
  CallSite cs = getSVFCallSite(inst);
179
161
  return cs.getArgument(3);
180
162
  }
181
- inline const SVFValue* getActualParmAtForkSite(const SVFInstruction* inst) const
182
- {
183
- assert(isTDFork(inst) && "not a thread fork function!");
184
- CallSite cs = getSVFCallSite(inst);
185
- return cs.getArgument(3);
186
- }
187
163
  //@}
188
164
 
189
165
  /// Return true if this call wait for a worker thread
@@ -192,10 +168,6 @@ public:
192
168
  {
193
169
  return getType(getCallee(inst)) == TD_JOIN;
194
170
  }
195
- inline bool isTDJoin(const SVFInstruction* inst) const
196
- {
197
- return getType(getCallee(inst)) == TD_JOIN;
198
- }
199
171
  //@}
200
172
 
201
173
  /// Return arguments/attributes of pthread_join
@@ -211,12 +183,6 @@ public:
211
183
  CallSite cs = getSVFCallSite(inst);
212
184
  return cs.getArgument(1);
213
185
  }
214
- inline const SVFValue* getRetParmAtJoinedSite(const SVFInstruction* inst) const
215
- {
216
- assert(isTDJoin(inst) && "not a thread join function!");
217
- CallSite cs = getSVFCallSite(inst);
218
- return cs.getArgument(1);
219
- }
220
186
  //@}
221
187
 
222
188
 
@@ -226,11 +192,6 @@ public:
226
192
  {
227
193
  return getType(getCallee(inst)) == TD_EXIT;
228
194
  }
229
-
230
- inline bool isTDExit(const SVFInstruction* inst) const
231
- {
232
- return getType(getCallee(inst)) == TD_EXIT;
233
- }
234
195
  //@}
235
196
 
236
197
  /// Return true if this call acquire a lock
@@ -239,11 +200,6 @@ public:
239
200
  {
240
201
  return getType(getCallee(inst)) == TD_ACQUIRE;
241
202
  }
242
-
243
- inline bool isTDAcquire(const SVFInstruction* inst) const
244
- {
245
- return getType(getCallee(inst)) == TD_ACQUIRE;
246
- }
247
203
  //@}
248
204
 
249
205
  /// Return true if this call release a lock
@@ -252,11 +208,6 @@ public:
252
208
  {
253
209
  return getType(getCallee(inst)) == TD_RELEASE;
254
210
  }
255
-
256
- inline bool isTDRelease(const SVFInstruction* inst) const
257
- {
258
- return getType(getCallee(inst)) == TD_RELEASE;
259
- }
260
211
  //@}
261
212
 
262
213
  /// Return lock value
@@ -271,11 +222,6 @@ public:
271
222
  {
272
223
  return getType(getCallee(inst)) == TD_BAR_WAIT;
273
224
  }
274
-
275
- inline bool isTDBarWait(const SVFInstruction* inst) const
276
- {
277
- return getType(getCallee(inst)) == TD_BAR_WAIT;
278
- }
279
225
  //@}
280
226
 
281
227
  void performAPIStat(SVFModule* m);
Binary file
@@ -358,7 +358,7 @@ protected:
358
358
 
359
359
  protected:
360
360
  // there data should be shared with subclasses
361
- Map<std::string, std::function<void(const CallSite &)>> func_map;
361
+ Map<std::string, std::function<void(const CallICFGNode*)>> func_map;
362
362
  Set<const CallICFGNode*> checkpoints;
363
363
  Set<std::string> checkpoint_names;
364
364
  Map<const ICFGNode*, AbstractState>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.2090",
3
+ "version": "1.0.2092",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {