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
26#include <memory>
27
29#include "MSSA/SVFGBuilder.h"
30
31namespace SVF
32{
33
34class SVFG;
35class SVFGBuilder;
36class IndirectSVFGEdge;
37class VFGNode;
38
46{
47public:
53
54protected:
56
58 const AbstractState& cur,
59 const ICFGCycleWTO* cycle) override;
60
62 const AbstractState& cur,
63 const ICFGCycleWTO* cycle) override;
64
65 const AbstractValue& getAbsValue(const ValVar* var, const ICFGNode* node) override;
67
68 bool hasAbsValue(const ValVar* var, const ICFGNode* node) const override;
70
71 void updateAbsValue(const ValVar* var, const AbstractValue& val, const ICFGNode* node) override;
73
74 void updateAbsState(const ICFGNode* node, const AbstractState& state) override;
75
76 void joinStates(AbstractState& dst, const AbstractState& src) override;
77
78 const ICFGNode* getICFGNode(const ValVar* var) const;
79};
80
88{
89public:
95
96protected:
103 void joinStates(AbstractState& dst, const AbstractState& src) override;
104
108 void storeValue(const ValVar* pointer, const AbstractValue& val,
109 const ICFGNode* node) override;
110
116 bool mergeStatesFromPredecessors(const ICFGNode* node) override;
117
125 const ICFGNode* succ) override;
126
127private:
131 void pullObjValueFlows(const ICFGNode* node);
132
137 const VFGNode* dst);
138
142 bool isICFGPathFeasible(const ICFGNode* src, const ICFGNode* dst);
143
146 const ICFGNode* src);
147
155 void propagateAndApplyRefinement(const ICFGNode* node);
156
164
166 void buildSVFG();
167
171 std::unique_ptr<SVFGBuilder> svfgBuilder;
173 SVFG* svfg{nullptr};
174};
175
176} // namespace SVF
177
178#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:76
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76