svf-lib 1.0.1255 → 1.0.1256

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.
@@ -54,12 +54,10 @@ public:
54
54
  /// Print grammar and graph
55
55
  virtual void finalize();
56
56
 
57
- /// Start Analysis here (main part of pointer analysis).
58
- virtual void analyze();
57
+ /// Solving CFL Reachability
58
+ virtual void solve();
59
59
 
60
- virtual void countSumEdges();
61
-
62
- /// Interface exposed to users of our pointer analysis, given Value infos
60
+ /// Interface exposed to users of our Alias analysis, given Value infos
63
61
  virtual AliasResult alias(const Value* v1, const Value* v2)
64
62
  {
65
63
  NodeID n1 = svfir->getValueNode(v1);
@@ -67,7 +65,7 @@ public:
67
65
  return alias(n1,n2);
68
66
  }
69
67
 
70
- /// Interface exposed to users of our pointer analysis, given PAGNodeID
68
+ /// Interface exposed to users of our Alias analysis, given PAGNodeID
71
69
  virtual AliasResult alias(NodeID node1, NodeID node2)
72
70
  {
73
71
  if(graph->hasEdge(graph->getGNode(node1), graph->getGNode(node2), graph->startKind))
@@ -21,7 +21,7 @@
21
21
  //===----------------------------------------------------------------------===//
22
22
 
23
23
  /*
24
- * CFLAlias.h
24
+ * CFLBase.h
25
25
  *
26
26
  * Created on: Oct 12, 2022
27
27
  * Author: Pei Xu
@@ -45,6 +45,7 @@ namespace SVF
45
45
 
46
46
  class CFLStat;
47
47
 
48
+ /// CFL Client Base Class
48
49
  class CFLBase : public BVDataPTAImpl
49
50
  {
50
51
 
@@ -57,53 +58,51 @@ public:
57
58
  virtual ~CFLBase()
58
59
  {
59
60
  delete solver;
61
+ delete grammarBase;
60
62
  }
61
63
 
62
- /// Initialize the grammar, graph, solver
63
- virtual void initialize() = 0;
64
+ /// Build Grammar from text file
65
+ virtual void buildCFLGrammar();
64
66
 
65
- /// Print grammar and graph
66
- virtual void finalize() = 0;
67
+ /// Build CFLGraph based on Option
68
+ virtual void buildCFLGraph();
67
69
 
68
- /// Start Analysis here (main part of pointer analysis).
69
- virtual void analyze() = 0;
70
+ /// Normalize grammar
71
+ virtual void normalizeCFLGrammar();
70
72
 
71
73
  /// Get CFL graph
72
- CFLGraph* getCFLGraph()
73
- {
74
- return graph;
75
- }
74
+ CFLGraph* getCFLGraph();
75
+
76
+ /// Count the num of Nonterminal Edges
77
+ virtual void countSumEdges();
78
+
79
+ /// Solving CFL Reachability
80
+ virtual void solve();
76
81
 
77
- virtual void countSumEdges() = 0;
82
+ /// Perform analyze (main part of CFLR Analysis)
83
+ virtual void analyze();
78
84
 
79
85
  /// Statistics
80
86
  //@{
81
- static u32_t numOfProcessedAddr; /// Number of processed Addr edge
82
- static u32_t numOfProcessedCopy; /// Number of processed Copy edge
83
- static u32_t numOfProcessedGep; /// Number of processed Gep edge
84
- static u32_t numOfProcessedLoad; /// Number of processed Load edge
85
- static u32_t numOfProcessedStore; /// Number of processed Store edge
86
- static u32_t numOfSfrs;
87
- static u32_t numOfFieldExpand;
88
-
89
- static u32_t numOfSCCDetection;
90
- static double timeOfSCCDetection;
91
- static double timeOfSCCMerges;
92
- static double timeOfCollapse;
93
- static u32_t AveragePointsToSetSize;
94
- static u32_t MaxPointsToSetSize;
95
- static double timeOfProcessCopyGep;
96
- static double timeOfProcessLoadStore;
97
- static double timeOfUpdateCallGraph;
98
- static double timeOfSolving;
99
- static double numOfSumEdges;
87
+ // Grammar
88
+ static double timeOfBuildCFLGrammar; // Time of building grammarBase from text file
89
+ static double timeOfNormalizeGrammar; // Time of normalizing grammarBase to CFLGrammar
90
+ // Graph
91
+ static double timeOfBuildCFLGraph; // Time of building CFLGraph
92
+ static double numOfTerminalEdges; // Number of terminal labeled edges
93
+ static double numOfTemporaryNonterminalEdges; // Number of temporary (ie. X0, X1..) nonterminal labeled edges
94
+ static double numOfNonterminalEdges; // Number of nonterminal labeled edges
95
+ static double numOfStartEdges; // Number of start nonterminal labeled edges
96
+ // Solver
97
+ static double timeOfSolving; // time of solving CFL Reachability
100
98
  //@}
101
99
 
102
100
  protected:
103
101
  SVFIR* svfir;
104
102
  CFLGraph* graph;
103
+ GrammarBase* grammarBase;
105
104
  CFLGrammar* grammar;
106
- CFLSolver *solver;
105
+ CFLSolver* solver;
107
106
  };
108
107
 
109
108
  } // End namespace SVF
@@ -53,17 +53,6 @@ private:
53
53
  CFLBase* pta;
54
54
 
55
55
  public:
56
- static const char* CollapseTime;
57
-
58
- static u32_t _MaxPtsSize;
59
- static u32_t _NumOfCycles;
60
- static u32_t _NumOfPWCCycles;
61
- static u32_t _NumOfNodesInCycles;
62
- static u32_t _MaxNumOfNodesInSCC;
63
- u32_t _NumOfNullPtr;
64
- u32_t _NumOfConstantPtr;
65
- u32_t _NumOfBlackholePtr;
66
-
67
56
  /// CFL Stat
68
57
  u32_t _NumofCFLGraphNode;
69
58
 
@@ -76,15 +65,13 @@ public:
76
65
 
77
66
  virtual void performStat();
78
67
 
79
- void collectCycleInfo(ConstraintGraph* consCG);
80
-
81
68
  void collectCFLInfo(CFLGraph* CFLGraph);
82
69
 
83
- void statNullPtr();
84
-
85
70
  void constraintGraphStat();
71
+
72
+ void CFLGrammarStat();
86
73
  };
87
74
 
88
75
  } // End namespace SVF
89
76
 
90
- #endif /* FLOWSENSITIVESTAT_H_ */
77
+ #endif /* CFL_CFLSTAT_H_ */
@@ -52,10 +52,8 @@ public:
52
52
  /// Print grammar and graph
53
53
  virtual void finalize();
54
54
 
55
- /// Start Analysis here (main part of pointer analysis).
56
- virtual void analyze();
57
-
58
- virtual void countSumEdges();
55
+ /// Build CFLGraph via VFG
56
+ void buildCFLGraph();
59
57
 
60
58
  private:
61
59
  SaberSVFGBuilder memSSA;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1255",
3
+ "version": "1.0.1256",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {