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#include "Util/Options.h"
36
37namespace SVF
38{
39
44{
45
46public:
51
57
59 virtual ~SVFGBuilder() = default;
60
63
65 inline SVFG* getSVFG() const
66 {
67 return svfg.get();
68 }
69
72 {
73 for(SVFGEdgeSet::iterator it = edges.begin(), eit = edges.end(); it!=eit; ++it)
75 }
78 {
79 return vfEdgesAtIndCallSite.find(const_cast<SVFGEdge*>(edge))!=vfEdgesAtIndCallSite.end();
80 }
81
83 virtual std::unique_ptr<MemSSA> buildMSSA(BVDataPTAImpl* pta, bool ptrOnlyMSSA);
84
85protected:
87 SVFG* build(BVDataPTAImpl* pta, VFG::VFGK kind);
89 virtual void buildSVFG();
91 virtual void releaseMemory();
92
95 std::unique_ptr<SVFG> svfg;
100};
101
102} // End namespace SVF
103
104#endif /* ANDERSENMEMSSA_H_ */
static const Option< bool > SVFGWithIndirectCall
Definition Options.h:149
static Option< bool > OPTSVFG
Definition Options.h:150
OrderedMap< const CallICFGNode *, FunctionSet > CallEdgeMap
Set< const CallICFGNode * > CallSiteSet
Indirect call edges type, map a callsite to a set of callees.
Set< const FunObjVar * > FunctionSet
virtual std::unique_ptr< MemSSA > buildMSSA(BVDataPTAImpl *pta, bool ptrOnlyMSSA)
Build Memory SSA.
bool SVFGWithPostOpts
Build optimised version of SVFG.
Definition SVFGBuilder.h:99
PointerAnalysis::FunctionSet FunctionSet
Definition SVFGBuilder.h:49
SVFG * getSVFG() const
Get SVFG instance.
Definition SVFGBuilder.h:65
void markValidVFEdge(SVFGEdgeSet &edges)
Mark feasible VF edge by removing it from set vfEdgesAtIndCallSite.
Definition SVFGBuilder.h:71
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:50
virtual void releaseMemory()
Release global SVFG.
bool SVFGWithIndCall
SVFG with precomputed indirect call edges.
Definition SVFGBuilder.h:97
PointerAnalysis::CallSiteSet CallSiteSet
Definition SVFGBuilder.h:47
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:77
SVFGEdgeSet vfEdgesAtIndCallSite
SVFG Edges connected at indirect call/ret sites.
Definition SVFGBuilder.h:94
SVFG * buildPTROnlySVFG(BVDataPTAImpl *pta)
SVFGBuilder(bool _SVFGWithIndCall=Options::SVFGWithIndirectCall(), bool _SVFGWithPostOpts=Options::OPTSVFG())
Constructor.
Definition SVFGBuilder.h:53
PointerAnalysis::CallEdgeMap CallEdgeMap
Definition SVFGBuilder.h:48
virtual void buildSVFG()
Can be rewritten by subclasses.
std::unique_ptr< SVFG > svfg
Definition SVFGBuilder.h:95
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