svf-lib 1.0.1256 → 1.0.1257
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.
|
Binary file
|
|
@@ -54,12 +54,10 @@ public:
|
|
|
54
54
|
/// Print grammar and graph
|
|
55
55
|
virtual void finalize();
|
|
56
56
|
|
|
57
|
-
///
|
|
58
|
-
virtual void
|
|
57
|
+
/// Solving CFL Reachability
|
|
58
|
+
virtual void solve();
|
|
59
59
|
|
|
60
|
-
|
|
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
|
|
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
|
-
*
|
|
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
|
-
///
|
|
63
|
-
virtual void
|
|
64
|
+
/// Build Grammar from text file
|
|
65
|
+
virtual void buildCFLGrammar();
|
|
64
66
|
|
|
65
|
-
///
|
|
66
|
-
virtual void
|
|
67
|
+
/// Build CFLGraph based on Option
|
|
68
|
+
virtual void buildCFLGraph();
|
|
67
69
|
|
|
68
|
-
///
|
|
69
|
-
virtual void
|
|
70
|
+
/// Normalize grammar
|
|
71
|
+
virtual void normalizeCFLGrammar();
|
|
70
72
|
|
|
71
73
|
/// Get CFL graph
|
|
72
|
-
CFLGraph* getCFLGraph()
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
82
|
+
/// Perform analyze (main part of CFLR Analysis)
|
|
83
|
+
virtual void analyze();
|
|
78
84
|
|
|
79
85
|
/// Statistics
|
|
80
86
|
//@{
|
|
81
|
-
|
|
82
|
-
static
|
|
83
|
-
static
|
|
84
|
-
|
|
85
|
-
static
|
|
86
|
-
static
|
|
87
|
-
static
|
|
88
|
-
|
|
89
|
-
static
|
|
90
|
-
|
|
91
|
-
static double
|
|
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
|
|
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 /*
|
|
77
|
+
#endif /* CFL_CFLSTAT_H_ */
|
|
@@ -52,10 +52,8 @@ public:
|
|
|
52
52
|
/// Print grammar and graph
|
|
53
53
|
virtual void finalize();
|
|
54
54
|
|
|
55
|
-
///
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
virtual void countSumEdges();
|
|
55
|
+
/// Build CFLGraph via VFG
|
|
56
|
+
void buildCFLGraph();
|
|
59
57
|
|
|
60
58
|
private:
|
|
61
59
|
SaberSVFGBuilder memSSA;
|