Static Value-Flow Analysis
DDAPass.h
Go to the documentation of this file.
1 //===- DDAPass.h -- Demand-driven analysis driver pass-------------//
2 //
3 // SVF: Static Value-Flow Analysis
4 //
5 // Copyright (C) <2013-> <Yulei Sui>
6 //
7 
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Affero General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU Affero General Public License for more details.
17 
18 // You should have received a copy of the GNU Affero General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 //
21 //===----------------------------------------------------------------------===//
22 
23 /*
24  * @file: DDAPass.h
25  * @author: Yulei Sui
26  * @date: 01/07/2014
27  * @version: 1.0
28  *
29  */
30 
31 
32 #ifndef DDAPASS_H_
33 #define DDAPASS_H_
34 
35 #include "DDA/DDAClient.h"
36 #include "Graphs/SCC.h"
38 
39 namespace SVF
40 {
41 
46 class DDAPass
47 {
48 
49 public:
51  static char ID;
54  typedef std::vector<PointerAnalysis*> PTAVector;
55 
56  DDAPass() : _pta(nullptr), _client(nullptr) {}
57  ~DDAPass();
58 
60  virtual AliasResult alias(const SVFValue* V1, const SVFValue* V2);
61 
63  virtual AliasResult alias(NodeID V1, NodeID V2);
64 
66  virtual void runOnModule(SVFIR* module);
67 
69  virtual void selectClient(SVFModule* module);
70 
72  virtual inline std::string getPassName() const
73  {
74  return "DDAPass";
75  }
76 
77 private:
79  void printQueryPTS();
81  void runPointerAnalysis(SVFIR* module, u32_t kind);
83  void initCxtInsensitiveEdges(PointerAnalysis* pta, const SVFG* svfg,const SVFGSCC* svfgSCC, SVFGEdgeSet& insensitveEdges);
85  bool edgeInSVFGSCC(const SVFGSCC* svfgSCC,const SVFGEdge* edge);
87  bool edgeInCallGraphSCC(PointerAnalysis* pta,const SVFGEdge* edge);
88 
89  void collectCxtInsenEdgeForRecur(PointerAnalysis* pta, const SVFG* svfg,SVFGEdgeSet& insensitveEdges);
90  void collectCxtInsenEdgeForVFCycle(PointerAnalysis* pta, const SVFG* svfg,const SVFGSCC* svfgSCC, SVFGEdgeSet& insensitveEdges);
91 
92  std::unique_ptr<PointerAnalysis> _pta;
94 
95 };
96 
97 } // End namespace SVF
98 
99 #endif /* WPA_H_ */
const char *const string
Definition: cJSON.h:172
virtual AliasResult alias(const SVFValue *V1, const SVFValue *V2)
Interface expose to users of our pointer analysis, given Value infos.
Definition: DDAPass.cpp:297
bool edgeInSVFGSCC(const SVFGSCC *svfgSCC, const SVFGEdge *edge)
Return TRUE if this edge is inside a SVFG SCC, i.e., src node and dst node are in the same SCC on the...
Definition: DDAPass.cpp:170
SCCDetection< SVFG * > SVFGSCC
Definition: DDAPass.h:52
std::unique_ptr< PointerAnalysis > _pta
pointer analysis to be executed.
Definition: DDAPass.h:92
DDAClient * _client
DDA client used.
Definition: DDAPass.h:93
virtual void selectClient(SVFModule *module)
Select a client.
Definition: DDAPass.cpp:72
bool edgeInCallGraphSCC(PointerAnalysis *pta, const SVFGEdge *edge)
Return TRUE if this edge is inside a SVFG SCC, i.e., src node and dst node are in the same SCC on the...
Definition: DDAPass.cpp:178
void runPointerAnalysis(SVFIR *module, u32_t kind)
Create pointer analysis according to specified kind and analyze the module.
Definition: DDAPass.cpp:108
virtual void runOnModule(SVFIR *module)
We start from here.
Definition: DDAPass.cpp:55
std::vector< PointerAnalysis * > PTAVector
Definition: DDAPass.h:54
OrderedSet< const SVFGEdge * > SVFGEdgeSet
Definition: DDAPass.h:53
static char ID
Pass ID.
Definition: DDAPass.h:51
void initCxtInsensitiveEdges(PointerAnalysis *pta, const SVFG *svfg, const SVFGSCC *svfgSCC, SVFGEdgeSet &insensitveEdges)
Context insensitive Edge for DDA.
Definition: DDAPass.cpp:159
virtual std::string getPassName() const
Pass name.
Definition: DDAPass.h:72
void collectCxtInsenEdgeForVFCycle(PointerAnalysis *pta, const SVFG *svfg, const SVFGSCC *svfgSCC, SVFGEdgeSet &insensitveEdges)
Definition: DDAPass.cpp:219
void collectCxtInsenEdgeForRecur(PointerAnalysis *pta, const SVFG *svfg, SVFGEdgeSet &insensitveEdges)
Definition: DDAPass.cpp:196
void printQueryPTS()
Print queries' pts.
Definition: DDAPass.cpp:325
Definition: SVFG.h:66
for isBitcode
Definition: BasicTypes.h:68
u32_t NodeID
Definition: GeneralType.h:55
std::set< Key, Compare, Allocator > OrderedSet
Definition: GeneralType.h:105
AliasResult
Definition: SVFType.h:527
unsigned u32_t
Definition: GeneralType.h:46