svf-lib 1.0.726 → 1.0.730

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.
@@ -68,7 +68,7 @@ public:
68
68
  NodeID allocateValueId(void);
69
69
 
70
70
  /// Notify the allocator that all symbols have had IDs allocated.
71
- void endSymbolAllocation(void);
71
+ NodeID endSymbolAllocation(void);
72
72
 
73
73
  /// Returns the total number of memory objects.
74
74
  NodeID getNumObjects(void) const { return numObjects; }
@@ -241,6 +241,17 @@ inline const SVFFunction* getFunction(StringRef name)
241
241
  return nullptr;
242
242
  }
243
243
 
244
+ /// find the unique defined global across multiple modules
245
+ inline const Value* getGlobalRep(const Value* val)
246
+ {
247
+ if(const GlobalVariable* gvar = SVFUtil::dyn_cast<GlobalVariable>(val))
248
+ {
249
+ if (LLVMModuleSet::getLLVMModuleSet()->hasGlobalRep(gvar))
250
+ val = LLVMModuleSet::getLLVMModuleSet()->getGlobalRep(gvar);
251
+ }
252
+ return val;
253
+ }
254
+
244
255
  /// Get the definition of a function across multiple modules
245
256
  inline const SVFFunction* getDefFunForMultipleModule(const Function* fun)
246
257
  {
@@ -40,7 +40,6 @@
40
40
  namespace SVF
41
41
  {
42
42
 
43
- class PTAType;
44
43
  class SVFModule;
45
44
 
46
45
  /*!
@@ -464,94 +463,6 @@ protected:
464
463
  };
465
464
 
466
465
 
467
-
468
- /**
469
- * Wave propagation with diff points-to set with type filter.
470
- */
471
- class AndersenWaveDiffWithType : public AndersenWaveDiff
472
- {
473
-
474
- private:
475
-
476
- typedef Map<NodeID, Set<const GepCGEdge*>> TypeMismatchedObjToEdgeTy;
477
-
478
- TypeMismatchedObjToEdgeTy typeMismatchedObjToEdges;
479
-
480
- void recordTypeMismatchedGep(NodeID obj, const GepCGEdge* gepEdge)
481
- {
482
- TypeMismatchedObjToEdgeTy::iterator it = typeMismatchedObjToEdges.find(obj);
483
- if (it != typeMismatchedObjToEdges.end())
484
- {
485
- Set<const GepCGEdge*> &edges = it->second;
486
- edges.insert(gepEdge);
487
- }
488
- else
489
- {
490
- Set<const GepCGEdge*> edges;
491
- edges.insert(gepEdge);
492
- typeMismatchedObjToEdges[obj] = edges;
493
- }
494
- }
495
-
496
- static AndersenWaveDiffWithType* diffWaveWithType; // static instance
497
-
498
- /// Handle diff points-to set.
499
- //@{
500
- virtual inline void computeDiffPts(NodeID id)
501
- {
502
- NodeID rep = sccRepNode(id);
503
- getDiffPTDataTy()->computeDiffPts(rep, getDiffPTDataTy()->getPts(rep));
504
- }
505
- virtual inline const PointsTo& getDiffPts(NodeID id)
506
- {
507
- NodeID rep = sccRepNode(id);
508
- return getDiffPTDataTy()->getDiffPts(rep);
509
- }
510
- //@}
511
-
512
- public:
513
- AndersenWaveDiffWithType(PAG* _pag, PTATY type = AndersenWaveDiffWithType_WPA): AndersenWaveDiff(_pag,type)
514
- {
515
- assert(getTypeSystem()!=nullptr && "a type system is required for this pointer analysis");
516
- }
517
-
518
- /// Create an singleton instance directly instead of invoking llvm pass manager
519
- static AndersenWaveDiffWithType* createAndersenWaveDiffWithType(PAG* p)
520
- {
521
- if(diffWaveWithType==nullptr)
522
- {
523
- diffWaveWithType = new AndersenWaveDiffWithType(p);
524
- diffWaveWithType->analyze();
525
- return diffWaveWithType;
526
- }
527
- return diffWaveWithType;
528
- }
529
- static void releaseAndersenWaveDiffWithType()
530
- {
531
- if (diffWaveWithType)
532
- delete diffWaveWithType;
533
- diffWaveWithType = nullptr;
534
- }
535
-
536
- protected:
537
- /// SCC detection
538
- virtual NodeStack& SCCDetect();
539
- /// merge types of nodes in a cycle
540
- void mergeTypeOfNodes(const NodeBS &nodes);
541
- /// process "bitcast" CopyCGEdge
542
- virtual void processCast(const ConstraintEdge *edge);
543
- /// update type of objects when process "bitcast" CopyCGEdge
544
- void updateObjType(const Type *type, const PointsTo &objs);
545
- /// process mismatched gep edges
546
- void processTypeMismatchedGep(NodeID obj, const Type *type);
547
- /// match types for Gep Edges
548
- virtual bool matchType(NodeID ptrid, NodeID objid, const NormalGepCGEdge *normalGepEdge);
549
- /// add type for newly created GepObjNode
550
- virtual void addTypeForGepObjNode(NodeID id, const NormalGepCGEdge* normalGepEdge);
551
- };
552
-
553
-
554
-
555
466
  /*
556
467
  * Lazy Cycle Detection Based Andersen Analysis
557
468
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.726",
3
+ "version": "1.0.730",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {