<spanid="lib-cfg-module"></span><h1>Lib.CFG module<aclass="headerlink"href="#module-Lib.CFG"title="Permalink to this heading"></a></h1>
<p>Classes for a RiscV CFG: <aclass="reference internal"href="#Lib.CFG.CFG"title="Lib.CFG.CFG"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">CFG</span></code></a> for the CFG itself,
and <aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Block</span></code></a> for its basic blocks.</p>
<dlclass="py class">
<dtclass="sig sig-object py"id="Lib.CFG.Block">
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">Lib.CFG.</span></span><spanclass="sig-name descname"><spanclass="pre">Block</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">label</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Label"title="Lib.Statement.Label"><spanclass="pre">Label</span></a></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">insts</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Instru3A"title="Lib.Statement.Instru3A"><spanclass="pre">Instru3A</span></a><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Comment"title="Lib.Statement.Comment"><spanclass="pre">Comment</span></a><spanclass="p"><spanclass="pre">]</span></span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">terminator</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="Lib.Terminator.html#Lib.Terminator.Return"title="Lib.Terminator.Return"><spanclass="pre">Return</span></a><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.AbsoluteJump"title="Lib.Statement.AbsoluteJump"><spanclass="pre">AbsoluteJump</span></a><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><aclass="reference internal"href="Lib.Terminator.html#Lib.Terminator.BranchingTerminator"title="Lib.Terminator.BranchingTerminator"><spanclass="pre">BranchingTerminator</span></a></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/Lib/CFG.html#Block"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block"title="Permalink to this definition"></a></dt>
<p>A basic block of a <aclass="reference internal"href="#Lib.CFG.CFG"title="Lib.CFG.CFG"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">CFG</span></code></a> is made of three main parts:</p>
<ulclass="simple">
<li><p>a start <aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Label"title="Lib.Statement.Label"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">label</span></code></a> that uniquely identifies the block in the CFG</p></li>
<li><p>the main body of the block, a list of instructions
(excluding labels, jumps and branching instructions)</p></li>
that represents the final jump or branching instruction of the block,
and points to the successors of the block.
See the documentation for <aclass="reference internal"href="Lib.Terminator.html#Lib.Terminator.Terminator"title="Lib.Terminator.Terminator"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Lib.Terminator.Terminator</span></code></a> for further explanations.</p></li>
<spanclass="sig-name descname"><spanclass="pre">to_dot</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/CFG.html#Block.to_dot"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.to_dot"title="Permalink to this definition"></a></dt>
<dd><p>Outputs all statements of the block as a string.</p>
<spanclass="sig-name descname"><spanclass="pre">get_body</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Instru3A"title="Lib.Statement.Instru3A"><spanclass="pre">Instru3A</span></a><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Comment"title="Lib.Statement.Comment"><spanclass="pre">Comment</span></a><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#Block.get_body"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.get_body"title="Permalink to this definition"></a></dt>
<dd><p>Return the statements in the body of the block (no phi-node nor the terminator).</p>
<spanclass="sig-name descname"><spanclass="pre">get_all_statements</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Statement"title="Lib.Statement.Statement"><spanclass="pre">Statement</span></a><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#Block.get_all_statements"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.get_all_statements"title="Permalink to this definition"></a></dt>
<dd><p>Return all statements of the block
(including phi-nodes and the terminator, but not the label of the block).</p>
<spanclass="sig-name descname"><spanclass="pre">get_body_and_terminator</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Statement"title="Lib.Statement.Statement"><spanclass="pre">Statement</span></a><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#Block.get_body_and_terminator"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.get_body_and_terminator"title="Permalink to this definition"></a></dt>
<dd><p>Return all statements of the block, except phi-nodes
<spanclass="sig-name descname"><spanclass="pre">get_label</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/CFG.html#Block.get_label"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.get_label"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">get_in</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><spanclass="pre">Block</span></a><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#Block.get_in"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.get_in"title="Permalink to this definition"></a></dt>
<dd><p>Return the list of blocks with an edge to the considered block.</p>
<spanclass="sig-name descname"><spanclass="pre">get_terminator</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.Terminator.html#Lib.Terminator.Return"title="Lib.Terminator.Return"><spanclass="pre">Return</span></a><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.AbsoluteJump"title="Lib.Statement.AbsoluteJump"><spanclass="pre">AbsoluteJump</span></a><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><aclass="reference internal"href="Lib.Terminator.html#Lib.Terminator.BranchingTerminator"title="Lib.Terminator.BranchingTerminator"><spanclass="pre">BranchingTerminator</span></a></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#Block.get_terminator"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.get_terminator"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">set_terminator</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">term</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="Lib.Terminator.html#Lib.Terminator.Return"title="Lib.Terminator.Return"><spanclass="pre">Return</span></a><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.AbsoluteJump"title="Lib.Statement.AbsoluteJump"><spanclass="pre">AbsoluteJump</span></a><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><aclass="reference internal"href="Lib.Terminator.html#Lib.Terminator.BranchingTerminator"title="Lib.Terminator.BranchingTerminator"><spanclass="pre">BranchingTerminator</span></a></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#Block.set_terminator"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.set_terminator"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">get_phis</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Statement"title="Lib.Statement.Statement"><spanclass="pre">Statement</span></a><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#Block.get_phis"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.get_phis"title="Permalink to this definition"></a></dt>
<dd><p>Return the list of all φ instructions of the block.</p>
<spanclass="sig-name descname"><spanclass="pre">add_phi</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">phi</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Statement"title="Lib.Statement.Statement"><spanclass="pre">Statement</span></a></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#Block.add_phi"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.add_phi"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">set_phis</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">phis</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Statement"title="Lib.Statement.Statement"><spanclass="pre">Statement</span></a><spanclass="p"><spanclass="pre">]</span></span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#Block.set_phis"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.set_phis"title="Permalink to this definition"></a></dt>
<dd><p>Replace the φ instructions in the block by the given list <cite>phis</cite>.</p>
<spanclass="sig-name descname"><spanclass="pre">remove_all_phis</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#Block.remove_all_phis"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.remove_all_phis"title="Permalink to this definition"></a></dt>
<dd><p>Remove all φ instructions in the block.</p>
<spanclass="sig-name descname"><spanclass="pre">iter_statements</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">f</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#Block.iter_statements"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.iter_statements"title="Permalink to this definition"></a></dt>
<dd><p>Iterate over instructions.
For each real instruction i (not label or comment), replace it
<spanclass="sig-name descname"><spanclass="pre">add_instruction</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">instr</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Instru3A"title="Lib.Statement.Instru3A"><spanclass="pre">Instru3A</span></a><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Comment"title="Lib.Statement.Comment"><spanclass="pre">Comment</span></a></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#Block.add_instruction"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.Block.add_instruction"title="Permalink to this definition"></a></dt>
<dd><p>Add an instruction to the body of the block.</p>
</dd></dl>
</dd></dl>
<dlclass="py class">
<dtclass="sig sig-object py"id="Lib.CFG.CFG">
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">Lib.CFG.</span></span><spanclass="sig-name descname"><spanclass="pre">CFG</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">fdata</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="Lib.FunctionData.html#Lib.FunctionData.FunctionData"title="Lib.FunctionData.FunctionData"><spanclass="pre">FunctionData</span></a></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG"title="Permalink to this definition"></a></dt>
<p>A complete control-flow graph representing a function.
This class is mainly made of a list of basic <aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Block</span></code></a>,
a label indicating the <aclass="reference internal"href="#Lib.CFG.CFG.get_start"title="Lib.CFG.CFG.get_start"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">entry</span><spanclass="pre">point</span><spanclass="pre">of</span><spanclass="pre">the</span><spanclass="pre">function</span></code></a>,
and an <aclass="reference internal"href="#Lib.CFG.CFG.get_end"title="Lib.CFG.CFG.get_end"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">exit</span><spanclass="pre">label</span></code></a>.</p>
<p>As with linear code, metadata about the function can be found
in the <aclass="reference internal"href="#Lib.CFG.CFG.fdata"title="Lib.CFG.CFG.fdata"><codeclass="xref py py-attr docutils literal notranslate"><spanclass="pre">fdata</span></code></a> member variable.</p>
<spanclass="sig-name descname"><spanclass="pre">fdata</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><aclass="reference internal"href="Lib.FunctionData.html#Lib.FunctionData.FunctionData"title="Lib.FunctionData.FunctionData"><spanclass="pre">FunctionData</span></a></em><aclass="headerlink"href="#Lib.CFG.CFG.fdata"title="Permalink to this definition"></a></dt>
<dd><p>Metadata about the function represented by this CFG</p>
<spanclass="sig-name descname"><spanclass="pre">get_start</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/CFG.html#CFG.get_start"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.get_start"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">set_start</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">start</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Label"title="Lib.Statement.Label"><spanclass="pre">Label</span></a></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG.set_start"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.set_start"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">get_end</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/CFG.html#CFG.get_end"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.get_end"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">add_block</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">blk</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><spanclass="pre">Block</span></a></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG.add_block"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.add_block"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">get_block</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"><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Label"title="Lib.Statement.Label"><spanclass="pre">Label</span></a></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><spanclass="pre">Block</span></a></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG.get_block"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.get_block"title="Permalink to this definition"></a></dt>
<dd><p>Return the block with label <cite>name</cite>.</p>
<spanclass="sig-name descname"><spanclass="pre">get_blocks</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><spanclass="pre">Block</span></a><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG.get_blocks"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.get_blocks"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">get_entries</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><spanclass="pre">Block</span></a><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG.get_entries"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.get_entries"title="Permalink to this definition"></a></dt>
<dd><p>Return all the blocks with no predecessors.</p>
<spanclass="sig-name descname"><spanclass="pre">add_edge</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">src</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><spanclass="pre">Block</span></a></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">dest</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><spanclass="pre">Block</span></a></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG.add_edge"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.add_edge"title="Permalink to this definition"></a></dt>
<dd><p>Add the edge src -> dest in the control flow graph.</p>
<spanclass="sig-name descname"><spanclass="pre">remove_edge</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">src</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><spanclass="pre">Block</span></a></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">dest</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><spanclass="pre">Block</span></a></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG.remove_edge"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.remove_edge"title="Permalink to this definition"></a></dt>
<dd><p>Remove the edge src -> dest in the control flow graph.</p>
<spanclass="sig-name descname"><spanclass="pre">out_blocks</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">block</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><spanclass="pre">Block</span></a></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><spanclass="pre">Block</span></a><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG.out_blocks"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.out_blocks"title="Permalink to this definition"></a></dt>
<dd><p>Return the list of blocks in the CFG targeted by
<spanclass="sig-name descname"><spanclass="pre">gather_defs</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">Dict</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">,</span></span><spanclass="w"></span><spanclass="pre">Set</span><spanclass="p"><spanclass="pre">[</span></span><aclass="reference internal"href="#Lib.CFG.Block"title="Lib.CFG.Block"><spanclass="pre">Block</span></a><spanclass="p"><spanclass="pre">]</span></span><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG.gather_defs"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.gather_defs"title="Permalink to this definition"></a></dt>
<dd><p>Return a dictionary associating variables to all the blocks
<spanclass="sig-name descname"><spanclass="pre">iter_statements</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">f</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG.iter_statements"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.iter_statements"title="Permalink to this definition"></a></dt>
<dd><p>Apply f to all instructions in all the blocks.</p>
<spanclass="sig-name descname"><spanclass="pre">linearize_naive</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">Iterator</span><spanclass="p"><spanclass="pre">[</span></span><aclass="reference internal"href="Lib.Statement.html#Lib.Statement.Statement"title="Lib.Statement.Statement"><spanclass="pre">Statement</span></a><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG.linearize_naive"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.linearize_naive"title="Permalink to this definition"></a></dt>
<dd><p>Linearize the given control flow graph as a list of instructions.
<spanclass="sig-name descname"><spanclass="pre">print_code</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">output</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">linearize=<function</span><spanclass="pre">CFG.<lambda>></span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">comment=None</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG.print_code"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.print_code"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">print_dot</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">filename</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">DF</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">view</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/CFG.html#CFG.print_dot"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.CFG.CFG.print_dot"title="Permalink to this definition"></a></dt>