Static Value-Flow Analysis
Loading...
Searching...
No Matches
MemPartition.h
Go to the documentation of this file.
1//===- MemPartition.h -- Memory region partition-----------------------------//
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: DisnctMRGenerator.h
25 * @author: yesen
26 * @date: 07/12/2013
27 * @version: 1.0
28 *
29 * @section LICENSE
30 *
31 * @section DESCRIPTION
32 *
33 */
34
35
36#ifndef DISNCTMRGENERATOR_H_
37#define DISNCTMRGENERATOR_H_
38
39#include "MSSA/MemRegion.h"
40#include "Util/GeneralType.h"
41
42namespace SVF
43{
44
49{
50public:
53
55
56protected:
58 virtual void partitionMRs();
59
61 virtual void getMRsForLoad(MRSet& aliasMRs, const NodeBS& cpts, const FunObjVar* fun);
62
64 virtual void getMRsForCallSiteRef(MRSet& aliasMRs, const NodeBS& cpts, const FunObjVar* fun);
65private:
67 void createDistinctMR(const FunObjVar* func, const NodeBS& cpts);
68
69};
70
75{
76public:
80
83
85
86protected:
87
89 virtual void partitionMRs();
90
97 virtual inline void getMRsForLoad(MRSet& aliasMRs, const NodeBS& cpts,
98 const FunObjVar* fun)
99 {
100 const PointsToList& inters = getIntersList(fun);
102 }
103
104 void getMRsForLoadFromInterList(MRSet& mrs, const NodeBS& cpts, const PointsToList& inters);
105
107 virtual void getMRsForCallSiteRef(MRSet& aliasMRs, const NodeBS& cpts, const FunObjVar* fun);
108
110 void createDisjointMR(const FunObjVar* func, const NodeBS& cpts);
111
113 void computeIntersections(const NodeBS& cpts, PointsToList& inters);
114
115private:
117 {
118 return funcToPtsMap[func];
119 }
120
122 {
123 return funcToInterMap[func];
124 }
125
126 inline const PtsToSubPtsMap& getPtsSubSetMap(const FunObjVar* func) const
127 {
128 FunToPtsMap::const_iterator it = funcToPtsMap.find(func);
129 assert(it != funcToPtsMap.end() && "can not find pts map for specified function");
130 return it->second;
131 }
132
135};
136
141{
142public:
145
147
148protected:
150 virtual void partitionMRs();
151
158 virtual inline void getMRsForLoad(MRSet& aliasMRs, const NodeBS& cpts,
159 const FunObjVar*)
160 {
162 }
163
164private:
166};
167
168} // End namespace SVF
169
170#endif /* DISNCTMRGENERATOR_H_ */
cJSON * p
Definition cJSON.cpp:2559
virtual void partitionMRs()
Partition regions.
virtual void getMRsForCallSiteRef(MRSet &aliasMRs, const NodeBS &cpts, const FunObjVar *fun)
Get memory regions to be inserted at a load statement.
void createDistinctMR(const FunObjVar *func, const NodeBS &cpts)
Create memory regions for each points-to target.
virtual void getMRsForLoad(MRSet &aliasMRs, const NodeBS &cpts, const FunObjVar *fun)
Get memory region at a load.
DistinctMRG(BVDataPTAImpl *p, bool ptrOnly)
virtual void getMRsForLoad(MRSet &aliasMRs, const NodeBS &cpts, const FunObjVar *)
virtual void partitionMRs()
Partition regions.
InterDisjointMRG(BVDataPTAImpl *p, bool ptrOnly)
Map< const FunObjVar *, PtsToSubPtsMap > FunToPtsMap
OrderedMap< NodeBS, PointsToList > PtsToSubPtsMap
virtual void partitionMRs()
Partition regions.
PointsToList & getIntersList(const FunObjVar *func)
void getMRsForLoadFromInterList(MRSet &mrs, const NodeBS &cpts, const PointsToList &inters)
Map< const FunObjVar *, PointsToList > FunToInterMap
void createDisjointMR(const FunObjVar *func, const NodeBS &cpts)
Create disjoint memory region.
FunToInterMap funcToInterMap
virtual void getMRsForLoad(MRSet &aliasMRs, const NodeBS &cpts, const FunObjVar *fun)
void computeIntersections(const NodeBS &cpts, PointsToList &inters)
Compute intersections between cpts and computed cpts intersections before.
IntraDisjointMRG(BVDataPTAImpl *p, bool ptrOnly)
PtsToSubPtsMap & getPtsSubSetMap(const FunObjVar *func)
virtual void getMRsForCallSiteRef(MRSet &aliasMRs, const NodeBS &cpts, const FunObjVar *fun)
Get memory regions to be inserted at a load statement.
const PtsToSubPtsMap & getPtsSubSetMap(const FunObjVar *func) const
OrderedSet< NodeBS, SVFUtil::equalNodeBS > PointsToList
Definition MemRegion.h:147
OrderedSet< const MemRegion *, MemRegion::equalMemRegion > MRSet
Get typedef from Pointer Analysis.
Definition MemRegion.h:145
for isBitcode
Definition BasicTypes.h:70
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76