Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > aaf33964de706a538481c929c1da6a44 > files > 4592

faust-doc-0.9.10-5mdv2010.1.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>FAUST compiler: loop.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>loop.cpp</h1><a href="loop_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &quot;<a class="code" href="loop_8hh.html">loop.hh</a>&quot;</span>
<a name="l00002"></a>00002 <span class="keyword">extern</span> <span class="keywordtype">bool</span> <a class="code" href="klass_8cpp.html#a44285cbe41b6d58a00854fead2999187">gVectorSwitch</a>;
<a name="l00003"></a>00003 
<a name="l00004"></a>00004 <span class="keyword">using namespace </span>std;
<a name="l00005"></a>00005 
<a name="l00011"></a><a class="code" href="loop_8cpp.html#abed9b9736f021c30889c9f50fe59184d">00011</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a> (<span class="keywordtype">int</span> n, ostream&amp; fout)
<a name="l00012"></a>00012 {
<a name="l00013"></a>00013     fout &lt;&lt; <span class="charliteral">&#39;\n&#39;</span>;
<a name="l00014"></a>00014     <span class="keywordflow">while</span> (n--) fout &lt;&lt; <span class="charliteral">&#39;\t&#39;</span>;
<a name="l00015"></a>00015 }
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 
<a name="l00024"></a><a class="code" href="loop_8cpp.html#a3ca69c2725e993cb7da7cfc7989fab26">00024</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="klass_8cpp.html#a78b5da76dadfb32c2be459ab78763e98" title="Print a list of lines.">printlines</a> (<span class="keywordtype">int</span> n, list&lt;string&gt;&amp; lines, ostream&amp; fout)
<a name="l00025"></a>00025 {
<a name="l00026"></a>00026     list&lt;string&gt;::iterator s;
<a name="l00027"></a>00027     <span class="keywordflow">for</span> (s = lines.begin(); s != lines.end(); s++) {
<a name="l00028"></a>00028         <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n, fout); fout &lt;&lt; *s;
<a name="l00029"></a>00029     }
<a name="l00030"></a>00030 }
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 
<a name="l00039"></a><a class="code" href="structLoop.html#a2ce80444f783fe1bbc854b1e84a06e78">00039</a> <a class="code" href="structLoop.html#a2ce80444f783fe1bbc854b1e84a06e78" title="create a recursive loop">Loop::Loop</a>( <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> recsymbol, <a class="code" href="structLoop.html">Loop</a>* encl, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; size) 
<a name="l00040"></a>00040         : fIsRecursive(true), fRecSymbol(recsymbol), fEnclosingLoop(encl), fSize(size), fOrder(-1), fIndex(-1), fUseCount(0) 
<a name="l00041"></a>00041 {}
<a name="l00042"></a>00042 
<a name="l00043"></a>00043 
<a name="l00049"></a><a class="code" href="structLoop.html#a932757a7891255dd705d6bd306903b6c">00049</a> <a class="code" href="structLoop.html#a2ce80444f783fe1bbc854b1e84a06e78" title="create a recursive loop">Loop::Loop</a>(<a class="code" href="structLoop.html">Loop</a>* encl, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; size) 
<a name="l00050"></a>00050         : fIsRecursive(false), fRecSymbol(), fEnclosingLoop(encl), fSize(size), fOrder(-1), fIndex(-1), fUseCount(0)
<a name="l00051"></a>00051 {}
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 
<a name="l00060"></a><a class="code" href="structLoop.html#a8ab807704888fd372172c3be3ddada01">00060</a> <span class="keywordtype">bool</span> <a class="code" href="structLoop.html#a8ab807704888fd372172c3be3ddada01" title="returns true is this loop has recursive dependencies">Loop::hasRecDependencies</a>()                  
<a name="l00061"></a>00061 { 
<a name="l00062"></a>00062     <span class="keywordflow">return</span> !<a class="code" href="structLoop.html#adeb7ee47fa446e3c4b737d245c495c74" title="Loops having recursive dependencies must be merged.">fRecDependencies</a>.empty(); 
<a name="l00063"></a>00063 }
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 
<a name="l00070"></a><a class="code" href="structLoop.html#a575146a1b845596fd33b7c0a2f7d48ec">00070</a> <span class="keywordtype">bool</span> <a class="code" href="structLoop.html#a575146a1b845596fd33b7c0a2f7d48ec" title="true when the loop doesn&amp;#39;t contain any line of code">Loop::isEmpty</a>()                  
<a name="l00071"></a>00071 { 
<a name="l00072"></a>00072     <span class="keywordflow">return</span> <a class="code" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a" title="code to execute at the begin of the loop">fPreCode</a>.empty() &amp;&amp; <a class="code" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4" title="code to execute in the loop">fExecCode</a>.empty() &amp;&amp; <a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>.empty() &amp;&amp; (<a class="code" href="structLoop.html#a51772f4f8d92fc8824addec1fe412068" title="extra loops that where in sequences">fExtraLoops</a>.begin()==<a class="code" href="structLoop.html#a51772f4f8d92fc8824addec1fe412068" title="extra loops that where in sequences">fExtraLoops</a>.end()); 
<a name="l00073"></a>00073 }
<a name="l00074"></a>00074 
<a name="l00075"></a>00075 
<a name="l00079"></a><a class="code" href="structLoop.html#a9412652d16b9aaa7ca21541cc0aa0229">00079</a> <span class="keywordtype">void</span> <a class="code" href="structLoop.html#a9412652d16b9aaa7ca21541cc0aa0229" title="Check for a recursive dependecy and add it if needed.">Loop::addRecDependency</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t)
<a name="l00080"></a>00080 {
<a name="l00081"></a>00081     <span class="keywordflow">if</span> (t != <a class="code" href="structLoop.html#a7631d42eb807fd5d04e596e3f12c19b9" title="recursive loops define a recursive symbol">fRecSymbol</a>) {
<a name="l00082"></a>00082         <a class="code" href="structLoop.html#adeb7ee47fa446e3c4b737d245c495c74" title="Loops having recursive dependencies must be merged.">fRecDependencies</a>.insert(t);
<a name="l00083"></a>00083     }
<a name="l00084"></a>00084 }
<a name="l00085"></a>00085 
<a name="l00086"></a>00086 
<a name="l00091"></a><a class="code" href="structLoop.html#a9e74faad0e7d3bb55619d3d90203219b">00091</a> <span class="keywordtype">bool</span> <a class="code" href="structLoop.html#a9e74faad0e7d3bb55619d3d90203219b" title="indicates a dependency with an enclosing loop">Loop::findRecDefinition</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> t)
<a name="l00092"></a>00092 {
<a name="l00093"></a>00093     <a class="code" href="structLoop.html">Loop</a>* l = <span class="keyword">this</span>;
<a name="l00094"></a>00094     <span class="keywordflow">while</span> (l &amp;&amp; l-&gt;<a class="code" href="structLoop.html#a7631d42eb807fd5d04e596e3f12c19b9" title="recursive loops define a recursive symbol">fRecSymbol</a> != t) l=l-&gt;<a class="code" href="structLoop.html#a73875fc1b6b91e2cbabeda68a8bd42f1" title="Loop from which this one originated.">fEnclosingLoop</a>;
<a name="l00095"></a>00095     <span class="keywordflow">return</span> l != 0;
<a name="l00096"></a>00096 }
<a name="l00097"></a>00097 
<a name="l00101"></a><a class="code" href="structLoop.html#adf2970f3a2f46dbcc880e9a7528c7256">00101</a> <span class="keywordtype">void</span> <a class="code" href="structLoop.html#adf2970f3a2f46dbcc880e9a7528c7256" title="add a line of C++ code pre code">Loop::addPreCode</a> (<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; str)    
<a name="l00102"></a>00102 { 
<a name="l00103"></a>00103    <span class="comment">// cerr &lt;&lt; this &lt;&lt; &quot;-&gt;addExecCode &quot; &lt;&lt; str &lt;&lt; endl;</span>
<a name="l00104"></a>00104     <a class="code" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a" title="code to execute at the begin of the loop">fPreCode</a>.push_back(str); 
<a name="l00105"></a>00105 }
<a name="l00106"></a>00106 
<a name="l00110"></a><a class="code" href="structLoop.html#a1cd71f3283e7a5a2c944fb134c3dced7">00110</a> <span class="keywordtype">void</span> <a class="code" href="structLoop.html#a1cd71f3283e7a5a2c944fb134c3dced7" title="add a line of C++ code">Loop::addExecCode</a> (<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; str)    
<a name="l00111"></a>00111 { 
<a name="l00112"></a>00112    <span class="comment">// cerr &lt;&lt; this &lt;&lt; &quot;-&gt;addExecCode &quot; &lt;&lt; str &lt;&lt; endl;</span>
<a name="l00113"></a>00113     <a class="code" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4" title="code to execute in the loop">fExecCode</a>.push_back(str); 
<a name="l00114"></a>00114 }
<a name="l00115"></a>00115 
<a name="l00116"></a>00116 
<a name="l00120"></a><a class="code" href="structLoop.html#a9945d29a8a375ec6c422a9327dbfa937">00120</a> <span class="keywordtype">void</span> <a class="code" href="structLoop.html#a9945d29a8a375ec6c422a9327dbfa937" title="add a line of C++ post code">Loop::addPostCode</a> (<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; str)    
<a name="l00121"></a>00121 { 
<a name="l00122"></a>00122    <span class="comment">// cerr &lt;&lt; this &lt;&lt; &quot;-&gt;addPostCode &quot; &lt;&lt; str &lt;&lt; endl;</span>
<a name="l00123"></a>00123     <a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>.push_front(str); 
<a name="l00124"></a>00124 }
<a name="l00125"></a>00125 
<a name="l00126"></a>00126 
<a name="l00132"></a><a class="code" href="structLoop.html#a1774fc6f54824e4a8c9bc2eb9bc34c24">00132</a> <span class="keywordtype">void</span> <a class="code" href="structLoop.html#a1774fc6f54824e4a8c9bc2eb9bc34c24" title="absorb a loop inside this one">Loop::absorb</a> (<a class="code" href="structLoop.html">Loop</a>* l)    
<a name="l00133"></a>00133 { 
<a name="l00134"></a>00134     <span class="comment">// the loops must have the same number of iterations</span>
<a name="l00135"></a>00135     assert(<a class="code" href="structLoop.html#a76e2fde1559abc10da909c83d008534e" title="number of iterations of the loop">fSize</a> == l-&gt;<a class="code" href="structLoop.html#a76e2fde1559abc10da909c83d008534e" title="number of iterations of the loop">fSize</a>); 
<a name="l00136"></a>00136 
<a name="l00137"></a>00137     <span class="comment">// update recursive dependencies by adding those from the absorbed loop</span>
<a name="l00138"></a>00138     <a class="code" href="structLoop.html#adeb7ee47fa446e3c4b737d245c495c74" title="Loops having recursive dependencies must be merged.">fRecDependencies</a>.insert(l-&gt;<a class="code" href="structLoop.html#adeb7ee47fa446e3c4b737d245c495c74" title="Loops having recursive dependencies must be merged.">fRecDependencies</a>.begin(), l-&gt;<a class="code" href="structLoop.html#adeb7ee47fa446e3c4b737d245c495c74" title="Loops having recursive dependencies must be merged.">fRecDependencies</a>.end());  
<a name="l00139"></a>00139     <span class="keywordflow">if</span> (<a class="code" href="structLoop.html#a349cd08fc792c1b6b83d5860e6f1bbec" title="recursive loops can&amp;#39;t be SIMDed">fIsRecursive</a>) <a class="code" href="structLoop.html#adeb7ee47fa446e3c4b737d245c495c74" title="Loops having recursive dependencies must be merged.">fRecDependencies</a>.erase(<a class="code" href="structLoop.html#a7631d42eb807fd5d04e596e3f12c19b9" title="recursive loops define a recursive symbol">fRecSymbol</a>); 
<a name="l00140"></a>00140 
<a name="l00141"></a>00141     <span class="comment">// update loop dependencies by adding those from the absorbed loop</span>
<a name="l00142"></a>00142     <a class="code" href="structLoop.html#a73f599daabab6c3669355713ca914e83" title="Loops that must be computed before this one.">fBackwardLoopDependencies</a>.insert(l-&gt;<a class="code" href="structLoop.html#a73f599daabab6c3669355713ca914e83" title="Loops that must be computed before this one.">fBackwardLoopDependencies</a>.begin(), l-&gt;<a class="code" href="structLoop.html#a73f599daabab6c3669355713ca914e83" title="Loops that must be computed before this one.">fBackwardLoopDependencies</a>.end());  
<a name="l00143"></a>00143 
<a name="l00144"></a>00144     <span class="comment">// add the line of code of the absorbed loop</span>
<a name="l00145"></a>00145     <a class="code" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a" title="code to execute at the begin of the loop">fPreCode</a>.insert(<a class="code" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a" title="code to execute at the begin of the loop">fPreCode</a>.end(), l-&gt;<a class="code" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a" title="code to execute at the begin of the loop">fPreCode</a>.begin(), l-&gt;<a class="code" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a" title="code to execute at the begin of the loop">fPreCode</a>.end());
<a name="l00146"></a>00146     <a class="code" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4" title="code to execute in the loop">fExecCode</a>.insert(<a class="code" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4" title="code to execute in the loop">fExecCode</a>.end(), l-&gt;<a class="code" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4" title="code to execute in the loop">fExecCode</a>.begin(), l-&gt;<a class="code" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4" title="code to execute in the loop">fExecCode</a>.end());
<a name="l00147"></a>00147     <a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>.insert(<a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>.begin(), l-&gt;<a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>.begin(), l-&gt;<a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>.end());
<a name="l00148"></a>00148 }
<a name="l00149"></a>00149 
<a name="l00150"></a>00150 
<a name="l00156"></a><a class="code" href="structLoop.html#ae50f255d2f1622ffca999f5f755be494">00156</a> <span class="keywordtype">void</span> <a class="code" href="structLoop.html#ae50f255d2f1622ffca999f5f755be494" title="print the loop">Loop::println</a>(<span class="keywordtype">int</span> n, ostream&amp; fout)
<a name="l00157"></a>00157 {
<a name="l00158"></a>00158     <span class="keywordflow">for</span> (list&lt;Loop*&gt;::const_iterator s = <a class="code" href="structLoop.html#a51772f4f8d92fc8824addec1fe412068" title="extra loops that where in sequences">fExtraLoops</a>.begin(); s != <a class="code" href="structLoop.html#a51772f4f8d92fc8824addec1fe412068" title="extra loops that where in sequences">fExtraLoops</a>.end(); s++) {
<a name="l00159"></a>00159         (*s)-&gt;println(n, fout);
<a name="l00160"></a>00160     }
<a name="l00161"></a>00161 
<a name="l00162"></a>00162     <span class="keywordflow">if</span> (<a class="code" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a" title="code to execute at the begin of the loop">fPreCode</a>.size()+<a class="code" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4" title="code to execute in the loop">fExecCode</a>.size()+<a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>.size() &gt; 0) {
<a name="l00163"></a>00163 <span class="comment">/*        if (gVectorSwitch) {</span>
<a name="l00164"></a>00164 <span class="comment">            tab(n,fout); </span>
<a name="l00165"></a>00165 <span class="comment">            fout &lt;&lt; ((fIsRecursive) ? &quot;// recursive loop&quot; : &quot;// vectorizable loop&quot;);</span>
<a name="l00166"></a>00166 <span class="comment">        }*/</span>
<a name="l00167"></a>00167         
<a name="l00168"></a>00168         <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n,fout); fout &lt;&lt; <span class="stringliteral">&quot;// LOOP &quot;</span> &lt;&lt; this ;
<a name="l00169"></a>00169         <span class="keywordflow">if</span> (<a class="code" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a" title="code to execute at the begin of the loop">fPreCode</a>.size()&gt;0) {
<a name="l00170"></a>00170             <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n,fout); fout &lt;&lt; <span class="stringliteral">&quot;// pre processing&quot;</span>;
<a name="l00171"></a>00171             <a class="code" href="klass_8cpp.html#a78b5da76dadfb32c2be459ab78763e98" title="Print a list of lines.">printlines</a>(n, <a class="code" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a" title="code to execute at the begin of the loop">fPreCode</a>, fout);
<a name="l00172"></a>00172         }
<a name="l00173"></a>00173             
<a name="l00174"></a>00174         <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n,fout); fout &lt;&lt; <span class="stringliteral">&quot;// exec code&quot;</span>;
<a name="l00175"></a>00175         <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n,fout); fout &lt;&lt; <span class="stringliteral">&quot;for (int i=0; i&lt;&quot;</span> &lt;&lt; <a class="code" href="structLoop.html#a76e2fde1559abc10da909c83d008534e" title="number of iterations of the loop">fSize</a> &lt;&lt; <span class="stringliteral">&quot;; i++) {&quot;</span>;
<a name="l00176"></a>00176         <a class="code" href="klass_8cpp.html#a78b5da76dadfb32c2be459ab78763e98" title="Print a list of lines.">printlines</a>(n+1, <a class="code" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4" title="code to execute in the loop">fExecCode</a>, fout);
<a name="l00177"></a>00177         <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n,fout); fout &lt;&lt; <span class="stringliteral">&quot;}&quot;</span>;
<a name="l00178"></a>00178         
<a name="l00179"></a>00179         <span class="keywordflow">if</span> (<a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>.size()&gt;0) {
<a name="l00180"></a>00180             <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n,fout); fout &lt;&lt; <span class="stringliteral">&quot;// post processing&quot;</span>;
<a name="l00181"></a>00181             <a class="code" href="klass_8cpp.html#a78b5da76dadfb32c2be459ab78763e98" title="Print a list of lines.">printlines</a>(n, <a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>, fout);
<a name="l00182"></a>00182         }
<a name="l00183"></a>00183         <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n,fout);
<a name="l00184"></a>00184     }
<a name="l00185"></a>00185 }
<a name="l00186"></a>00186 
<a name="l00192"></a><a class="code" href="structLoop.html#ac289865e495156b736961cea11651710">00192</a> <span class="keywordtype">void</span> <a class="code" href="structLoop.html#ac289865e495156b736961cea11651710" title="print the loop in scalar mode">Loop::printoneln</a>(<span class="keywordtype">int</span> n, ostream&amp; fout)
<a name="l00193"></a>00193 {
<a name="l00194"></a>00194     <span class="keywordflow">if</span> (<a class="code" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a" title="code to execute at the begin of the loop">fPreCode</a>.size()+<a class="code" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4" title="code to execute in the loop">fExecCode</a>.size()+<a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>.size() &gt; 0) {
<a name="l00195"></a>00195 <span class="comment">/*        if (gVectorSwitch) {</span>
<a name="l00196"></a>00196 <span class="comment">            tab(n,fout); </span>
<a name="l00197"></a>00197 <span class="comment">            fout &lt;&lt; ((fIsRecursive) ? &quot;// recursive loop&quot; : &quot;// vectorizable loop&quot;);</span>
<a name="l00198"></a>00198 <span class="comment">        }*/</span>
<a name="l00199"></a>00199             
<a name="l00200"></a>00200         <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n,fout); fout &lt;&lt; <span class="stringliteral">&quot;for (int i=0; i&lt;&quot;</span> &lt;&lt; <a class="code" href="structLoop.html#a76e2fde1559abc10da909c83d008534e" title="number of iterations of the loop">fSize</a> &lt;&lt; <span class="stringliteral">&quot;; i++) {&quot;</span>;
<a name="l00201"></a>00201         <span class="keywordflow">if</span> (<a class="code" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a" title="code to execute at the begin of the loop">fPreCode</a>.size()&gt;0) {
<a name="l00202"></a>00202             <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n+1,fout); fout &lt;&lt; <span class="stringliteral">&quot;// pre processing&quot;</span>;
<a name="l00203"></a>00203             <a class="code" href="klass_8cpp.html#a78b5da76dadfb32c2be459ab78763e98" title="Print a list of lines.">printlines</a>(n+1, <a class="code" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a" title="code to execute at the begin of the loop">fPreCode</a>, fout);
<a name="l00204"></a>00204         }
<a name="l00205"></a>00205         <a class="code" href="klass_8cpp.html#a78b5da76dadfb32c2be459ab78763e98" title="Print a list of lines.">printlines</a>(n+1, <a class="code" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4" title="code to execute in the loop">fExecCode</a>, fout);
<a name="l00206"></a>00206         <span class="keywordflow">if</span> (<a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>.size()&gt;0) {
<a name="l00207"></a>00207             <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n+1,fout); fout &lt;&lt; <span class="stringliteral">&quot;// post processing&quot;</span>;
<a name="l00208"></a>00208             <a class="code" href="klass_8cpp.html#a78b5da76dadfb32c2be459ab78763e98" title="Print a list of lines.">printlines</a>(n+1, <a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>, fout);
<a name="l00209"></a>00209         }
<a name="l00210"></a>00210         <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n,fout); fout &lt;&lt; <span class="stringliteral">&quot;}&quot;</span>;
<a name="l00211"></a>00211     }
<a name="l00212"></a>00212 }
<a name="l00213"></a>00213 
<a name="l00214"></a>00214 <span class="comment">//-------------------------------------------------------</span>
<a name="l00215"></a><a class="code" href="structLoop.html#a11c5adcd88f4c8fabbaa9f6feae5a8f7">00215</a> <span class="keywordtype">void</span> <a class="code" href="structLoop.html#a11c5adcd88f4c8fabbaa9f6feae5a8f7">Loop::concat</a>(<a class="code" href="structLoop.html">Loop</a>* l)
<a name="l00216"></a>00216 {
<a name="l00217"></a>00217     assert(l-&gt;<a class="code" href="structLoop.html#a5237f580c9e6f25693da26d00fda7798" title="how many loops depend on this one">fUseCount</a> == 1);
<a name="l00218"></a>00218     assert(<a class="code" href="structLoop.html#a73f599daabab6c3669355713ca914e83" title="Loops that must be computed before this one.">fBackwardLoopDependencies</a>.size() == 1);
<a name="l00219"></a>00219     assert((*<a class="code" href="structLoop.html#a73f599daabab6c3669355713ca914e83" title="Loops that must be computed before this one.">fBackwardLoopDependencies</a>.begin()) == l);
<a name="l00220"></a>00220     
<a name="l00221"></a>00221     <a class="code" href="structLoop.html#a51772f4f8d92fc8824addec1fe412068" title="extra loops that where in sequences">fExtraLoops</a>.push_front(l);
<a name="l00222"></a>00222     <a class="code" href="structLoop.html#a73f599daabab6c3669355713ca914e83" title="Loops that must be computed before this one.">fBackwardLoopDependencies</a> = l-&gt;<a class="code" href="structLoop.html#a73f599daabab6c3669355713ca914e83" title="Loops that must be computed before this one.">fBackwardLoopDependencies</a>;   
<a name="l00223"></a>00223 }
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Wed Apr 28 23:59:59 2010 for FAUST compiler by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>