Static Value-Flow Analysis
Loading...
Searching...
No Matches
SparseAbstractInterpretation.h
Go to the documentation of this file.
1//===- SparseAbstractInterpretation.h -- Sparse Abstract Execution------//
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#ifndef INCLUDE_AE_SVFEXE_SPARSEABSTRACTINTERPRETATION_H_
24#define INCLUDE_AE_SVFEXE_SPARSEABSTRACTINTERPRETATION_H_
25
27#include <memory>
28
29namespace SVF
30{
31
32class SVFG;
33class SVFGBuilder;
34class IndirectSVFGEdge;
35class VFGNode;
36
44{
45public:
51
52protected:
54
56 const AbstractState& cur,
57 const ICFGCycleWTO* cycle) override;
58
60 const AbstractState& cur,
61 const ICFGCycleWTO* cycle) override;
62
63 const AbstractValue& getAbsValue(const ValVar* var, const ICFGNode* node) override;
65
66 bool hasAbsValue(const ValVar* var, const ICFGNode* node) const override;
68
69 void updateAbsValue(const ValVar* var, const AbstractValue& val, const ICFGNode* node) override;
71
72 void updateAbsState(const ICFGNode* node, const AbstractState& state) override;
73
74 void joinStates(AbstractState& dst, const AbstractState& src) override;
75
76 const ICFGNode* getICFGNode(const ValVar* var) const;
77};
78
86{
87public:
93
94protected:
101 void joinStates(AbstractState& dst, const AbstractState& src) override;
102
106 void storeValue(const ValVar* pointer, const AbstractValue& val,
107 const ICFGNode* node) override;
108
114 bool mergeStatesFromPredecessors(const ICFGNode* node) override;
115
123 const ICFGNode* succ) override;
124
125private:
129 void pullObjValueFlows(const ICFGNode* node);
130
135 const VFGNode* dst);
136
140 bool isICFGPathFeasible(const ICFGNode* src, const ICFGNode* dst);
141
144 const ICFGNode* src);
145
153 void propagateAndApplyRefinement(const ICFGNode* node);
154
162
164 void buildSVFG();
165
169 std::unique_ptr<SVFGBuilder> svfgBuilder;
171 SVFG* svfg{nullptr};
172};
173
174} // namespace SVF
175
176#endif /* INCLUDE_AE_SVFEXE_SPARSEABSTRACTINTERPRETATION_H_ */
newitem prev
Definition cJSON.cpp:2285
void initCycleValVars()
Definition AEWTO.cpp:98
virtual bool hasAbsValue(const ValVar *var, const ICFGNode *node) const
Side-effect-free existence check.
virtual const AbstractValue & getAbsValue(const ValVar *var, const ICFGNode *node)
virtual void updateAbsValue(const ValVar *var, const AbstractValue &val, const ICFGNode *node)
Map< const ICFGNode *, Map< NodeID, IntervalValue > > refinementTrace
void joinStates(AbstractState &dst, const AbstractState &src) override
bool isIntraEdgeBranchFeasible(const IntraCFGEdge *edge, const ICFGNode *src)
Return whether this intra edge is allowed by the current branch state.
bool mergeStatesFromPredecessors(const ICFGNode *node) override
bool isICFGPathFeasible(const ICFGNode *src, const ICFGNode *dst)
void storeValue(const ValVar *pointer, const AbstractValue &val, const ICFGNode *node) override
bool isIndirectSVFGEdgeFeasible(const IndirectSVFGEdge *edge, const VFGNode *dst)
void recordBranchRefinement(NodeID objId, const IntervalValue &narrowed, AbstractState &as, const ICFGNode *loadIcfg, const ICFGNode *succ) override
void buildSVFG()
Build the SVFG on top of the semi-sparse precompute.
SVFG * svfg
View pointer into svfgBuilder's graph; non-null after buildSVFG().
bool narrowCycleState(const AbstractState &prev, const AbstractState &cur, const ICFGCycleWTO *cycle) override
const AbstractValue & getAbsValue(const ValVar *var, const ICFGNode *node) override
AbstractState getFullCycleHeadState(const ICFGCycleWTO *cycle) override
void joinStates(AbstractState &dst, const AbstractState &src) override
~SemiSparseAbstractInterpretation() override=default
bool widenCycleState(const AbstractState &prev, const AbstractState &cur, const ICFGCycleWTO *cycle) override
void updateAbsValue(const ValVar *var, const AbstractValue &val, const ICFGNode *node) override
bool hasAbsValue(const ValVar *var, const ICFGNode *node) const override
Side-effect-free existence check.
void updateAbsState(const ICFGNode *node, const AbstractState &state) override
const ICFGNode * getICFGNode(const ValVar *var) const
for isBitcode
Definition BasicTypes.h:70
u32_t NodeID
Definition GeneralType.h:56
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76