23 #ifndef OTAWA_FLOWFACT_CONTEXTUALLOOPBOUND_H_
24 #define OTAWA_FLOWFACT_CONTEXTUALLOOPBOUND_H_
28 #include <elm/genstruct/Tree.h>
29 #include <elm/genstruct/Vector.h>
39 inline void push(
const T& addr) { stack.push(addr); }
40 inline T
pop(
void) {
return stack.pop(); }
41 inline const T&
top(
void)
const {
return stack.top(); }
42 inline int count(
void)
const {
return stack.length(); }
43 inline const T&
get(
int i)
const {
return stack[stack.length() - i - 1]; }
44 inline const T&
operator[](
int i)
const {
return get(i); }
45 inline bool isEmpty(
void)
const {
return stack.isEmpty(); }
46 inline operator bool(
void)
const {
return !isEmpty(); }
47 inline void clear(
void) { stack.clear(); }
65 static const int undefined = -1;
81 int _total = undefined)
82 : fun(_fun),
max(_max), total(_total) { }
data_t(Address _fun=Address::null, int _max=undefined, int _total=undefined)
Definition: ContextualLoopBound.h:78
Address fun
Definition: ContextualLoopBound.h:83
int total
Definition: ContextualLoopBound.h:84
Definition: ContextualLoopBound.h:55
bool isEmpty(void) const
Definition: ContextualLoopBound.h:45
A contextual loop bound is a collection of loop bound (including max iteration and total iteration nu...
Definition: ContextualLoopBound.h:63
const T & operator[](int i) const
Shortcut to get().
Definition: ContextualLoopBound.h:44
T pop(void)
Remove the top call from the call stack.
Definition: ContextualLoopBound.h:40
Definition: ContextualLoopBound.h:77
genstruct::Vector< T > stack
Definition: ContextualLoopBound.h:50
genstruct::Tree< data_t > tree
Definition: ContextualLoopBound.h:86
AmbiguousBoundException(const string &message)
Definition: ContextualLoopBound.h:57
This class is a stack to store call chain in the program call graph.
Definition: ContextualLoopBound.h:37
void push(const T &addr)
Add a call to the call stack (becoming the new top call).
Definition: ContextualLoopBound.h:39
The representation of an address in OTAWA.
Definition: base.h:54
int count(void) const
Get the count of calls in the path.
Definition: ContextualLoopBound.h:42
static Address null
Null address.
Definition: base.h:58
const T & top(void) const
Return the top function call.
Definition: ContextualLoopBound.h:41
intn_t max(intn_t a, intn_t b)
Return the max with a signed comparison.
Definition: clp_analysis.cpp:180
void clear(void)
Definition: ContextualLoopBound.h:47
Definition: features.h:29