Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVFGBuilder.h
Go to the documentation of this file.
1//===- SVFGBuilder.h -- Building SVFG-----------------------------------------//
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 * AndersenMemSSA.h
25 *
26 * Created on: Oct 27, 2013
27 * Author: Yulei Sui
28 */
29
30#ifndef ANDERSENMEMSSA_H_
31#define ANDERSENMEMSSA_H_
32
34#include "Graphs/SVFGOPT.h"
35
36namespace SVF
37{
38
43{
44
45public:
50
53
55 virtual ~SVFGBuilder() = default;
56
59
61 inline SVFG* getSVFG() const
62 {
63 return svfg.get();
64 }
65
68 {
69 for(SVFGEdgeSet::iterator it = edges.begin(), eit = edges.end(); it!=eit; ++it)
71 }
74 {
75 return vfEdgesAtIndCallSite.find(const_cast<SVFGEdge*>(edge))!=vfEdgesAtIndCallSite.end();
76 }
77
79 virtual std::unique_ptr<MemSSA> buildMSSA(BVDataPTAImpl* pta, bool ptrOnlyMSSA);
80
81protected:
83 SVFG* build(BVDataPTAImpl* pta, VFG::VFGK kind);
85 virtual void buildSVFG();
87 virtual void releaseMemory();
88
91 std::unique_ptr<SVFG> svfg;
94};
95
96} // End namespace SVF
97
98#endif /* ANDERSENMEMSSA_H_ */
OrderedMap< const CallICFGNode *, FunctionSet > CallEdgeMap
Set< const CallICFGNode * > CallSiteSet
Indirect call edges type, map a callsite to a set of callees.
Set< const SVFFunction * > FunctionSet
SVFGBuilder(bool _SVFGWithIndCall=false)
Constructor.
Definition SVFGBuilder.h:52
virtual std::unique_ptr< MemSSA > buildMSSA(BVDataPTAImpl *pta, bool ptrOnlyMSSA)
Build Memory SSA.
PointerAnalysis::FunctionSet FunctionSet
Definition SVFGBuilder.h:48
SVFG * getSVFG() const
Get SVFG instance.
Definition SVFGBuilder.h:61
void markValidVFEdge(SVFGEdgeSet &edges)
Mark feasible VF edge by removing it from set vfEdgesAtIndCallSite.
Definition SVFGBuilder.h:67
SVFG * build(BVDataPTAImpl *pta, VFG::VFGK kind)
Create a DDA SVFG. By default actualOut and FormalIN are removed, unless withAOFI is set true.
SVFG * buildFullSVFG(BVDataPTAImpl *pta)
SVFG::SVFGEdgeSetTy SVFGEdgeSet
Definition SVFGBuilder.h:49
virtual void releaseMemory()
Release global SVFG.
bool SVFGWithIndCall
SVFG with precomputed indirect call edges.
Definition SVFGBuilder.h:93
PointerAnalysis::CallSiteSet CallSiteSet
Definition SVFGBuilder.h:46
virtual ~SVFGBuilder()=default
Destructor.
bool isSpuriousVFEdgeAtIndCallSite(const SVFGEdge *edge)
Return true if this is an VF Edge pre-connected by Andersen's analysis.
Definition SVFGBuilder.h:73
SVFGEdgeSet vfEdgesAtIndCallSite
SVFG Edges connected at indirect call/ret sites.
Definition SVFGBuilder.h:90
SVFG * buildPTROnlySVFG(BVDataPTAImpl *pta)
PointerAnalysis::CallEdgeMap CallEdgeMap
Definition SVFGBuilder.h:47
virtual void buildSVFG()
Can be rewritten by subclasses.
std::unique_ptr< SVFG > svfg
Definition SVFGBuilder.h:91
VFGK
VFG kind.
Definition VFG.h:56
VFGEdge::SVFGEdgeSetTy SVFGEdgeSetTy
Definition VFG.h:78
for isBitcode
Definition BasicTypes.h:68
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74