Static Value-Flow Analysis
Loading...
Searching...
No Matches
SaberSVFGBuilder.h
Go to the documentation of this file.
1//===- SaberSVFGBuilder.h -- Building SVFG for Saber--------------------------//
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 * SaberSVFGBuilder.h
25 *
26 * Created on: May 1, 2014
27 * Author: Yulei Sui
28 */
29
30#ifndef SABERSVFGBUILDER_H_
31#define SABERSVFGBUILDER_H_
32
33#include "Graphs/SVFG.h"
34#include "MSSA/SVFGBuilder.h"
35#include "Util/GeneralType.h"
36#include "Util/WorkList.h"
37
38
39namespace SVF
40{
41
42class BVDataPTAImpl;
43class CallICFGNode;
44class SaberCondAllocator;
45class ValVar;
46
48{
49
50public:
54
57
59 virtual ~SaberSVFGBuilder() {}
60
61 inline bool isGlobalSVFGNode(const SVFGNode* node) const
62 {
63 return globSVFGNodes.find(node)!=globSVFGNodes.end();
64 }
65
67 inline void addActualParmVFGNode(const ValVar* svfVar, const CallICFGNode* cs)
68 {
69 svfg->addActualParmVFGNode(svfVar, cs);
70 }
71
73 {
74 saberCondAllocator = allocator;
75 }
76
77protected:
79 virtual void buildSVFG();
80
82 bool isStrongUpdate(const SVFGNode* node, NodeID& singleton, BVDataPTAImpl* pta);
83
84protected:
89
92 virtual void rmIncomingEdgeForSUStore(BVDataPTAImpl* pta);
93
96 virtual void AddExtActualParmSVFGNodes(CallGraph* callgraph);
97
101 void collectGlobals(BVDataPTAImpl* pta);
102
104 bool accessGlobal(BVDataPTAImpl* pta,const SVFVar* svfVar);
105
108
112
114};
115
116} // End namespace SVF
117
118#endif /* SABERSVFGBUILDER_H_ */
#define true
Definition cJSON.cpp:65
std::unique_ptr< SVFG > svfg
Definition SVFGBuilder.h:95
virtual ~SaberSVFGBuilder()
Destructor.
bool isStrongUpdate(const SVFGNode *node, NodeID &singleton, BVDataPTAImpl *pta)
Return TRUE if this is a strong update STORE statement.
Set< const SVFGNode * > SVFGNodeSet
void addActualParmVFGNode(const ValVar *svfVar, const CallICFGNode *cs)
Add ActualParmVFGNode.
void collectGlobals(BVDataPTAImpl *pta)
PointsTo & CollectPtsChain(BVDataPTAImpl *pta, NodeID id, NodeToPTSSMap &cachedPtsMap)
Collect objects along points-to chains.
Map< NodeID, PointsTo > NodeToPTSSMap
virtual void buildSVFG()
Re-write create SVFG method.
FIFOWorkList< NodeID > WorkList
void setSaberCondAllocator(SaberCondAllocator *allocator)
SVFGNodeSet globSVFGNodes
Store all global SVFG nodes.
SaberSVFGBuilder()
Constructor.
bool accessGlobal(BVDataPTAImpl *pta, const SVFVar *svfVar)
Whether points-to of a SVFVar points-to global variable.
virtual void AddExtActualParmSVFGNodes(CallGraph *callgraph)
Add actual parameter SVFGNode for 1st argument of a deallocation like external function.
SaberCondAllocator * saberCondAllocator
void rmDerefDirSVFGEdges(BVDataPTAImpl *pta)
virtual void rmIncomingEdgeForSUStore(BVDataPTAImpl *pta)
bool isGlobalSVFGNode(const SVFGNode *node) const
for isBitcode
Definition BasicTypes.h:70
u32_t NodeID
Definition GeneralType.h:76
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76