svf-lib 1.0.729 → 1.0.733

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.
Files changed (61) hide show
  1. package/SVF-linux/Release-build/lib/libSvf.a +0 -0
  2. package/SVF-linux/include/DDA/DDAVFSolver.h +1 -1
  3. package/SVF-linux/include/Graphs/PAG.h +4 -4
  4. package/SVF-linux/include/Graphs/PAGNode.h +3 -3
  5. package/SVF-linux/include/MemoryModel/SVFIR.h +1 -1
  6. package/SVF-linux/include/MemoryModel/SVFSymbols.h +648 -0
  7. package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +26 -14
  8. package/SVF-linux/include/SVF-FE/SymbolTableBuilder.h +1 -1
  9. package/SVF-osx/Release-build/lib/CUDD/libCudd.a +0 -0
  10. package/SVF-osx/Release-build/lib/libSvf.a +0 -0
  11. package/SVF-osx/include/DDA/ContextDDA.h +1 -1
  12. package/SVF-osx/include/DDA/DDAClient.h +8 -8
  13. package/SVF-osx/include/DDA/DDAVFSolver.h +6 -6
  14. package/SVF-osx/include/DDA/FlowDDA.h +1 -1
  15. package/SVF-osx/include/Graphs/ConsG.h +6 -6
  16. package/SVF-osx/include/Graphs/ConsGEdge.h +2 -2
  17. package/SVF-osx/include/Graphs/ConsGNode.h +1 -1
  18. package/SVF-osx/include/Graphs/ExternalPAG.h +14 -14
  19. package/SVF-osx/include/Graphs/ICFGNode.h +14 -14
  20. package/SVF-osx/include/Graphs/IRGraph.h +245 -0
  21. package/SVF-osx/include/Graphs/OfflineConsG.h +1 -1
  22. package/SVF-osx/include/Graphs/PAG.h +4 -4
  23. package/SVF-osx/include/Graphs/PAGNode.h +4 -4
  24. package/SVF-osx/include/Graphs/SVFG.h +1 -1
  25. package/SVF-osx/include/Graphs/SVFGOPT.h +3 -3
  26. package/SVF-osx/include/Graphs/VFG.h +19 -19
  27. package/SVF-osx/include/Graphs/VFGNode.h +2 -3
  28. package/SVF-osx/include/MSSA/MemRegion.h +11 -11
  29. package/SVF-osx/include/MSSA/MemSSA.h +4 -4
  30. package/SVF-osx/include/MTA/FSMPTA.h +1 -1
  31. package/SVF-osx/include/MemoryModel/LocationSet.h +0 -1
  32. package/SVF-osx/include/MemoryModel/PAGBuilderFromFile.h +8 -8
  33. package/SVF-osx/include/MemoryModel/PTAStat.h +31 -31
  34. package/SVF-osx/include/MemoryModel/PointerAnalysis.h +9 -9
  35. package/SVF-osx/include/MemoryModel/PointerAnalysisImpl.h +3 -3
  36. package/SVF-osx/include/MemoryModel/SVFIR.h +738 -0
  37. package/SVF-osx/include/MemoryModel/SVFStatements.h +738 -0
  38. package/SVF-osx/include/MemoryModel/SVFSymbols.h +648 -0
  39. package/SVF-osx/include/MemoryModel/SVFVariables.h +842 -0
  40. package/SVF-osx/include/MemoryModel/SymbolTableInfo.h +731 -0
  41. package/SVF-osx/include/SABER/SaberSVFGBuilder.h +0 -2
  42. package/SVF-osx/include/SABER/SrcSnkDDA.h +3 -3
  43. package/SVF-osx/include/SVF-FE/Graph2Json.h +1 -3
  44. package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +392 -0
  45. package/SVF-osx/include/SVF-FE/SymbolTableBuilder.h +89 -0
  46. package/SVF-osx/include/Util/BasicTypes.h +0 -10
  47. package/SVF-osx/include/Util/CFLSolver.h +1 -1
  48. package/SVF-osx/include/Util/ExtAPI.h +1 -1
  49. package/SVF-osx/include/Util/IRAnnotator.h +6 -6
  50. package/SVF-osx/include/Util/Options.h +1 -1
  51. package/SVF-osx/include/Util/SVFUtil.h +11 -0
  52. package/SVF-osx/include/Util/TypeBasedHeapCloning.h +11 -11
  53. package/SVF-osx/include/WPA/Andersen.h +11 -100
  54. package/SVF-osx/include/WPA/AndersenSFR.h +4 -4
  55. package/SVF-osx/include/WPA/FlowSensitive.h +2 -2
  56. package/SVF-osx/include/WPA/FlowSensitiveTBHC.h +1 -1
  57. package/SVF-osx/include/WPA/Steensgaard.h +2 -2
  58. package/SVF-osx/include/WPA/TypeAnalysis.h +1 -1
  59. package/SVF-osx/include/WPA/VersionedFlowSensitive.h +2 -2
  60. package/SVF-osx/include/WPA/WPAStat.h +1 -2
  61. package/package.json +1 -1
@@ -11,7 +11,7 @@
11
11
  */
12
12
 
13
13
  #include "SVF-FE/DCHG.h"
14
- #include "Graphs/PAG.h"
14
+ #include "MemoryModel/SVFIR.h"
15
15
  #include "MemoryModel/PointerAnalysisImpl.h"
16
16
  #include "Util/BasicTypes.h"
17
17
 
@@ -48,8 +48,8 @@ protected:
48
48
 
49
49
  /// DCHG *must* be set by extending class once the DCHG is available.
50
50
  void setDCHG(DCHGraph *dchg);
51
- /// PAG *must* be set by extending class once the PAG is available.
52
- void setPAG(PAG *pag);
51
+ /// SVFIR *must* be set by extending class once the SVFIR is available.
52
+ void setPAG(SVFIR *pag);
53
53
 
54
54
  /// Check if an object is a black hole obj or a constant object. Required since
55
55
  /// other implementations obviously do not account for clones.
@@ -97,7 +97,7 @@ protected:
97
97
  const NodeBS &getGepObjs(NodeID base);
98
98
 
99
99
  /// Returns the GEP object node(s) of base for ls. This may include clones.
100
- /// If there are no GEP objects, then getGepObjNode is called on the PAG
100
+ /// If there are no GEP objects, then getGepObjNode is called on the SVFIR
101
101
  /// (through base's getGepObjNode) which will create one.
102
102
  const NodeBS getGepObjClones(NodeID base, unsigned offset);
103
103
 
@@ -109,11 +109,11 @@ protected:
109
109
  /// as a result of reuse.
110
110
  NodeID cloneObject(NodeID o, const DIType *type, bool reuse);
111
111
 
112
- /// Add clone dummy object node to PAG.
112
+ /// Add clone dummy object node to SVFIR.
113
113
  inline NodeID addCloneDummyObjNode(const MemObj *mem);
114
- /// Add clone GEP object node to PAG.
114
+ /// Add clone GEP object node to SVFIR.
115
115
  inline NodeID addCloneGepObjNode(const MemObj *mem, const LocationSet &l);
116
- /// Add clone FI object node to PAG.
116
+ /// Add clone FI object node to SVFIR.
117
117
  inline NodeID addCloneFIObjNode(const MemObj *mem);
118
118
 
119
119
  /// Returns the ctir type attached to the value, nullptr if non-existant.
@@ -145,20 +145,20 @@ protected:
145
145
  private:
146
146
  /// PTA extending this class.
147
147
  BVDataPTAImpl *pta;
148
- /// PAG the PTA uses. Just a shortcut for getPAG().
149
- PAG *ppag = nullptr;
148
+ /// SVFIR the PTA uses. Just a shortcut for getPAG().
149
+ SVFIR *ppag = nullptr;
150
150
 
151
151
  /// Object -> its type.
152
152
  Map<NodeID, const DIType *> objToType;
153
153
  /// Object -> allocation site.
154
154
  /// The value NodeID depends on the pointer analysis (could be
155
- /// an SVFG node or PAG node for example).
155
+ /// an SVFG node or SVFIR node for example).
156
156
  Map<NodeID, NodeID> objToAllocation;
157
157
  /// (Original) object -> set of its clones.
158
158
  Map<NodeID, NodeBS> objToClones;
159
159
  /// (Clone) object -> original object (opposite of objToclones).
160
160
  Map<NodeID, NodeID> cloneToOriginalObj;
161
- /// Maps nodes (a location like a PAG node or SVFG node) to their filter set.
161
+ /// Maps nodes (a location like a SVFIR node or SVFG node) to their filter set.
162
162
  Map<NodeID, PointsTo> locToFilterSet;
163
163
  /// Maps objects to the GEP nodes beneath them.
164
164
  Map<NodeID, NodeBS> objToGeps;
@@ -33,14 +33,13 @@
33
33
  #include "MemoryModel/PointerAnalysisImpl.h"
34
34
  #include "WPA/WPAStat.h"
35
35
  #include "WPA/WPASolver.h"
36
- #include "Graphs/PAG.h"
36
+ #include "MemoryModel/SVFIR.h"
37
37
  #include "Graphs/ConsG.h"
38
38
  #include "Graphs/OfflineConsG.h"
39
39
 
40
40
  namespace SVF
41
41
  {
42
42
 
43
- class PTAType;
44
43
  class SVFModule;
45
44
 
46
45
  /*!
@@ -53,7 +52,7 @@ class AndersenBase: public WPAConstraintSolver, public BVDataPTAImpl
53
52
  public:
54
53
 
55
54
  /// Constructor
56
- AndersenBase(PAG* _pag, PTATY type = Andersen_BASE, bool alias_check = true)
55
+ AndersenBase(SVFIR* _pag, PTATY type = Andersen_BASE, bool alias_check = true)
57
56
  : BVDataPTAImpl(_pag, type, alias_check), consCG(nullptr)
58
57
  {
59
58
  iterationForPrintStat = OnTheFlyIterBudgetForStat;
@@ -156,7 +155,7 @@ public:
156
155
  typedef OrderedMap<CallSite, NodeID> CallSite2DummyValPN;
157
156
 
158
157
  /// Constructor
159
- Andersen(PAG* _pag, PTATY type = Andersen_WPA, bool alias_check = true)
158
+ Andersen(SVFIR* _pag, PTATY type = Andersen_WPA, bool alias_check = true)
160
159
  : AndersenBase(_pag, type, alias_check), pwcOpt(false), diffOpt(true)
161
160
  {
162
161
  }
@@ -425,10 +424,10 @@ private:
425
424
  static AndersenWaveDiff* diffWave; // static instance
426
425
 
427
426
  public:
428
- AndersenWaveDiff(PAG* _pag, PTATY type = AndersenWaveDiff_WPA, bool alias_check = true): Andersen(_pag, type, alias_check) {}
427
+ AndersenWaveDiff(SVFIR* _pag, PTATY type = AndersenWaveDiff_WPA, bool alias_check = true): Andersen(_pag, type, alias_check) {}
429
428
 
430
429
  /// Create an singleton instance directly instead of invoking llvm pass manager
431
- static AndersenWaveDiff* createAndersenWaveDiff(PAG* _pag)
430
+ static AndersenWaveDiff* createAndersenWaveDiff(SVFIR* _pag)
432
431
  {
433
432
  if(diffWave==nullptr)
434
433
  {
@@ -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
  */
@@ -564,13 +475,13 @@ private:
564
475
  NodeSet lcdCandidates;
565
476
 
566
477
  public:
567
- AndersenLCD(PAG* _pag, PTATY type = AndersenLCD_WPA) :
478
+ AndersenLCD(SVFIR* _pag, PTATY type = AndersenLCD_WPA) :
568
479
  Andersen(_pag, type), metEdges({}), lcdCandidates( {})
569
480
  {
570
481
  }
571
482
 
572
483
  /// Create an singleton instance directly instead of invoking llvm pass manager
573
- static AndersenLCD* createAndersenLCD(PAG* _pag)
484
+ static AndersenLCD* createAndersenLCD(SVFIR* _pag)
574
485
  {
575
486
  if (lcdAndersen == nullptr)
576
487
  {
@@ -646,13 +557,13 @@ private:
646
557
  OfflineConsG* oCG;
647
558
 
648
559
  public:
649
- AndersenHCD(PAG* _pag, PTATY type = AndersenHCD_WPA) :
560
+ AndersenHCD(SVFIR* _pag, PTATY type = AndersenHCD_WPA) :
650
561
  Andersen(_pag, type), oCG(nullptr)
651
562
  {
652
563
  }
653
564
 
654
565
  /// Create an singleton instance directly instead of invoking llvm pass manager
655
- static AndersenHCD *createAndersenHCD(PAG* _pag)
566
+ static AndersenHCD *createAndersenHCD(SVFIR* _pag)
656
567
  {
657
568
  if (hcdAndersen == nullptr)
658
569
  {
@@ -717,13 +628,13 @@ private:
717
628
  static AndersenHLCD* hlcdAndersen;
718
629
 
719
630
  public:
720
- AndersenHLCD(PAG* _pag, PTATY type = AndersenHLCD_WPA) :
631
+ AndersenHLCD(SVFIR* _pag, PTATY type = AndersenHLCD_WPA) :
721
632
  Andersen(_pag, type), AndersenHCD(_pag, type), AndersenLCD(_pag, type)
722
633
  {
723
634
  }
724
635
 
725
636
  /// Create an singleton instance directly instead of invoking llvm pass manager
726
- static AndersenHLCD *createAndersenHLCD(PAG* _pag)
637
+ static AndersenHLCD *createAndersenHLCD(SVFIR* _pag)
727
638
  {
728
639
  if (hlcdAndersen == nullptr)
729
640
  {
@@ -52,13 +52,13 @@ protected:
52
52
  NodeToNodeMap pwcReps;
53
53
 
54
54
  public:
55
- AndersenSCD(PAG* _pag, PTATY type = AndersenSCD_WPA) :
55
+ AndersenSCD(SVFIR* _pag, PTATY type = AndersenSCD_WPA) :
56
56
  Andersen(_pag,type)
57
57
  {
58
58
  }
59
59
 
60
60
  /// Create an singleton instance directly instead of invoking llvm pass manager
61
- static AndersenSCD *createAndersenSCD(PAG* _pag)
61
+ static AndersenSCD *createAndersenSCD(SVFIR* _pag)
62
62
  {
63
63
  if (scdAndersen == nullptr)
64
64
  {
@@ -114,13 +114,13 @@ private:
114
114
  FieldReps fieldReps;
115
115
 
116
116
  public:
117
- AndersenSFR(PAG* _pag, PTATY type = AndersenSFR_WPA) :
117
+ AndersenSFR(SVFIR* _pag, PTATY type = AndersenSFR_WPA) :
118
118
  AndersenSCD(_pag, type), csc(nullptr)
119
119
  {
120
120
  }
121
121
 
122
122
  /// Create an singleton instance directly instead of invoking llvm pass manager
123
- static AndersenSFR *createAndersenSFR(PAG* _pag)
123
+ static AndersenSFR *createAndersenSFR(SVFIR* _pag)
124
124
  {
125
125
  if (sfrAndersen == nullptr)
126
126
  {
@@ -58,7 +58,7 @@ public:
58
58
  typedef BVDataPTAImpl::MutDFPTDataTy::PtsMap PtsMap;
59
59
 
60
60
  /// Constructor
61
- FlowSensitive(PAG* _pag, PTATY type = FSSPARSE_WPA) : WPASVFGFSSolver(), BVDataPTAImpl(_pag, type)
61
+ FlowSensitive(SVFIR* _pag, PTATY type = FSSPARSE_WPA) : WPASVFGFSSolver(), BVDataPTAImpl(_pag, type)
62
62
  {
63
63
  svfg = nullptr;
64
64
  solveTime = sccTime = processTime = propagationTime = updateTime = 0;
@@ -81,7 +81,7 @@ public:
81
81
  }
82
82
 
83
83
  /// Create signle instance of flow-sensitive pointer analysis
84
- static FlowSensitive* createFSWPA(PAG* _pag)
84
+ static FlowSensitive* createFSWPA(SVFIR* _pag)
85
85
  {
86
86
  if (fspta == nullptr)
87
87
  {
@@ -33,7 +33,7 @@ public:
33
33
  static const MDNode *getRawCTirMetadata(const SVFGNode *);
34
34
 
35
35
  /// Constructor
36
- FlowSensitiveTBHC(PAG* _pag, PTATY type = FSTBHC_WPA);
36
+ FlowSensitiveTBHC(SVFIR* _pag, PTATY type = FSTBHC_WPA);
37
37
 
38
38
  /// Destructor
39
39
  virtual ~FlowSensitiveTBHC() { };
@@ -26,13 +26,13 @@ public:
26
26
  typedef Map<NodeID, Set<NodeID>> NodeToSubsMap;
27
27
 
28
28
  /// Constructor
29
- Steensgaard(PAG* _pag)
29
+ Steensgaard(SVFIR* _pag)
30
30
  : AndersenBase(_pag, Steensgaard_WPA, true)
31
31
  {
32
32
  }
33
33
 
34
34
  /// Create an singleton instance
35
- static Steensgaard* createSteensgaard(PAG* _pag)
35
+ static Steensgaard* createSteensgaard(SVFIR* _pag)
36
36
  {
37
37
  if(steens==nullptr)
38
38
  {
@@ -40,7 +40,7 @@ class TypeAnalysis: public AndersenBase
40
40
 
41
41
  public:
42
42
  /// Constructor
43
- TypeAnalysis(PAG* pag)
43
+ TypeAnalysis(SVFIR* pag)
44
44
  : AndersenBase(pag, TypeCPP_WPA)
45
45
  {
46
46
  }
@@ -47,7 +47,7 @@ public:
47
47
  static VersionedVar atKey(NodeID, Version);
48
48
 
49
49
  /// Constructor
50
- VersionedFlowSensitive(PAG *_pag, PTATY type = VFS_WPA);
50
+ VersionedFlowSensitive(SVFIR *_pag, PTATY type = VFS_WPA);
51
51
 
52
52
  /// Initialize analysis
53
53
  virtual void initialize() override;
@@ -74,7 +74,7 @@ public:
74
74
  //@}
75
75
 
76
76
  /// Create single instance of versioned flow-sensitive points-to analysis.
77
- static VersionedFlowSensitive *createVFSWPA(PAG *_pag)
77
+ static VersionedFlowSensitive *createVFSWPA(SVFIR *_pag)
78
78
  {
79
79
  if (vfspta == nullptr)
80
80
  {
@@ -39,9 +39,8 @@ namespace SVF
39
39
  {
40
40
 
41
41
  class AndersenBase;
42
- class PAG;
42
+ class SVFIR;
43
43
  class ConstraintGraph;
44
- class PAGNode;
45
44
 
46
45
  /*!
47
46
  * Statistics of Andersen's analysis
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.729",
3
+ "version": "1.0.733",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {