svf-tools 1.0.978 → 1.0.979

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.978",
3
+ "version": "1.0.979",
4
4
  "description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -61,7 +61,7 @@ protected:
61
61
  bool fromFile; ///< Whether the SVFIR is built according to user specified data from a txt file
62
62
  NodeID nodeNumAfterPAGBuild; ///< initial node number after building SVFIR, excluding later added nodes, e.g., gepobj nodes
63
63
  u32_t totalPTAPAGEdge;
64
- ValueToEdgeMap valueToEdgeMap; ///< Map SVFValues (e.g., SVFInstruction) to all corresponding PAGEdges
64
+ ValueToEdgeMap valueToEdgeMap; ///< Map SVFValues (e.g., ICFGNodes) to all corresponding PAGEdges
65
65
  SymbolTableInfo* symInfo;
66
66
 
67
67
  /// Add a node into the graph
@@ -163,8 +163,6 @@ class ThreadCallGraph: public CallGraph
163
163
  public:
164
164
  typedef Set<const CallICFGNode*> InstSet;
165
165
  typedef InstSet CallSiteSet;
166
- typedef std::vector<const SVFInstruction*> InstVector;
167
- typedef Map<const SVFInstruction*, InstSet> CallToInstMap;
168
166
  typedef Set<CallSiteSet*> CtxSet;
169
167
  typedef ThreadForkEdge::ForkEdgeSet ForkEdgeSet;
170
168
  typedef Map<const CallICFGNode*, ForkEdgeSet> CallInstToForkEdgesMap;
@@ -47,8 +47,6 @@ class MHP
47
47
 
48
48
  public:
49
49
  typedef Set<const SVFFunction*> FunSet;
50
- typedef Set<const SVFInstruction*> InstSet;
51
- typedef std::vector<const SVFInstruction*> InstVec;
52
50
  typedef FIFOWorkList<CxtThreadStmt> CxtThreadStmtWorkList;
53
51
  typedef Set<CxtThreadStmt> CxtThreadStmtSet;
54
52
  typedef Map<CxtThreadStmt,NodeBS> ThreadStmtToThreadInterleav;
@@ -57,9 +57,6 @@ class MTA
57
57
  {
58
58
 
59
59
  public:
60
- typedef Set<const SVFInstruction*> LoadSet;
61
- typedef Set<const SVFInstruction*> StoreSet;
62
-
63
60
  /// Constructor
64
61
  MTA();
65
62
 
@@ -101,13 +101,9 @@ public:
101
101
  {
102
102
  return getType(fun) == CK_ALLOC;
103
103
  }
104
- inline bool isMemAlloc(const SVFInstruction* inst) const
105
- {
106
- return getType(SVFUtil::getCallee(inst)) == CK_ALLOC;
107
- }
108
104
  inline bool isMemAlloc(const CallICFGNode* cs) const
109
105
  {
110
- return isMemAlloc(cs->getCallSite());
106
+ return isMemAlloc(SVFUtil::getCallee(cs->getCallSite()));
111
107
  }
112
108
  //@}
113
109
 
@@ -117,13 +113,9 @@ public:
117
113
  {
118
114
  return getType(fun) == CK_FREE;
119
115
  }
120
- inline bool isMemDealloc(const SVFInstruction *inst) const
121
- {
122
- return getType(SVFUtil::getCallee(inst)) == CK_FREE;
123
- }
124
116
  inline bool isMemDealloc(const CallICFGNode* cs) const
125
117
  {
126
- return isMemDealloc(cs->getCallSite());
118
+ return isMemDealloc(SVFUtil::getCallee(cs->getCallSite()));
127
119
  }
128
120
  //@}
129
121
 
@@ -133,13 +125,9 @@ public:
133
125
  {
134
126
  return getType(fun) == CK_FOPEN;
135
127
  }
136
- inline bool isFOpen(const SVFInstruction* inst) const
137
- {
138
- return getType(SVFUtil::getCallee(inst)) == CK_FOPEN;
139
- }
140
128
  inline bool isFOpen(const CallICFGNode* cs) const
141
129
  {
142
- return isFOpen(cs->getCallSite());
130
+ return isFOpen(SVFUtil::getCallee(cs->getCallSite()));
143
131
  }
144
132
  //@}
145
133
 
@@ -149,13 +137,9 @@ public:
149
137
  {
150
138
  return getType(fun) == CK_FCLOSE;
151
139
  }
152
- inline bool isFClose(const SVFInstruction* inst) const
153
- {
154
- return getType(SVFUtil::getCallee(inst)) == CK_FCLOSE;
155
- }
156
140
  inline bool isFClose(const CallICFGNode* cs) const
157
141
  {
158
- return isFClose(cs->getCallSite());
142
+ return isFClose(SVFUtil::getCallee(cs->getCallSite()));
159
143
  }
160
144
  //@}
161
145
 
@@ -203,7 +203,7 @@ inline CallSite getSVFCallSite(const SVFInstruction* inst)
203
203
  /// Match arguments for callsite at caller and callee
204
204
  /// if the arg size does not match then we do not need to connect this parameter
205
205
  /// unless the callee is a variadic function (the first parameter of variadic function is its parameter number)
206
- bool matchArgs(const SVFInstruction* cs, const SVFFunction* callee);
206
+ bool matchArgs(const CallSite cs, const SVFFunction* callee);
207
207
 
208
208
  /// Return LLVM callsite given a value
209
209
  inline CallSite getSVFCallSite(const SVFValue* value)
@@ -466,11 +466,6 @@ inline int getHeapAllocHoldingArgPosition(const CallSite cs)
466
466
  {
467
467
  return getHeapAllocHoldingArgPosition(getCallee(cs));
468
468
  }
469
-
470
- inline int getHeapAllocHoldingArgPosition(const SVFInstruction *inst)
471
- {
472
- return getHeapAllocHoldingArgPosition(getCallee(inst));
473
- }
474
469
  //@}
475
470
 
476
471
  inline bool isReallocExtCall(const CallSite cs)
@@ -478,12 +473,6 @@ inline bool isReallocExtCall(const CallSite cs)
478
473
  bool isPtrTy = cs.getInstruction()->getType()->isPointerTy();
479
474
  return isPtrTy && isReallocExtFun(getCallee(cs));
480
475
  }
481
-
482
- inline bool isReallocExtCall(const SVFInstruction *inst)
483
- {
484
- bool isPtrTy = inst->getType()->isPointerTy();
485
- return isPtrTy && isReallocExtFun(getCallee(inst));
486
- }
487
476
  //@}
488
477
 
489
478
  /// Return true if this is a thread creation call
@@ -504,10 +493,6 @@ inline bool isThreadJoinCall(const CallSite cs)
504
493
  {
505
494
  return ThreadAPI::getThreadAPI()->isTDJoin(cs.getInstruction());
506
495
  }
507
- inline bool isThreadJoinCall(const SVFInstruction *inst)
508
- {
509
- return ThreadAPI::getThreadAPI()->isTDJoin(inst);
510
- }
511
496
  //@}
512
497
 
513
498
  /// Return true if this is a thread exit call
@@ -516,10 +501,6 @@ inline bool isThreadExitCall(const CallSite cs)
516
501
  {
517
502
  return ThreadAPI::getThreadAPI()->isTDExit(cs.getInstruction());
518
503
  }
519
- inline bool isThreadExitCall(const SVFInstruction *inst)
520
- {
521
- return ThreadAPI::getThreadAPI()->isTDExit(inst);
522
- }
523
504
  //@}
524
505
 
525
506
  /// Return true if this is a lock acquire call
@@ -528,10 +509,6 @@ inline bool isLockAquireCall(const CallSite cs)
528
509
  {
529
510
  return ThreadAPI::getThreadAPI()->isTDAcquire(cs.getInstruction());
530
511
  }
531
- inline bool isLockAquireCall(const SVFInstruction *inst)
532
- {
533
- return ThreadAPI::getThreadAPI()->isTDAcquire(inst);
534
- }
535
512
  //@}
536
513
 
537
514
  /// Return true if this is a lock acquire call
@@ -540,10 +517,6 @@ inline bool isLockReleaseCall(const CallSite cs)
540
517
  {
541
518
  return ThreadAPI::getThreadAPI()->isTDRelease(cs.getInstruction());
542
519
  }
543
- inline bool isLockReleaseCall(const SVFInstruction *inst)
544
- {
545
- return ThreadAPI::getThreadAPI()->isTDRelease(inst);
546
- }
547
520
  //@}
548
521
 
549
522
  /// Return true if this is a barrier wait call
@@ -552,10 +525,6 @@ inline bool isBarrierWaitCall(const CallSite cs)
552
525
  {
553
526
  return ThreadAPI::getThreadAPI()->isTDBarWait(cs.getInstruction());
554
527
  }
555
- inline bool isBarrierWaitCall(const SVFInstruction *inst)
556
- {
557
- return ThreadAPI::getThreadAPI()->isTDBarWait(inst);
558
- }
559
528
  //@}
560
529
 
561
530
  /// Return sole argument of the thread routine
@@ -564,10 +533,6 @@ inline const SVFValue* getActualParmAtForkSite(const CallSite cs)
564
533
  {
565
534
  return ThreadAPI::getThreadAPI()->getActualParmAtForkSite(cs.getInstruction());
566
535
  }
567
- inline const SVFValue* getActualParmAtForkSite(const SVFInstruction *inst)
568
- {
569
- return ThreadAPI::getThreadAPI()->getActualParmAtForkSite(inst);
570
- }
571
536
  //@}
572
537
 
573
538
 
@@ -576,10 +541,6 @@ inline bool isProgExitCall(const CallSite cs)
576
541
  return isProgExitFunction(getCallee(cs));
577
542
  }
578
543
 
579
- inline bool isProgExitCall(const SVFInstruction *inst)
580
- {
581
- return isProgExitFunction(getCallee(inst));
582
- }
583
544
 
584
545
  template<typename T>
585
546
  constexpr typename std::remove_reference<T>::type &&
@@ -429,7 +429,7 @@ void SaberCondAllocator::collectBBCallingProgExit(const SVFBasicBlock &bb)
429
429
  {
430
430
  const SVFInstruction* svfInst = *it;
431
431
  if (SVFUtil::isCallSite(svfInst))
432
- if (SVFUtil::isProgExitCall(svfInst))
432
+ if (SVFUtil::isProgExitCall(SVFUtil::getSVFCallSite(svfInst)))
433
433
  {
434
434
  const SVFFunction* svfun = bb.getParent();
435
435
  funToExitBBsMap[svfun].insert(&bb);
@@ -317,10 +317,10 @@ void SVFUtil::stopAnalysisLimitTimer(bool limitTimerSet)
317
317
  /// unless the callee is a variadic function (the first parameter of variadic function is its parameter number)
318
318
  /// e.g., void variadicFoo(int num, ...); variadicFoo(5, 1,2,3,4,5)
319
319
  /// for variadic function, callsite arg size must be greater than or equal to callee arg size
320
- bool SVFUtil::matchArgs(const SVFInstruction* cs, const SVFFunction* callee)
320
+ bool SVFUtil::matchArgs(const CallSite cs, const SVFFunction* callee)
321
321
  {
322
- if (callee->isVarArg() || ThreadAPI::getThreadAPI()->isTDFork(cs))
323
- return getSVFCallSite(cs).arg_size() >= callee->arg_size();
322
+ if (callee->isVarArg() || ThreadAPI::getThreadAPI()->isTDFork(cs.getInstruction()))
323
+ return cs.arg_size() >= callee->arg_size();
324
324
  else
325
- return getSVFCallSite(cs).arg_size() == callee->arg_size();
325
+ return cs.arg_size() == callee->arg_size();
326
326
  }