Static Value-Flow Analysis
Loading...
Searching...
No Matches
WPAPass.h
Go to the documentation of this file.
1//===- WPAPass.h -- Whole program analysis------------------------------------//
2//
3// SVF: Static Value-Flow Analysis
4//
5// Copyright (C) <2013-2017> <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/*
25 * @file: WPA.h
26 * @author: yesen
27 * @date: 10/06/2014
28 * @version: 1.0
29 *
30 * @section LICENSE
31 *
32 * @section DESCRIPTION
33 *
34 */
35
36
37#ifndef WPA_H_
38#define WPA_H_
39
40#include "Util/GeneralType.h"
41#include "SVFIR/SVFType.h"
42
43namespace SVF
44{
45
46class CallICFGNode;
47class PointerAnalysis;
48class PointsTo;
49class SVFG;
50
55// excised ", public llvm::AliasAnalysis" as that has a very light interface
56// and I want to see what breaks.
58{
59 typedef std::vector<PointerAnalysis*> PTAVector;
60
61public:
63 static char ID;
64
71
74 {
75
76 }
77
79 virtual ~WPAPass();
80
82 virtual const PointsTo& getPts(NodeID var);
83
85 virtual void PrintAliasPairs(PointerAnalysis* pta);
86
88 virtual ModRefInfo getModRefInfo(const CallICFGNode* callInst);
89
91 // virtual inline ModRefInfo getModRefInfo(const CallSite callInst, const MemoryLocation& Loc)
92 // {
93 // return getModRefInfo(callInst, Loc.Ptr);
94 // }
95
98
100 virtual void runOnModule(SVFIR* svfModule);
101
103 virtual inline std::string getPassName() const
104 {
105 return "WPAPass";
106 }
107
108private:
110 void runPointerAnalysis(SVFIR* pag, u32_t kind);
111
115};
116
117} // End namespace SVF
118
119#endif /* WPA_H_ */
PointerAnalysis * _pta
pointer analysis to be executed.
Definition WPAPass.h:113
static char ID
Pass ID.
Definition WPAPass.h:63
WPAPass()
Constructor needs TargetLibraryInfo to be passed to the AliasAnalysis.
Definition WPAPass.h:73
@ Conservative
return MayAlias if any pta says alias
Definition WPAPass.h:67
@ Precise
return alias result by the most precise pta
Definition WPAPass.h:69
@ Veto
return NoAlias if any pta says no alias
Definition WPAPass.h:68
PTAVector ptaVector
all pointer analysis to be executed.
Definition WPAPass.h:112
virtual ~WPAPass()
Destructor.
Definition WPAPass.cpp:54
virtual ModRefInfo getModRefInfo(const CallICFGNode *callInst)
Interface of mod-ref analysis to determine whether a CallSite instruction can mod or ref any memory l...
Definition WPAPass.cpp:167
virtual std::string getPassName() const
PTA name.
Definition WPAPass.h:103
virtual const PointsTo & getPts(NodeID var)
Retrieve points-to set information.
Definition WPAPass.cpp:158
virtual void PrintAliasPairs(PointerAnalysis *pta)
Print all alias pairs.
Definition WPAPass.cpp:133
SVFG * _svfg
svfg generated through -ander pointer analysis
Definition WPAPass.h:114
void runPointerAnalysis(SVFIR *pag, u32_t kind)
Create pointer analysis according to specified kind and analyze the module.
Definition WPAPass.cpp:83
std::vector< PointerAnalysis * > PTAVector
Definition WPAPass.h:59
virtual void runOnModule(SVFIR *svfModule)
Run pointer analysis on SVFModule.
Definition WPAPass.cpp:69
for isBitcode
Definition BasicTypes.h:70
ModRefInfo
Definition SVFType.h:611
u32_t NodeID
Definition GeneralType.h:76
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76
unsigned u32_t
Definition GeneralType.h:67