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
30#include "MSSA/SVFGBuilder.h"
31
32namespace SVF
33{
34
42{
43public:
45 {
46 preAnalysis->initCycleValVars();
47 }
49
50protected:
52
54 const AbstractState& cur,
55 const ICFGCycleWTO* cycle) override;
56
58 const AbstractState& cur,
59 const ICFGCycleWTO* cycle) override;
60
61 const AbstractValue& getAbsValue(const ValVar* var, const ICFGNode* node) override;
63
64 bool hasAbsValue(const ValVar* var, const ICFGNode* node) const override;
66
67 void updateAbsValue(const ValVar* var, const AbstractValue& val, const ICFGNode* node) override;
69
70 void updateAbsState(const ICFGNode* node, const AbstractState& state) override;
71
72 void joinStates(AbstractState& dst, const AbstractState& src) override;
73
74 const ICFGNode* getICFGNode(const ValVar* var) const;
75};
76
80{
81public:
87
90 void mergeFreedAddrs(AbstractState& dst, const AbstractState& src);
91
92protected:
94
100 void joinStates(AbstractState& dst, const AbstractState& src,
101 const NodeBS& objs);
102
105 bool mergeStatesFromPredecessors(const ICFGNode* node) override;
106
107private:
108 void buildSVFG();
109 // Owns the original SVFG and the prebuilt packed-Obj route graph.
110 std::unique_ptr<SVFGBuilder> svfgBuilder;
111 std::unique_ptr<SparseObjGraph> objRoutes;
112};
113
114} // namespace SVF
115
116#endif /* INCLUDE_AE_SVFEXE_SPARSEABSTRACTINTERPRETATION_H_ */
newitem prev
Definition cJSON.cpp:2285
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
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
WTOCycle< ICFG > ICFGCycleWTO
Definition ICFGWTO.h:49
SparseBitVector NodeBS
Definition GeneralType.h:82