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
28namespace SVF
29{
30
31class SVFG;
32
40{
41public:
47
48protected:
50
52 const AbstractState& cur,
53 const ICFGCycleWTO* cycle) override;
54
56 const AbstractState& cur,
57 const ICFGCycleWTO* cycle) override;
58
59 const AbstractValue& getAbsValue(const ValVar* var, const ICFGNode* node) override;
61
62 bool hasAbsValue(const ValVar* var, const ICFGNode* node) const override;
64
65 void updateAbsValue(const ValVar* var, const AbstractValue& val, const ICFGNode* node) override;
67
68 void updateAbsState(const ICFGNode* node, const AbstractState& state) override;
69
70 void joinStates(AbstractState& dst, const AbstractState& src) override;
71
72 const ICFGNode* getICFGNode(const ValVar* var) const;
73};
74
84{
85public:
91
92 // Full-sparse ValVar resolution will route through the SVFG once
93 // implemented; fail loudly until then rather than silently inherit
94 // semi-sparse semantics.
95 const AbstractValue& getAbsValue(const ValVar* var, const ICFGNode* node) override;
97
98 bool hasAbsValue(const ValVar* var, const ICFGNode* node) const override;
100
102 const ICFGNode* getDefSiteOfValVar(const ValVar* var) const;
105 const Set<const ICFGNode*> getDefSiteOfObjVar(const ObjVar* obj, const ICFGNode* node) const;
108 const Set<const ICFGNode*> getUseSitesOfObjVar(const ObjVar* obj, const ICFGNode* node) const;
109
110protected:
112 void buildSVFG();
113
114 SVFG* svfg{nullptr};
115};
116
117} // namespace SVF
118
119#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)
const ICFGNode * getDefSiteOfValVar(const ValVar *var) const
const Set< const ICFGNode * > getDefSiteOfObjVar(const ObjVar *obj, const ICFGNode *node) const
bool hasAbsValue(const ValVar *var, const ICFGNode *node) const override
Side-effect-free existence check.
const Set< const ICFGNode * > getUseSitesOfValVar(const ValVar *var) const
const AbstractValue & getAbsValue(const ValVar *var, const ICFGNode *node) override
void buildSVFG()
Build the SVFG on top of the semi-sparse precompute.
const Set< const ICFGNode * > getUseSitesOfObjVar(const ObjVar *obj, const ICFGNode *node) const
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