#include <occurences.hh>
Public Member Functions | |
Occurences (int v, int r) | |
Occurences * | incOccurences (int v, int r, int d) |
inc occurences in context v,r,d | |
bool | hasMultiOccurences () const |
true if multiple occurences or occ. in higher ctxt | |
bool | hasOutDelayOccurences () const |
true if has occurences outside a a delay | |
int | getMaxDelay () const |
return the maximal delay collected | |
Private Attributes | |
const int | fXVariability |
Extended Variability of the expression. | |
int | fOccurences [4] |
Occurences count according to Contexts. | |
bool | fMultiOcc |
True when exp has multiple occ. or occ. in higher ctxt. | |
bool | fOutDelayOcc |
True when exp has at least one occ. outside a delay. | |
int | fMaxDelay |
Maximal fix delay usage. |
Definition at line 7 of file occurences.hh.
Occurences::Occurences | ( | int | v, | |
int | r | |||
) |
Definition at line 27 of file occurences.cpp.
References fMaxDelay, fMultiOcc, fOccurences, and fOutDelayOcc.
00027 : fXVariability(xVariability(v,r)) { 00028 for (int i=0; i<4; i++) fOccurences[i]=0; 00029 fMultiOcc = false; 00030 fMaxDelay = 0; 00031 fOutDelayOcc = false; 00032 }
int Occurences::getMaxDelay | ( | ) | const |
return the maximal delay collected
Definition at line 54 of file occurences.cpp.
References fMaxDelay.
Referenced by DocCompiler::generateCacheCode(), VectorCompiler::generateCacheCode(), ScalarCompiler::generateCacheCode(), DocCompiler::generateFConst(), ScalarCompiler::generateFConst(), VectorCompiler::generateFixDelay(), ScalarCompiler::generateFixDelay(), DocCompiler::generateFVar(), ScalarCompiler::generateFVar(), DocCompiler::generateNumber(), ScalarCompiler::generateNumber(), DocCompiler::generateRec(), ScalarCompiler::generateRec(), and VectorCompiler::needSeparateLoop().
00055 { 00056 return fMaxDelay; 00057 }
bool Occurences::hasMultiOccurences | ( | ) | const |
true if multiple occurences or occ. in higher ctxt
Definition at line 50 of file occurences.cpp.
References fMultiOcc.
00050 { return fMultiOcc; }
bool Occurences::hasOutDelayOccurences | ( | ) | const |
true if has occurences outside a a delay
Definition at line 52 of file occurences.cpp.
References fOutDelayOcc.
00052 { return fOutDelayOcc; }
Occurences * Occurences::incOccurences | ( | int | v, | |
int | r, | |||
int | d | |||
) |
inc occurences in context v,r,d
Definition at line 34 of file occurences.cpp.
References fMaxDelay, fMultiOcc, fOccurences, fOutDelayOcc, fXVariability, and xVariability().
Referenced by OccMarkup::incOcc().
00034 { 00035 int ctxt = xVariability(v,r); 00036 //assert (ctxt >= fXVariability); 00037 fOccurences[ctxt] += 1; 00038 fMultiOcc = fMultiOcc | (ctxt > fXVariability) | (fOccurences[ctxt] > 1); 00039 if (d == 0) { 00040 //cerr << "Occurence outside a delay " << endl; 00041 fOutDelayOcc = true; 00042 } 00043 if (d > fMaxDelay) { 00044 //cerr << "Max delay : " << fMaxDelay << " <- " << d << endl; 00045 fMaxDelay = d; 00046 } 00047 return this; 00048 }
int Occurences::fMaxDelay [private] |
Maximal fix delay usage.
Definition at line 13 of file occurences.hh.
Referenced by getMaxDelay(), incOccurences(), and Occurences().
bool Occurences::fMultiOcc [private] |
True when exp has multiple occ. or occ. in higher ctxt.
Definition at line 11 of file occurences.hh.
Referenced by hasMultiOccurences(), incOccurences(), and Occurences().
int Occurences::fOccurences[4] [private] |
Occurences count according to Contexts.
Definition at line 10 of file occurences.hh.
Referenced by incOccurences(), and Occurences().
bool Occurences::fOutDelayOcc [private] |
True when exp has at least one occ. outside a delay.
Definition at line 12 of file occurences.hh.
Referenced by hasOutDelayOccurences(), incOccurences(), and Occurences().
const int Occurences::fXVariability [private] |
Extended Variability of the expression.
Definition at line 9 of file occurences.hh.
Referenced by incOccurences().