|
FAUST compiler
0.9.9.6b8
|
#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 | |
| int | getMinDelay () const |
| return the minimal 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 | fMinDelay |
| Minimal fix delay usage. | |
| 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.
: fXVariability(xVariability(v,r)) { for (int i=0; i<4; i++) fOccurences[i]=0; fMultiOcc = false; fMaxDelay = 0; fOutDelayOcc = false; }
| int Occurences::getMaxDelay | ( | ) | const |
return the maximal delay collected
Definition at line 54 of file occurences.cpp.
References fMaxDelay.
Referenced by VectorCompiler::generateCacheCode(), ScalarCompiler::generateCacheCode(), DocCompiler::generateCacheCode(), ScalarCompiler::generateFConst(), DocCompiler::generateFConst(), VectorCompiler::generateFixDelay(), DocCompiler::generateFVar(), ScalarCompiler::generateNumber(), DocCompiler::generateNumber(), DocCompiler::generateRec(), and VectorCompiler::needSeparateLoop().
{
return fMaxDelay;
}

| int Occurences::getMinDelay | ( | ) | const |
return the minimal delay collected
| bool Occurences::hasMultiOccurences | ( | ) | const |
true if multiple occurences or occ. in higher ctxt
Definition at line 50 of file occurences.cpp.
References fMultiOcc.
{ return fMultiOcc; }
| bool Occurences::hasOutDelayOccurences | ( | ) | const |
true if has occurences outside a a delay
Definition at line 52 of file occurences.cpp.
References fOutDelayOcc.
{ 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().
{
int ctxt = xVariability(v,r);
//assert (ctxt >= fXVariability);
fOccurences[ctxt] += 1;
fMultiOcc = fMultiOcc | (ctxt > fXVariability) | (fOccurences[ctxt] > 1);
if (d == 0) {
//cerr << "Occurence outside a delay " << endl;
fOutDelayOcc = true;
}
if (d > fMaxDelay) {
//cerr << "Max delay : " << fMaxDelay << " <- " << d << endl;
fMaxDelay = d;
}
return this;
}


int Occurences::fMaxDelay [private] |
Maximal fix delay usage.
Definition at line 14 of file occurences.hh.
Referenced by getMaxDelay(), incOccurences(), and Occurences().
int Occurences::fMinDelay [private] |
Minimal fix delay usage.
Definition at line 13 of file occurences.hh.
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().
1.8.0