|
OTAWA
2.0
Framework to perform machine analysis and compute WCET.
|
Go to the documentation of this file.
19 #ifndef OTAWA_PROP_CONTEXTUALPROPERTY_H_
20 #define OTAWA_PROP_CONTEXTUALPROPERTY_H_
22 #include <elm/inhstruct/Tree.h>
56 { _kind = step.
_kind; addr = step.
addr;
return *
this; }
62 {
return _kind == step.
kind() && addr == step.
address(); }
112 : s(step), n(next) { }
116 int count(
void)
const;
143 inline const T &
get (
void)
const {
return cp.get(i,
p); }
144 inline operator const T &(
void)
const {
return get(); }
154 inline Ref<T> &operator+= (
const T &v)
const {
ref() += v;
return *
this; }
155 inline Ref<T> &operator-= (
const T &v)
const {
ref() -= v;
return *
this; }
156 inline Ref<T> &operator *= (
const T &v)
const {
ref() *= v;
return *
this; }
157 inline Ref<T> &operator/= (
const T &v)
const {
ref() /= v;
return *
this; }
158 inline Ref<T> &operator%= (
const T &v)
const {
ref() %= v;
return *
this; }
159 inline Ref<T> &operator &= (
const T &v)
const {
ref() &= v;
return *
this; }
160 inline Ref<T> &operator|= (
const T &v)
const {
ref() |= v;
return *
this; }
161 inline Ref<T> &operator^= (
const T &v)
const {
ref() ^= v;
return *
this; }
162 inline Ref<T> &operator<<= (
const T &v)
const {
ref() <<= v;
return *
this; }
163 inline Ref<T> &operator>>= (
const T &v)
const {
ref() >>= v;
return *
this; }
164 inline Ref<T> &operator++ (
void)
const {
ref()++;
return *
this; }
165 inline Ref<T> &operator-- (
void)
const {
ref()--;
return *
this; }
166 inline Ref<T> &operator++ (
int)
const {
ref()++;
return *
this; }
167 inline Ref<T> &operator-- (
int)
const {
ref()--;
return *
this; }
181 inline void pop(
void) { ASSERT(&
p);
p =
p->next(); }
183 inline bool isEmpty(
void)
const {
return p.isNull(); }
184 inline int count(
void)
const {
return p.isNull() ? 0 :
p->count(); }
187 inline operator bool(
void)
const {
return !isEmpty(); }
191 Address getEnclosingFunction(
void)
const;
195 return id.value(fprops);
199 {
return Ref<T>(*
this, props,
id); }
201 {
return get(
id, *props); }
203 {
return ref(
id, *props); }
206 {
return get(
id, *props); }
208 {
return get(
id, props); }
210 {
return ref(
id, *props); }
212 {
return ref(
id, props); }
T & ref(void) const
Definition: ContextualProperty.h:151
void removeProp(const AbstractIdentifier *id)
Remove a property matching the given identifier.
Definition: prop_PropList.cpp:431
const Identifier< T > & identifier(void) const
Definition: ContextualProperty.h:141
void print(io::Output &out) const
Definition: prop_ContextualProperty.cpp:98
typename type_info< T >::out_t out
@ OTHER_ITER
Definition: ContextualProperty.h:46
Ref< T > ref(const Identifier< T > &id, PropList &props) const
Definition: ContextualProperty.h:198
Definition: ContextualProperty.h:77
Printable< T, M > p(const T &data, const M &man)
void push(ContextualStep::kind_t kind, const Address &addr)
Definition: ContextualProperty.h:180
const ContextualList * list(void) const
Definition: ContextualProperty.h:189
Ref< T > ref(const Identifier< T > &id, PropList *props) const
Definition: ContextualProperty.h:202
Indent indent(int n=1)
Definition: display.h:187
Ref< T > operator()(const Identifier< T > &id, PropList *props) const
Definition: ContextualProperty.h:209
void print(io::Output &out) const
Print the contextual path.
Definition: prop_ContextualProperty.cpp:128
bool isEmpty(void) const
Definition: ContextualProperty.h:183
@ FIRST_ITER
Definition: ContextualProperty.h:45
const ContextualPath & cp
Definition: ContextualProperty.h:170
mut< T > ref(var< T > &x)
T & operator&(void) const
Definition: ContextualProperty.h:152
bool equals(const C1 &c1, const C2 &c2)
ContextualStep & operator=(const ContextualStep &step)
Definition: ContextualProperty.h:55
const Identifier< T > & i
Definition: ContextualProperty.h:172
void remove(void) const
Definition: ContextualProperty.h:150
const ContextualStep & operator[](int i) const
Definition: ContextualProperty.h:186
const T & operator()(const Identifier< T > &id, const PropList &props) const
Definition: ContextualProperty.h:207
const Ref< T > & add(const T &value) const
Definition: ContextualProperty.h:149
const Ref< T > & operator=(const T &v) const
Definition: ContextualProperty.h:153
@ CALL
Definition: ContextualProperty.h:44
@ FUNCTION
Definition: ContextualProperty.h:43
kind_t kind(void) const
Definition: ContextualProperty.h:58
Definition: ContextualProperty.h:39
Definition: AbstractIdentifier.h:33
static bool exists(const PropList &props, const ContextualPath &path, const AbstractIdentifier &id)
Test if a contextual property exists, that is, the property value is defined at any step of the given...
Definition: prop_ContextualProperty.cpp:282
static const PropList & find(const PropList &props, const ContextualPath &path, const AbstractIdentifier &id)
Get a contextual property from a property list.
Definition: prop_ContextualProperty.cpp:243
bool equals(const ContextualStep &step) const
Definition: ContextualProperty.h:61
Definition: ContextualProperty.h:127
void clear(void)
Definition: ContextualProperty.h:178
bool operator==(const ContextualStep &step) const
Definition: ContextualProperty.h:63
ContextualStep step
Definition: ContextualProperty.h:84
C::Iter find(const C &c, const P &p)
const Address & address(void) const
Definition: ContextualProperty.h:59
Node(void)
Definition: ContextualProperty.h:82
Inst::kind_t kind
Definition: odisasm.cpp:113
const PropList & proplist(void) const
Definition: ContextualProperty.h:140
kind_t
Definition: ContextualProperty.h:41
Node(const ContextualStep &_step)
Definition: ContextualProperty.h:83
value("ANY", otawa::display::OUTPUT_ANY) .value("PS"
const ContextualPath & path(void) const
Definition: ContextualProperty.h:139
Definition: Identifier.h:50
kind_t
Allowed types for values: NONE represents nothing; REG is only used for addresses,...
Definition: ClpValue.h:51
@ AFTER
Definition: ContextualProperty.h:47
Node root
Definition: ContextualProperty.h:103
kind_t _kind
Definition: ContextualProperty.h:69
const T & get(const Identifier< T > &id, const PropList *props) const
Definition: ContextualProperty.h:200
ContextualStep s
Definition: ContextualProperty.h:121
T operator->(void) const
Definition: ContextualProperty.h:145
void push(const ContextualStep &step)
Definition: ContextualProperty.h:179
const T & get(void) const
Definition: ContextualProperty.h:143
static PropList & ref(PropList &props, const ContextualPath &path, const AbstractIdentifier &id)
Obtain a reference on a property value in the given contextual path.
Definition: prop_ContextualProperty.cpp:305
const T & operator()(const Identifier< T > &id, const PropList *props) const
Definition: ContextualProperty.h:205
Definition: ContextualProperty.h:108
const T & get(const Identifier< T > &id, const PropList &props) const
Definition: ContextualProperty.h:193
Ref(const Ref< T > &r)
Definition: ContextualProperty.h:135
ContextualList(const ContextualStep &step, const LockPtr< ContextualList > next)
Definition: ContextualProperty.h:111
const ContextualStep & step(void) const
Definition: ContextualProperty.h:114
LockPtr< ContextualList > n
Definition: ContextualProperty.h:122
elm::io::Output & operator<<(elm::io::Output &out, Address addr)
Definition: base.cpp:209
LockPtr< ContextualList > p
Definition: ContextualProperty.h:215
bool exists(void) const
Definition: ContextualProperty.h:142
ret< T > get(const var< T > &v)
int count(const C &c, const P &p)
ContextualPath(void)
Definition: ContextualProperty.h:176
Definition: ContextualProperty.h:80
Ref(const ContextualPath &_cp, PropList &_p, const Identifier< T > &_i)
Definition: ContextualProperty.h:134
bool exists(const C &c, const P &p)
Ref< T > operator()(const Identifier< T > &id, PropList &props) const
Definition: ContextualProperty.h:211
static PropList & make(PropList &props, const ContextualPath &path)
Set a contextual property.
Definition: prop_ContextualProperty.cpp:262
Definition: PropList.h:67
static AbstractIdentifier ID
Private identifier for contextual properties.
Definition: ContextualProperty.h:104
void pop(void)
Definition: ContextualProperty.h:181
void print(Output &out, const T &v)
Definition: Identifier.h:43
Definition: PropList.h:43
LockPtr< ContextualList > next(void) const
Definition: ContextualProperty.h:115
Property * make(const Identifier< T > &id, const T &v)
Definition: info.h:31
bool operator!=(const ContextualStep &step) const
Definition: ContextualProperty.h:64
Definition: ContextualProperty.h:132
ContextualList(const ContextualStep &step)
Definition: ContextualProperty.h:110
ContextualStep(kind_t kind, const Address &address)
Definition: ContextualProperty.h:51
Ref< T > & operator=(const Ref< T > &r)
Definition: ContextualProperty.h:136
PropList & p
Definition: ContextualProperty.h:171
Development Note Letting the ToDo / ToDoList class visible in the header is clumsy.
Definition: ArrayStore.h:25
const ContextualStep & step(int i) const
Definition: ContextualProperty.h:185
Address addr
Definition: ContextualProperty.h:70
int count(void) const
Definition: ContextualProperty.h:184
const ContextualStep & operator[](int i) const
Definition: ContextualProperty.h:118
void print(io::Output &out)
Definition: ContextualProperty.h:146
ContextualStep(void)
Definition: ContextualProperty.h:50