<spanid="lib-functiondata-module"></span><h1>Lib.FunctionData module<aclass="headerlink"href="#module-Lib.FunctionData"title="Permalink to this heading"></a></h1>
<p>This file defines the base class <aclass="reference internal"href="#Lib.FunctionData.FunctionData"title="Lib.FunctionData.FunctionData"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">FunctionData</span></code></a>,
containing metadata on a RiscV function, as well as utility
functions common to the different intermediate representations.</p>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">Lib.FunctionData.</span></span><spanclass="sig-name descname"><spanclass="pre">FunctionData</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">name</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/Lib/FunctionData.html#FunctionData"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.FunctionData.FunctionData"title="Permalink to this definition"></a></dt>
<p>This class is usually used indirectly through the
different intermediate representations we work with,
such as <aclass="reference internal"href="Lib.LinearCode.html#Lib.LinearCode.LinearCode.fdata"title="Lib.LinearCode.LinearCode.fdata"><codeclass="xref py py-attr docutils literal notranslate"><spanclass="pre">Lib.LinearCode.LinearCode.fdata</span></code></a>.</p>
<spanclass="sig-name descname"><spanclass="pre">get_name</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">str</span></span></span><aclass="reference internal"href="../_modules/Lib/FunctionData.html#FunctionData.get_name"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.FunctionData.FunctionData.get_name"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">fresh_tmp</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><aclass="reference internal"href="Lib.Operands.html#Lib.Operands.Temporary"title="Lib.Operands.Temporary"><spanclass="pre">Temporary</span></a></span></span><aclass="reference internal"href="../_modules/Lib/FunctionData.html#FunctionData.fresh_tmp"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.FunctionData.FunctionData.fresh_tmp"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">fresh_offset</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><aclass="reference internal"href="Lib.Operands.html#Lib.Operands.Offset"title="Lib.Operands.Offset"><spanclass="pre">Offset</span></a></span></span><aclass="reference internal"href="../_modules/Lib/FunctionData.html#FunctionData.fresh_offset"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.FunctionData.FunctionData.fresh_offset"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">get_offset</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">int</span></span></span><aclass="reference internal"href="../_modules/Lib/FunctionData.html#FunctionData.get_offset"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.FunctionData.FunctionData.get_offset"title="Permalink to this definition"></a></dt>
<dd><p>Return the current offset in the memory stack.</p>
<spanclass="sig-name descname"><spanclass="pre">fresh_label</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">name</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Label"title="Lib.Statement.Label"><spanclass="pre">Label</span></a></span></span><aclass="reference internal"href="../_modules/Lib/FunctionData.html#FunctionData.fresh_label"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.FunctionData.FunctionData.fresh_label"title="Permalink to this definition"></a></dt>
<dd><p>Return a new label, with a unique name based on the given string.</p>
<spanclass="sig-name descname"><spanclass="pre">get_label_div_by_zero</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Label"title="Lib.Statement.Label"><spanclass="pre">Label</span></a></span></span><aclass="reference internal"href="../_modules/Lib/FunctionData.html#FunctionData.get_label_div_by_zero"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.FunctionData.FunctionData.get_label_div_by_zero"title="Permalink to this definition"></a></dt>