svf-lib 1.0.1311 → 1.0.1312

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.
@@ -177,10 +177,9 @@ protected:
177
177
  {
178
178
  handleAddr(pts,dpm,SVFUtil::cast<AddrSVFGNode>(node));
179
179
  }
180
- else if(SVFUtil::isa<CopySVFGNode>(node) || SVFUtil::isa<PHISVFGNode>(node)
181
- || SVFUtil::isa<ActualParmSVFGNode>(node) || SVFUtil::isa<FormalParmSVFGNode>(node)
182
- || SVFUtil::isa<ActualRetSVFGNode>(node) || SVFUtil::isa<FormalRetSVFGNode>(node)
183
- || SVFUtil::isa<NullPtrSVFGNode>(node))
180
+ else if (SVFUtil::isa<CopySVFGNode, PHISVFGNode, ActualParmSVFGNode,
181
+ FormalParmSVFGNode, ActualRetSVFGNode,
182
+ FormalRetSVFGNode, NullPtrSVFGNode>(node))
184
183
  {
185
184
  backtraceAlongDirectVF(pts,dpm);
186
185
  }
@@ -579,10 +578,7 @@ protected:
579
578
  /// Whether this is a top-level pointer statement
580
579
  inline bool isTopLevelPtrStmt(const SVFGNode* stmt)
581
580
  {
582
- if (SVFUtil::isa<StoreSVFGNode>(stmt) || SVFUtil::isa<MRSVFGNode>(stmt))
583
- return false;
584
- else
585
- return true;
581
+ return !SVFUtil::isa<StoreSVFGNode, MRSVFGNode>(stmt);
586
582
  }
587
583
  /// Return dpm with old context and path conditions
588
584
  virtual inline DPIm getDPImWithOldCond(const DPIm& oldDpm,const CVar& var, const SVFGNode* loc)
@@ -230,8 +230,8 @@ private:
230
230
  /// Return TRUE if both edges are indirect call/ret edges.
231
231
  inline bool bothInterEdges(const SVFGEdge* edge1, const SVFGEdge* edge2) const
232
232
  {
233
- bool inter1 = (SVFUtil::isa<CallIndSVFGEdge>(edge1) || SVFUtil::isa<RetIndSVFGEdge>(edge1));
234
- bool inter2 = (SVFUtil::isa<CallIndSVFGEdge>(edge2) || SVFUtil::isa<RetIndSVFGEdge>(edge2));
233
+ bool inter1 = SVFUtil::isa<CallIndSVFGEdge, RetIndSVFGEdge>(edge1);
234
+ bool inter2 = SVFUtil::isa<CallIndSVFGEdge, RetIndSVFGEdge>(edge2);
235
235
  return (inter1 && inter2);
236
236
  }
237
237
 
@@ -417,7 +417,7 @@ private:
417
417
  I = I->getPrevNode();
418
418
  while (I)
419
419
  {
420
- if (SVFUtil::isa<LoadInst>(I) || SVFUtil::isa<StoreInst>(I))
420
+ if (SVFUtil::isa<LoadInst, StoreInst>(I))
421
421
  return I;
422
422
 
423
423
  const SVFInstruction* inst = LLVMModuleSet::getLLVMModuleSet()->getSVFInstruction(I);
@@ -236,6 +236,7 @@ struct isa_impl_wrap<To, FromTy, FromTy>
236
236
  // template type argument. Used like this:
237
237
  //
238
238
  // if (SVFUtil::isa<Type>(myVal)) { ... }
239
+ // if (SVFUtil::isa<Type0, Type1, Type2>(myVal)) { ... }
239
240
  //
240
241
  template <class X, class Y> LLVM_NODISCARD inline bool isa(const Y &Val)
241
242
  {
@@ -243,6 +244,12 @@ template <class X, class Y> LLVM_NODISCARD inline bool isa(const Y &Val)
243
244
  typename simplify_type<const Y>::SimpleType>::doit(Val);
244
245
  }
245
246
 
247
+ template <typename First, typename Second, typename... Rest, typename Y>
248
+ LLVM_NODISCARD inline bool isa(const Y &Val)
249
+ {
250
+ return SVFUtil::isa<First>(Val) || SVFUtil::isa<Second, Rest...>(Val);
251
+ }
252
+
246
253
  //===----------------------------------------------------------------------===//
247
254
  // cast<x> Support Templates
248
255
  //===----------------------------------------------------------------------===//
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1311",
3
+ "version": "1.0.1312",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {