<!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 Struct Reference</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 Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> </div> <div class="contents"> <h1>Loop Struct Reference</h1><!-- doxytag: class="Loop" --> <p><code>#include <<a class="el" href="loop_8hh_source.html">loop.hh</a>></code></p> <div class="dynheader"> Collaboration diagram for Loop:</div> <div class="dynsection"> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="structLoop-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a2ce80444f783fe1bbc854b1e84a06e78">Loop</a> (<a class="el" href="classCTree.html">Tree</a> recsymbol, <a class="el" href="structLoop.html">Loop</a> *encl, const string &size)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">create a recursive loop <a href="#a2ce80444f783fe1bbc854b1e84a06e78"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a932757a7891255dd705d6bd306903b6c">Loop</a> (<a class="el" href="structLoop.html">Loop</a> *encl, const string &size)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">create a non recursive loop <a href="#a932757a7891255dd705d6bd306903b6c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a575146a1b845596fd33b7c0a2f7d48ec">isEmpty</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">true when the loop doesn't contain any line of code <a href="#a575146a1b845596fd33b7c0a2f7d48ec"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a8ab807704888fd372172c3be3ddada01">hasRecDependencies</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">returns true is this loop has recursive dependencies <a href="#a8ab807704888fd372172c3be3ddada01"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a9412652d16b9aaa7ca21541cc0aa0229">addRecDependency</a> (<a class="el" href="classCTree.html">Tree</a> t)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Check for a recursive dependecy and add it if needed. <a href="#a9412652d16b9aaa7ca21541cc0aa0229"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a9e74faad0e7d3bb55619d3d90203219b">findRecDefinition</a> (<a class="el" href="classCTree.html">Tree</a> t)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">indicates a dependency with an enclosing loop <a href="#a9e74faad0e7d3bb55619d3d90203219b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#adf2970f3a2f46dbcc880e9a7528c7256">addPreCode</a> (const string &str)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">add a line of C++ code pre code <a href="#adf2970f3a2f46dbcc880e9a7528c7256"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a1cd71f3283e7a5a2c944fb134c3dced7">addExecCode</a> (const string &str)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">add a line of C++ code <a href="#a1cd71f3283e7a5a2c944fb134c3dced7"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a9945d29a8a375ec6c422a9327dbfa937">addPostCode</a> (const string &str)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">add a line of C++ post code <a href="#a9945d29a8a375ec6c422a9327dbfa937"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#ae50f255d2f1622ffca999f5f755be494">println</a> (int n, ostream &fout)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">print the loop <a href="#ae50f255d2f1622ffca999f5f755be494"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#ac289865e495156b736961cea11651710">printoneln</a> (int n, ostream &fout)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">print the loop in scalar mode <a href="#ac289865e495156b736961cea11651710"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a1774fc6f54824e4a8c9bc2eb9bc34c24">absorb</a> (<a class="el" href="structLoop.html">Loop</a> *l)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">absorb a loop inside this one <a href="#a1774fc6f54824e4a8c9bc2eb9bc34c24"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a11c5adcd88f4c8fabbaa9f6feae5a8f7">concat</a> (<a class="el" href="structLoop.html">Loop</a> *l)</td></tr> <tr><td colspan="2"><h2>Public Attributes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const bool </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a349cd08fc792c1b6b83d5860e6f1bbec">fIsRecursive</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">recursive loops can't be SIMDed <a href="#a349cd08fc792c1b6b83d5860e6f1bbec"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classCTree.html">Tree</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a7631d42eb807fd5d04e596e3f12c19b9">fRecSymbol</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">recursive loops define a recursive symbol <a href="#a7631d42eb807fd5d04e596e3f12c19b9"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structLoop.html">Loop</a> *const </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a73875fc1b6b91e2cbabeda68a8bd42f1">fEnclosingLoop</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="structLoop.html">Loop</a> from which this one originated. <a href="#a73875fc1b6b91e2cbabeda68a8bd42f1"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const string </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a76e2fde1559abc10da909c83d008534e">fSize</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">number of iterations of the loop <a href="#a76e2fde1559abc10da909c83d008534e"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">set< <a class="el" href="classCTree.html">Tree</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#adeb7ee47fa446e3c4b737d245c495c74">fRecDependencies</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Loops having recursive dependencies must be merged. <a href="#adeb7ee47fa446e3c4b737d245c495c74"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">set< <a class="el" href="structLoop.html">Loop</a> * > </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a73f599daabab6c3669355713ca914e83">fBackwardLoopDependencies</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Loops that must be computed before this one. <a href="#a73f599daabab6c3669355713ca914e83"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">set< <a class="el" href="structLoop.html">Loop</a> * > </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#ae071c221031c1f1573a43ee72d512d73">fForwardLoopDependencies</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Loops that will be computed after this one. <a href="#ae071c221031c1f1573a43ee72d512d73"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">list< string > </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a">fPreCode</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">code to execute at the begin of the loop <a href="#a6d076c9fe43125a148ba65d28baf657a"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">list< string > </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4">fExecCode</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">code to execute in the loop <a href="#a613199ed3e3ee441d1a0be6038c0bae4"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">list< string > </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5">fPostCode</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">code to execute at the end of the loop <a href="#a845bf5afe7d9e0b364bda797fcd11ca5"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a5fdf3e2e7d63e1ae6b0718c34021f5da">fOrder</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">used during topological sort <a href="#a5fdf3e2e7d63e1ae6b0718c34021f5da"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a96a59acb30654a19fd06bc4e1967e169">fIndex</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">used during scheduler mode code generation <a href="#a96a59acb30654a19fd06bc4e1967e169"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a5237f580c9e6f25693da26d00fda7798">fUseCount</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">how many loops depend on this one <a href="#a5237f580c9e6f25693da26d00fda7798"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">list< <a class="el" href="structLoop.html">Loop</a> * > </td><td class="memItemRight" valign="bottom"><a class="el" href="structLoop.html#a51772f4f8d92fc8824addec1fe412068">fExtraLoops</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">extra loops that where in sequences <a href="#a51772f4f8d92fc8824addec1fe412068"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00051">51</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a2ce80444f783fe1bbc854b1e84a06e78"></a><!-- doxytag: member="Loop::Loop" ref="a2ce80444f783fe1bbc854b1e84a06e78" args="(Tree recsymbol, Loop *encl, const string &size)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Loop::Loop </td> <td>(</td> <td class="paramtype"><a class="el" href="classCTree.html">Tree</a> </td> <td class="paramname"> <em>recsymbol</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="structLoop.html">Loop</a> * </td> <td class="paramname"> <em>encl</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const string & </td> <td class="paramname"> <em>size</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>create a recursive loop </p> <p>Create a recursive loop.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>recsymbol</em> </td><td>the recursive symbol defined in this loop </td></tr> <tr><td valign="top"></td><td valign="top"><em>encl</em> </td><td>the enclosing loop </td></tr> <tr><td valign="top"></td><td valign="top"><em>size</em> </td><td>the number of iterations of the loop </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="loop_8cpp_source.html#l00039">39</a> of file <a class="el" href="loop_8cpp_source.html">loop.cpp</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00040"></a>00040 : <a class="code" href="structLoop.html#a349cd08fc792c1b6b83d5860e6f1bbec" title="recursive loops can&#39;t be SIMDed">fIsRecursive</a>(<span class="keyword">true</span>), <a class="code" href="structLoop.html#a7631d42eb807fd5d04e596e3f12c19b9" title="recursive loops define a recursive symbol">fRecSymbol</a>(recsymbol), <a class="code" href="structLoop.html#a73875fc1b6b91e2cbabeda68a8bd42f1" title="Loop from which this one originated.">fEnclosingLoop</a>(encl), <a class="code" href="structLoop.html#a76e2fde1559abc10da909c83d008534e" title="number of iterations of the loop">fSize</a>(size), <a class="code" href="structLoop.html#a5fdf3e2e7d63e1ae6b0718c34021f5da" title="used during topological sort">fOrder</a>(-1), <a class="code" href="structLoop.html#a96a59acb30654a19fd06bc4e1967e169" title="used during scheduler mode code generation">fIndex</a>(-1), <a class="code" href="structLoop.html#a5237f580c9e6f25693da26d00fda7798" title="how many loops depend on this one">fUseCount</a>(0) <a name="l00041"></a>00041 {} </pre></div></p> </div> </div> <a class="anchor" id="a932757a7891255dd705d6bd306903b6c"></a><!-- doxytag: member="Loop::Loop" ref="a932757a7891255dd705d6bd306903b6c" args="(Loop *encl, const string &size)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Loop::Loop </td> <td>(</td> <td class="paramtype"><a class="el" href="structLoop.html">Loop</a> * </td> <td class="paramname"> <em>encl</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const string & </td> <td class="paramname"> <em>size</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>create a non recursive loop </p> <p>Create a non recursive loop.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>encl</em> </td><td>the enclosing loop </td></tr> <tr><td valign="top"></td><td valign="top"><em>size</em> </td><td>the number of iterations of the loop </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="loop_8cpp_source.html#l00049">49</a> of file <a class="el" href="loop_8cpp_source.html">loop.cpp</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00050"></a>00050 : <a class="code" href="structLoop.html#a349cd08fc792c1b6b83d5860e6f1bbec" title="recursive loops can&#39;t be SIMDed">fIsRecursive</a>(<span class="keyword">false</span>), <a class="code" href="structLoop.html#a7631d42eb807fd5d04e596e3f12c19b9" title="recursive loops define a recursive symbol">fRecSymbol</a>(), <a class="code" href="structLoop.html#a73875fc1b6b91e2cbabeda68a8bd42f1" title="Loop from which this one originated.">fEnclosingLoop</a>(encl), <a class="code" href="structLoop.html#a76e2fde1559abc10da909c83d008534e" title="number of iterations of the loop">fSize</a>(size), <a class="code" href="structLoop.html#a5fdf3e2e7d63e1ae6b0718c34021f5da" title="used during topological sort">fOrder</a>(-1), <a class="code" href="structLoop.html#a96a59acb30654a19fd06bc4e1967e169" title="used during scheduler mode code generation">fIndex</a>(-1), <a class="code" href="structLoop.html#a5237f580c9e6f25693da26d00fda7798" title="how many loops depend on this one">fUseCount</a>(0) <a name="l00051"></a>00051 {} </pre></div></p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a1774fc6f54824e4a8c9bc2eb9bc34c24"></a><!-- doxytag: member="Loop::absorb" ref="a1774fc6f54824e4a8c9bc2eb9bc34c24" args="(Loop *l)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Loop::absorb </td> <td>(</td> <td class="paramtype"><a class="el" href="structLoop.html">Loop</a> * </td> <td class="paramname"> <em>l</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>absorb a loop inside this one </p> <p>Absorb a loop by copying its recursive dependencies, its loop dependencies and its lines of exec and post exec code.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>l</em> </td><td>the <a class="el" href="structLoop.html">Loop</a> to be absorbed </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="loop_8cpp_source.html#l00132">132</a> of file <a class="el" href="loop_8cpp_source.html">loop.cpp</a>.</p> <p>References <a class="el" href="loop_8hh_source.html#l00059">fBackwardLoopDependencies</a>, <a class="el" href="loop_8hh_source.html#l00062">fExecCode</a>, <a class="el" href="loop_8hh_source.html#l00053">fIsRecursive</a>, <a class="el" href="loop_8hh_source.html#l00063">fPostCode</a>, <a class="el" href="loop_8hh_source.html#l00061">fPreCode</a>, <a class="el" href="loop_8hh_source.html#l00058">fRecDependencies</a>, <a class="el" href="loop_8hh_source.html#l00054">fRecSymbol</a>, and <a class="el" href="loop_8hh_source.html#l00056">fSize</a>.</p> <p>Referenced by <a class="el" href="klass_8cpp_source.html#l00109">Klass::closeLoop()</a>.</p> <p><div class="fragment"><pre class="fragment"><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-><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-><a class="code" href="structLoop.html#adeb7ee47fa446e3c4b737d245c495c74" title="Loops having recursive dependencies must be merged.">fRecDependencies</a>.begin(), l-><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&#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-><a class="code" href="structLoop.html#a73f599daabab6c3669355713ca914e83" title="Loops that must be computed before this one.">fBackwardLoopDependencies</a>.begin(), l-><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-><a class="code" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a" title="code to execute at the begin of the loop">fPreCode</a>.begin(), l-><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-><a class="code" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4" title="code to execute in the loop">fExecCode</a>.begin(), l-><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-><a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>.begin(), l-><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 } </pre></div></p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="a1cd71f3283e7a5a2c944fb134c3dced7"></a><!-- doxytag: member="Loop::addExecCode" ref="a1cd71f3283e7a5a2c944fb134c3dced7" args="(const string &str)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Loop::addExecCode </td> <td>(</td> <td class="paramtype">const string & </td> <td class="paramname"> <em>str</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>add a line of C++ code </p> <p>Add a line of exec code. </p> <p>Definition at line <a class="el" href="loop_8cpp_source.html#l00110">110</a> of file <a class="el" href="loop_8cpp_source.html">loop.cpp</a>.</p> <p>References <a class="el" href="loop_8hh_source.html#l00062">fExecCode</a>.</p> <p>Referenced by <a class="el" href="klass_8hh_source.html#l00158">Klass::addExecCode()</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00111"></a>00111 { <a name="l00112"></a>00112 <span class="comment">// cerr << this << "->addExecCode " << str << 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 } </pre></div></p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="a9945d29a8a375ec6c422a9327dbfa937"></a><!-- doxytag: member="Loop::addPostCode" ref="a9945d29a8a375ec6c422a9327dbfa937" args="(const string &str)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Loop::addPostCode </td> <td>(</td> <td class="paramtype">const string & </td> <td class="paramname"> <em>str</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>add a line of C++ post code </p> <p>Add a line of post exec code (end of the loop). </p> <p>Definition at line <a class="el" href="loop_8cpp_source.html#l00120">120</a> of file <a class="el" href="loop_8cpp_source.html">loop.cpp</a>.</p> <p>References <a class="el" href="loop_8hh_source.html#l00063">fPostCode</a>.</p> <p>Referenced by <a class="el" href="klass_8hh_source.html#l00159">Klass::addPostCode()</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00121"></a>00121 { <a name="l00122"></a>00122 <span class="comment">// cerr << this << "->addPostCode " << str << 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 } </pre></div></p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="adf2970f3a2f46dbcc880e9a7528c7256"></a><!-- doxytag: member="Loop::addPreCode" ref="adf2970f3a2f46dbcc880e9a7528c7256" args="(const string &str)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Loop::addPreCode </td> <td>(</td> <td class="paramtype">const string & </td> <td class="paramname"> <em>str</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>add a line of C++ code pre code </p> <p>Add a line of pre code (begin of the loop). </p> <p>Definition at line <a class="el" href="loop_8cpp_source.html#l00101">101</a> of file <a class="el" href="loop_8cpp_source.html">loop.cpp</a>.</p> <p>References <a class="el" href="loop_8hh_source.html#l00061">fPreCode</a>.</p> <p>Referenced by <a class="el" href="klass_8hh_source.html#l00157">Klass::addPreCode()</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00102"></a>00102 { <a name="l00103"></a>00103 <span class="comment">// cerr << this << "->addExecCode " << str << 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 } </pre></div></p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="a9412652d16b9aaa7ca21541cc0aa0229"></a><!-- doxytag: member="Loop::addRecDependency" ref="a9412652d16b9aaa7ca21541cc0aa0229" args="(Tree t)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Loop::addRecDependency </td> <td>(</td> <td class="paramtype"><a class="el" href="classCTree.html">Tree</a> </td> <td class="paramname"> <em>t</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Check for a recursive dependecy and add it if needed. </p> <p>Add a recursive dependency, unless it is itself. </p> <p>Definition at line <a class="el" href="loop_8cpp_source.html#l00079">79</a> of file <a class="el" href="loop_8cpp_source.html">loop.cpp</a>.</p> <p>References <a class="el" href="loop_8hh_source.html#l00058">fRecDependencies</a>, and <a class="el" href="loop_8hh_source.html#l00054">fRecSymbol</a>.</p> <p>Referenced by <a class="el" href="compile__vect_8cpp_source.html#l00081">VectorCompiler::CS()</a>, and <a class="el" href="compile__vect_8cpp_source.html#l00113">VectorCompiler::generateCode()</a>.</p> <p><div class="fragment"><pre class="fragment"><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 } </pre></div></p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="a11c5adcd88f4c8fabbaa9f6feae5a8f7"></a><!-- doxytag: member="Loop::concat" ref="a11c5adcd88f4c8fabbaa9f6feae5a8f7" args="(Loop *l)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Loop::concat </td> <td>(</td> <td class="paramtype"><a class="el" href="structLoop.html">Loop</a> * </td> <td class="paramname"> <em>l</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="loop_8cpp_source.html#l00215">215</a> of file <a class="el" href="loop_8cpp_source.html">loop.cpp</a>.</p> <p>References <a class="el" href="loop_8hh_source.html#l00059">fBackwardLoopDependencies</a>, <a class="el" href="loop_8hh_source.html#l00069">fExtraLoops</a>, and <a class="el" href="loop_8hh_source.html#l00068">fUseCount</a>.</p> <p>Referenced by <a class="el" href="klass_8cpp_source.html#l00258">groupSeqLoops()</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00216"></a>00216 { <a name="l00217"></a>00217 assert(l-><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-><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></p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="a9e74faad0e7d3bb55619d3d90203219b"></a><!-- doxytag: member="Loop::findRecDefinition" ref="a9e74faad0e7d3bb55619d3d90203219b" args="(Tree t)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Loop::findRecDefinition </td> <td>(</td> <td class="paramtype"><a class="el" href="classCTree.html">Tree</a> </td> <td class="paramname"> <em>t</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>indicates a dependency with an enclosing loop </p> <p>Search if t is defined in this loop or the enclosing ones. </p> <p>Definition at line <a class="el" href="loop_8cpp_source.html#l00091">91</a> of file <a class="el" href="loop_8cpp_source.html">loop.cpp</a>.</p> <p>References <a class="el" href="loop_8hh_source.html#l00055">fEnclosingLoop</a>, and <a class="el" href="loop_8hh_source.html#l00054">fRecSymbol</a>.</p> <p>Referenced by <a class="el" href="compile__vect_8cpp_source.html#l00081">VectorCompiler::CS()</a>, and <a class="el" href="compile__vect_8cpp_source.html#l00113">VectorCompiler::generateCode()</a>.</p> <p><div class="fragment"><pre class="fragment"><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 && l-><a class="code" href="structLoop.html#a7631d42eb807fd5d04e596e3f12c19b9" title="recursive loops define a recursive symbol">fRecSymbol</a> != t) l=l-><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 } </pre></div></p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="a8ab807704888fd372172c3be3ddada01"></a><!-- doxytag: member="Loop::hasRecDependencies" ref="a8ab807704888fd372172c3be3ddada01" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Loop::hasRecDependencies </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>returns true is this loop has recursive dependencies </p> <p>A loop with recursive dependencies can't be run alone.</p> <p>It must be included into another loop. returns true is this loop has recursive dependencies and must be included in an enclosing loop </p> <p>Definition at line <a class="el" href="loop_8cpp_source.html#l00060">60</a> of file <a class="el" href="loop_8cpp_source.html">loop.cpp</a>.</p> <p>References <a class="el" href="loop_8hh_source.html#l00058">fRecDependencies</a>.</p> <p>Referenced by <a class="el" href="klass_8cpp_source.html#l00109">Klass::closeLoop()</a>.</p> <p><div class="fragment"><pre class="fragment"><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 } </pre></div></p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="a575146a1b845596fd33b7c0a2f7d48ec"></a><!-- doxytag: member="Loop::isEmpty" ref="a575146a1b845596fd33b7c0a2f7d48ec" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Loop::isEmpty </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>true when the loop doesn't contain any line of code </p> <p>Test if a loop is empty that is if it contains no lines of code).</p> <dl class="return"><dt><b>Returns:</b></dt><dd>true if the loop is empty </dd></dl> <p>Definition at line <a class="el" href="loop_8cpp_source.html#l00070">70</a> of file <a class="el" href="loop_8cpp_source.html">loop.cpp</a>.</p> <p>References <a class="el" href="loop_8hh_source.html#l00062">fExecCode</a>, <a class="el" href="loop_8hh_source.html#l00069">fExtraLoops</a>, <a class="el" href="loop_8hh_source.html#l00063">fPostCode</a>, and <a class="el" href="loop_8hh_source.html#l00061">fPreCode</a>.</p> <p>Referenced by <a class="el" href="klass_8cpp_source.html#l00109">Klass::closeLoop()</a>.</p> <p><div class="fragment"><pre class="fragment"><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() && <a class="code" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4" title="code to execute in the loop">fExecCode</a>.empty() && <a class="code" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5" title="code to execute at the end of the loop">fPostCode</a>.empty() && (<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 } </pre></div></p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="ae50f255d2f1622ffca999f5f755be494"></a><!-- doxytag: member="Loop::println" ref="ae50f255d2f1622ffca999f5f755be494" args="(int n, ostream &fout)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Loop::println </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>n</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ostream & </td> <td class="paramname"> <em>fout</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>print the loop </p> <p>Print a loop (unless it is empty).</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>n</em> </td><td>number of tabs of indentation </td></tr> <tr><td valign="top"></td><td valign="top"><em>fout</em> </td><td>output stream </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="loop_8cpp_source.html#l00156">156</a> of file <a class="el" href="loop_8cpp_source.html">loop.cpp</a>.</p> <p>References <a class="el" href="loop_8hh_source.html#l00062">fExecCode</a>, <a class="el" href="loop_8hh_source.html#l00069">fExtraLoops</a>, <a class="el" href="loop_8hh_source.html#l00063">fPostCode</a>, <a class="el" href="loop_8hh_source.html#l00061">fPreCode</a>, <a class="el" href="loop_8hh_source.html#l00056">fSize</a>, <a class="el" href="klass_8cpp_source.html#l00131">printlines()</a>, and <a class="el" href="klass_8cpp_source.html#l00063">tab()</a>.</p> <p>Referenced by <a class="el" href="klass_8cpp_source.html#l00224">Klass::printLoopDeepFirst()</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00157"></a>00157 { <a name="l00158"></a>00158 <span class="keywordflow">for</span> (list<Loop*>::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)->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() > 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 << ((fIsRecursive) ? "// recursive loop" : "// vectorizable loop");</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 << <span class="stringliteral">"// LOOP "</span> << 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()>0) { <a name="l00170"></a>00170 <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n,fout); fout << <span class="stringliteral">"// pre processing"</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 << <span class="stringliteral">"// exec code"</span>; <a name="l00175"></a>00175 <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n,fout); fout << <span class="stringliteral">"for (int i=0; i<"</span> << <a class="code" href="structLoop.html#a76e2fde1559abc10da909c83d008534e" title="number of iterations of the loop">fSize</a> << <span class="stringliteral">"; i++) {"</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 << <span class="stringliteral">"}"</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()>0) { <a name="l00180"></a>00180 <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n,fout); fout << <span class="stringliteral">"// post processing"</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 } </pre></div></p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> </div> </p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="ac289865e495156b736961cea11651710"></a><!-- doxytag: member="Loop::printoneln" ref="ac289865e495156b736961cea11651710" args="(int n, ostream &fout)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Loop::printoneln </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>n</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ostream & </td> <td class="paramname"> <em>fout</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>print the loop in scalar mode </p> <p>Print a single loop (unless it is empty).</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>n</em> </td><td>number of tabs of indentation </td></tr> <tr><td valign="top"></td><td valign="top"><em>fout</em> </td><td>output stream </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="loop_8cpp_source.html#l00192">192</a> of file <a class="el" href="loop_8cpp_source.html">loop.cpp</a>.</p> <p>References <a class="el" href="loop_8hh_source.html#l00062">fExecCode</a>, <a class="el" href="loop_8hh_source.html#l00063">fPostCode</a>, <a class="el" href="loop_8hh_source.html#l00061">fPreCode</a>, <a class="el" href="loop_8hh_source.html#l00056">fSize</a>, <a class="el" href="klass_8cpp_source.html#l00131">printlines()</a>, and <a class="el" href="klass_8cpp_source.html#l00063">tab()</a>.</p> <p>Referenced by <a class="el" href="klass_8cpp_source.html#l00490">Klass::printLoopGraphScalar()</a>.</p> <p><div class="fragment"><pre class="fragment"><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() > 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 << ((fIsRecursive) ? "// recursive loop" : "// vectorizable loop");</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 << <span class="stringliteral">"for (int i=0; i<"</span> << <a class="code" href="structLoop.html#a76e2fde1559abc10da909c83d008534e" title="number of iterations of the loop">fSize</a> << <span class="stringliteral">"; i++) {"</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()>0) { <a name="l00202"></a>00202 <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n+1,fout); fout << <span class="stringliteral">"// pre processing"</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()>0) { <a name="l00207"></a>00207 <a class="code" href="klass_8cpp.html#a18a8d6ca698c9eaf2f270ffaaf19b13e">tab</a>(n+1,fout); fout << <span class="stringliteral">"// post processing"</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 << <span class="stringliteral">"}"</span>; <a name="l00211"></a>00211 } <a name="l00212"></a>00212 } </pre></div></p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> </div> </p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <hr/><h2>Member Data Documentation</h2> <a class="anchor" id="a73f599daabab6c3669355713ca914e83"></a><!-- doxytag: member="Loop::fBackwardLoopDependencies" ref="a73f599daabab6c3669355713ca914e83" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">set<<a class="el" href="structLoop.html">Loop</a>*> <a class="el" href="structLoop.html#a73f599daabab6c3669355713ca914e83">Loop::fBackwardLoopDependencies</a></td> </tr> </table> </div> <div class="memdoc"> <p>Loops that must be computed before this one. </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00059">59</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <p>Referenced by <a class="el" href="loop_8cpp_source.html#l00132">absorb()</a>, <a class="el" href="klass_8cpp_source.html#l00109">Klass::closeLoop()</a>, <a class="el" href="klass_8cpp_source.html#l00245">computeUseCount()</a>, <a class="el" href="loop_8cpp_source.html#l00215">concat()</a>, <a class="el" href="compile__vect_8cpp_source.html#l00081">VectorCompiler::CS()</a>, <a class="el" href="klass_8cpp_source.html#l00258">groupSeqLoops()</a>, <a class="el" href="klass_8cpp_source.html#l00224">Klass::printLoopDeepFirst()</a>, and <a class="el" href="graphSorting_8cpp_source.html#l00027">resetOrder()</a>.</p> </div> </div> <a class="anchor" id="a73875fc1b6b91e2cbabeda68a8bd42f1"></a><!-- doxytag: member="Loop::fEnclosingLoop" ref="a73875fc1b6b91e2cbabeda68a8bd42f1" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structLoop.html">Loop</a>* const <a class="el" href="structLoop.html#a73875fc1b6b91e2cbabeda68a8bd42f1">Loop::fEnclosingLoop</a></td> </tr> </table> </div> <div class="memdoc"> <p><a class="el" href="structLoop.html">Loop</a> from which this one originated. </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00055">55</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <p>Referenced by <a class="el" href="klass_8cpp_source.html#l00109">Klass::closeLoop()</a>, and <a class="el" href="loop_8cpp_source.html#l00091">findRecDefinition()</a>.</p> </div> </div> <a class="anchor" id="a613199ed3e3ee441d1a0be6038c0bae4"></a><!-- doxytag: member="Loop::fExecCode" ref="a613199ed3e3ee441d1a0be6038c0bae4" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">list<string> <a class="el" href="structLoop.html#a613199ed3e3ee441d1a0be6038c0bae4">Loop::fExecCode</a></td> </tr> </table> </div> <div class="memdoc"> <p>code to execute in the loop </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00062">62</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <p>Referenced by <a class="el" href="loop_8cpp_source.html#l00132">absorb()</a>, <a class="el" href="loop_8cpp_source.html#l00110">addExecCode()</a>, <a class="el" href="loop_8cpp_source.html#l00070">isEmpty()</a>, <a class="el" href="loop_8cpp_source.html#l00156">println()</a>, and <a class="el" href="loop_8cpp_source.html#l00192">printoneln()</a>.</p> </div> </div> <a class="anchor" id="a51772f4f8d92fc8824addec1fe412068"></a><!-- doxytag: member="Loop::fExtraLoops" ref="a51772f4f8d92fc8824addec1fe412068" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">list<<a class="el" href="structLoop.html">Loop</a>*> <a class="el" href="structLoop.html#a51772f4f8d92fc8824addec1fe412068">Loop::fExtraLoops</a></td> </tr> </table> </div> <div class="memdoc"> <p>extra loops that where in sequences </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00069">69</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <p>Referenced by <a class="el" href="loop_8cpp_source.html#l00215">concat()</a>, <a class="el" href="loop_8cpp_source.html#l00070">isEmpty()</a>, and <a class="el" href="loop_8cpp_source.html#l00156">println()</a>.</p> </div> </div> <a class="anchor" id="ae071c221031c1f1573a43ee72d512d73"></a><!-- doxytag: member="Loop::fForwardLoopDependencies" ref="ae071c221031c1f1573a43ee72d512d73" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">set<<a class="el" href="structLoop.html">Loop</a>*> <a class="el" href="structLoop.html#ae071c221031c1f1573a43ee72d512d73">Loop::fForwardLoopDependencies</a></td> </tr> </table> </div> <div class="memdoc"> <p>Loops that will be computed after this one. </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00060">60</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> </div> </div> <a class="anchor" id="a96a59acb30654a19fd06bc4e1967e169"></a><!-- doxytag: member="Loop::fIndex" ref="a96a59acb30654a19fd06bc4e1967e169" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="structLoop.html#a96a59acb30654a19fd06bc4e1967e169">Loop::fIndex</a></td> </tr> </table> </div> <div class="memdoc"> <p>used during scheduler mode code generation </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00066">66</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <p>Referenced by <a class="el" href="klass_8cpp_source.html#l00285">Klass::buildTasksList()</a>, and <a class="el" href="klass_8cpp_source.html#l00579">Klass::printOneLoopScheduler()</a>.</p> </div> </div> <a class="anchor" id="a349cd08fc792c1b6b83d5860e6f1bbec"></a><!-- doxytag: member="Loop::fIsRecursive" ref="a349cd08fc792c1b6b83d5860e6f1bbec" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const bool <a class="el" href="structLoop.html#a349cd08fc792c1b6b83d5860e6f1bbec">Loop::fIsRecursive</a></td> </tr> </table> </div> <div class="memdoc"> <p>recursive loops can't be SIMDed </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00053">53</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <p>Referenced by <a class="el" href="loop_8cpp_source.html#l00132">absorb()</a>.</p> </div> </div> <a class="anchor" id="a5fdf3e2e7d63e1ae6b0718c34021f5da"></a><!-- doxytag: member="Loop::fOrder" ref="a5fdf3e2e7d63e1ae6b0718c34021f5da" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="structLoop.html#a5fdf3e2e7d63e1ae6b0718c34021f5da">Loop::fOrder</a></td> </tr> </table> </div> <div class="memdoc"> <p>used during topological sort </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00065">65</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <p>Referenced by <a class="el" href="klass_8cpp_source.html#l00224">Klass::printLoopDeepFirst()</a>, <a class="el" href="graphSorting_8cpp_source.html#l00027">resetOrder()</a>, and <a class="el" href="graphSorting_8cpp_source.html#l00007">setOrder()</a>.</p> </div> </div> <a class="anchor" id="a845bf5afe7d9e0b364bda797fcd11ca5"></a><!-- doxytag: member="Loop::fPostCode" ref="a845bf5afe7d9e0b364bda797fcd11ca5" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">list<string> <a class="el" href="structLoop.html#a845bf5afe7d9e0b364bda797fcd11ca5">Loop::fPostCode</a></td> </tr> </table> </div> <div class="memdoc"> <p>code to execute at the end of the loop </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00063">63</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <p>Referenced by <a class="el" href="loop_8cpp_source.html#l00132">absorb()</a>, <a class="el" href="loop_8cpp_source.html#l00120">addPostCode()</a>, <a class="el" href="loop_8cpp_source.html#l00070">isEmpty()</a>, <a class="el" href="loop_8cpp_source.html#l00156">println()</a>, and <a class="el" href="loop_8cpp_source.html#l00192">printoneln()</a>.</p> </div> </div> <a class="anchor" id="a6d076c9fe43125a148ba65d28baf657a"></a><!-- doxytag: member="Loop::fPreCode" ref="a6d076c9fe43125a148ba65d28baf657a" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">list<string> <a class="el" href="structLoop.html#a6d076c9fe43125a148ba65d28baf657a">Loop::fPreCode</a></td> </tr> </table> </div> <div class="memdoc"> <p>code to execute at the begin of the loop </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00061">61</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <p>Referenced by <a class="el" href="loop_8cpp_source.html#l00132">absorb()</a>, <a class="el" href="loop_8cpp_source.html#l00101">addPreCode()</a>, <a class="el" href="loop_8cpp_source.html#l00070">isEmpty()</a>, <a class="el" href="loop_8cpp_source.html#l00156">println()</a>, and <a class="el" href="loop_8cpp_source.html#l00192">printoneln()</a>.</p> </div> </div> <a class="anchor" id="adeb7ee47fa446e3c4b737d245c495c74"></a><!-- doxytag: member="Loop::fRecDependencies" ref="adeb7ee47fa446e3c4b737d245c495c74" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">set<<a class="el" href="classCTree.html">Tree</a>> <a class="el" href="structLoop.html#adeb7ee47fa446e3c4b737d245c495c74">Loop::fRecDependencies</a></td> </tr> </table> </div> <div class="memdoc"> <p>Loops having recursive dependencies must be merged. </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00058">58</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <p>Referenced by <a class="el" href="loop_8cpp_source.html#l00132">absorb()</a>, <a class="el" href="loop_8cpp_source.html#l00079">addRecDependency()</a>, and <a class="el" href="loop_8cpp_source.html#l00060">hasRecDependencies()</a>.</p> </div> </div> <a class="anchor" id="a7631d42eb807fd5d04e596e3f12c19b9"></a><!-- doxytag: member="Loop::fRecSymbol" ref="a7631d42eb807fd5d04e596e3f12c19b9" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classCTree.html">Tree</a> <a class="el" href="structLoop.html#a7631d42eb807fd5d04e596e3f12c19b9">Loop::fRecSymbol</a></td> </tr> </table> </div> <div class="memdoc"> <p>recursive loops define a recursive symbol </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00054">54</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <p>Referenced by <a class="el" href="loop_8cpp_source.html#l00132">absorb()</a>, <a class="el" href="loop_8cpp_source.html#l00079">addRecDependency()</a>, and <a class="el" href="loop_8cpp_source.html#l00091">findRecDefinition()</a>.</p> </div> </div> <a class="anchor" id="a76e2fde1559abc10da909c83d008534e"></a><!-- doxytag: member="Loop::fSize" ref="a76e2fde1559abc10da909c83d008534e" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const string <a class="el" href="structLoop.html#a76e2fde1559abc10da909c83d008534e">Loop::fSize</a></td> </tr> </table> </div> <div class="memdoc"> <p>number of iterations of the loop </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00056">56</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <p>Referenced by <a class="el" href="loop_8cpp_source.html#l00132">absorb()</a>, <a class="el" href="loop_8cpp_source.html#l00156">println()</a>, and <a class="el" href="loop_8cpp_source.html#l00192">printoneln()</a>.</p> </div> </div> <a class="anchor" id="a5237f580c9e6f25693da26d00fda7798"></a><!-- doxytag: member="Loop::fUseCount" ref="a5237f580c9e6f25693da26d00fda7798" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="structLoop.html#a5237f580c9e6f25693da26d00fda7798">Loop::fUseCount</a></td> </tr> </table> </div> <div class="memdoc"> <p>how many loops depend on this one </p> <p>Definition at line <a class="el" href="loop_8hh_source.html#l00068">68</a> of file <a class="el" href="loop_8hh_source.html">loop.hh</a>.</p> <p>Referenced by <a class="el" href="klass_8cpp_source.html#l00245">computeUseCount()</a>, <a class="el" href="loop_8cpp_source.html#l00215">concat()</a>, and <a class="el" href="klass_8cpp_source.html#l00258">groupSeqLoops()</a>.</p> </div> </div> <hr/>The documentation for this struct was generated from the following files:<ul> <li><a class="el" href="loop_8hh_source.html">loop.hh</a></li> <li><a class="el" href="loop_8cpp_source.html">loop.cpp</a></li> </ul> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Apr 29 00:00:21 2010 for FAUST compiler by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> </body> </html>