24 #ifndef OTAWA_DFA_HAI_DEFAULTFIXPOINT_H_
25 #define OTAWA_DFA_HAI_DEFAULTFIXPOINT_H_
33 #include <elm/genstruct/Vector.h>
35 namespace otawa {
namespace dfa {
namespace hai {
37 template <
class Listener>
40 typedef typename Listener::Problem
Problem;
41 typedef typename Problem::Domain
Domain;
85 template <
class Listener >
91 template <
class Listener >
95 Domain newHeaderState(bottom());
100 assign(newHeaderState, ai->entryEdgeUnion(bb));
102 assign(newHeaderState, ai->entryEdgeUnion(bb));
103 prob.lub(newHeaderState, ai->backEdgeUnion(bb));
104 if (prob.equals(newHeaderState, fpstate->
headerState))
109 assign(in, newHeaderState);
112 template <
class Listener >
124 prob.lub(**
STATE(e), s);
126 ASSERT(prob.equals(tmp,s));
129 template <
class Listener >
135 template <
class Listener >
140 template <
class Listener >
142 return(prob.bottom());
145 template <
class Listener >
147 return(prob.entry());
150 template <
class Listener >
155 template <
class Listener >
160 template <
class Listener >
162 return (prob.equals(a,b));
165 template <
class Listener >
170 template <
class Listener >
172 prob.update(out,in,bb);
175 template <
class Listener >
177 list.blockInterpreted(
this, bb, in, out, cur_cfg, callStack);
180 template <
class Listener >
182 list.fixPointReached(
this, bb);
185 template <
class Listener >
187 prob.enterContext(dom, bb, ctx);
190 template <
class Listener >
192 prob.leaveContext(dom, bb, ctx);
static Identifier< Domain * > STATE
Definition: DefaultFixPoint.h:44
DefaultFixPoint(Listener &_list)
Definition: DefaultFixPoint.h:56
Definition: DefaultFixPoint.h:38
Definition: DefaultFixPoint.h:50
dtd::Element edge(dtd::make("edge", _EDGE).attr(source).attr(target).attr(called))
FixPointState(const Domain &bottom)
Definition: DefaultFixPoint.h:53
const Domain & bottom(void) const
This function gets the bottom of the problem's lattice This is usually delegated to the Problem...
Definition: DefaultFixPoint.h:141
void enterContext(Domain &dom, BasicBlock *bb, hai_context_t ctx) const
This is called whenever we enter a loop.
Definition: DefaultFixPoint.h:186
Domain * getMark(PropList *e)
Get the mark of a proplist (typically an edge)
Definition: DefaultFixPoint.h:136
Listener & list
Definition: DefaultFixPoint.h:46
void init(HalfAbsInt< DefaultFixPoint > *_ai)
Is called by HalfAbsInt for fixpoint object initializeation.
Definition: DefaultFixPoint.h:86
bool equals(const Domain &a, const Domain &b) const
Tests a and b for equality.
Definition: DefaultFixPoint.h:161
HalfAbsInt< DefaultFixPoint > * ai
Definition: DefaultFixPoint.h:47
Problem::Domain Domain
Definition: DefaultFixPoint.h:41
Listener::Problem Problem
Definition: DefaultFixPoint.h:40
void fixPoint(BasicBlock *bb, bool &fixpoint, Domain &in, bool firstTime) const
Main fixPoint function: is called by HalfAbsInt whenever the analysis reaches a loop header...
Definition: DefaultFixPoint.h:92
void assign(Domain &a, const Domain &b) const
Performs operation a = b This is delegated to the Problem.
Definition: DefaultFixPoint.h:156
void lub(Domain &a, const Domain &b) const
Performs operation: a = a lub b This is delegated to the Problem.
Definition: DefaultFixPoint.h:151
void fixPointReached(BasicBlock *bb) const
This listener is called whenever a fixpoint is reached for a loop.
Definition: DefaultFixPoint.h:181
void blockInterpreted(BasicBlock *bb, const Domain &in, const Domain &out, CFG *cur_cfg, elm::genstruct::Vector< Edge * > *callStack) const
This listener is called whenever HalfAbsInt has processed a basic block.
Definition: DefaultFixPoint.h:176
dtd::Element bb(dtd::make("bb", _BB).attr(id).attr(address).attr(size))
Control Flow Graph representation.
Definition: CFG.h:42
const Domain & entry(void) const
This function returns the entry state of the whole program to be analyzed.
Definition: DefaultFixPoint.h:146
void unmarkEdge(PropList *e)
Unmark a proplist (typically an edge)
Definition: DefaultFixPoint.h:130
FixPointState * newState(void)
Definition: DefaultFixPoint.h:59
Implements abstract interpretation.
Definition: HalfAbsInt.h:64
Problem & prob
Definition: DefaultFixPoint.h:45
Identifier< State * > STATE("otawa::stack::STATE", 0)
Stack analysis state at entry of BBs.
sys::SystemOutStream & out
~DefaultFixPoint()
Definition: DefaultFixPoint.h:57
hai_context_t
Definition: HalfAbsInt.h:50
Domain headerState
Definition: DefaultFixPoint.h:52
void markEdge(PropList *e, const Domain &s)
Marks a proplist (typically an edge) e with state s.
Definition: DefaultFixPoint.h:113
This class represents edges in the CFG representation.
Definition: Edge.h:33
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
void leaveContext(Domain &dom, BasicBlock *bb, hai_context_t ctx) const
This is called whenever we leave a loop.
Definition: DefaultFixPoint.h:191
This a list of properties.
Definition: PropList.h:63
void update(Domain &out, const Domain &in, BasicBlock *bb)
Is called whenever the analysis needs to get the Output state for a basic block, given its input stat...
Definition: DefaultFixPoint.h:171
void updateEdge(Edge *edge, Domain &dom)
Definition: DefaultFixPoint.h:166