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
41{
42public:
48
49protected:
51
53 const AbstractState& cur,
54 const ICFGCycleWTO* cycle) override;
55
57 const AbstractState& cur,
58 const ICFGCycleWTO* cycle) override;
59
60 const AbstractValue& getAbsValue(const ValVar* var, const ICFGNode* node) override;
62
63 bool hasAbsValue(const ValVar* var, const ICFGNode* node) const override;
65
66 void updateAbsValue(const ValVar* var, const AbstractValue& val, const ICFGNode* node) override;
68
69 void updateAbsState(const ICFGNode* node, const AbstractState& state) override;
70
71 void joinStates(AbstractState& dst, const AbstractState& src) override;
72
73 const ICFGNode* getICFGNode(const ValVar* var) const;
74};
75
76// TODO: write comments, step 1 2 3
78{
79public:
85
88 void mergeFreedAddrs(AbstractState& dst, const AbstractState& src);
89
90protected:
92
98 void joinStates(AbstractState& dst, const AbstractState& src,
99 const NodeBS& objs);
100
104 bool mergeStatesFromPredecessors(const ICFGNode* node) override;
105
106private:
114
127 const AbstractState& input);
128
129 void buildSVFG();
130 // Owns the graph whose VFG nodes are indexed by their ICFG nodes.
131 std::unique_ptr<SVFGBuilder> svfgBuilder;
132};
133
134} // namespace SVF
135
136#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)
void joinStates(AbstractState &dst, const AbstractState &src, const NodeBS &objs)
bool mergeStatesFromPredecessors(const ICFGNode *node) override
AbstractState filterValueFlowInputByPath(const VFGEdge *edge, const AbstractState &input)
AbstractState CollectObjValueFlowInput(const VFGEdge *edge, NodeBS &objs)
void mergeFreedAddrs(AbstractState &dst, const AbstractState &src)
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
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76