CAP/docs/html/api/Lib.Terminator.html
2024-12-01 16:25:18 +01:00

292 lines
33 KiB
HTML

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lib.Terminator module &mdash; MiniC documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/sphinx_highlight.js"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Lib.Dominators module" href="Lib.Dominators.html" />
<link rel="prev" title="Lib.CFG module" href="Lib.CFG.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
MiniC
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="Lib.Errors.html">Base library - Errors</a></li>
<li class="toctree-l1"><a class="reference internal" href="Lib.Statement.html">Base library - Statement</a></li>
<li class="toctree-l1"><a class="reference internal" href="Lib.RiscV.html">Base library - RISC-V instructions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Lib.Operands.html">Base library - Operands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Lib.FunctionData.html">Base library - Function data</a></li>
<li class="toctree-l1"><a class="reference internal" href="Lib.Graphes.html">Base library - Graphs</a></li>
<li class="toctree-l1"><a class="reference internal" href="Lib.LinearCode.html">Linear intermediate representation</a></li>
<li class="toctree-l1"><a class="reference internal" href="Lib.Allocator.html">Temporary allocation</a></li>
<li class="toctree-l1"><a class="reference internal" href="Lib.CFG.html">Control Flow Graph - CFG and Basic blocks</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Control Flow Graph - Terminators</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#Lib.Terminator.Return"><code class="docutils literal notranslate"><span class="pre">Return</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.Return.printIns"><code class="docutils literal notranslate"><span class="pre">Return.printIns()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.Return.targets"><code class="docutils literal notranslate"><span class="pre">Return.targets()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.Return.args"><code class="docutils literal notranslate"><span class="pre">Return.args()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.Return.rename"><code class="docutils literal notranslate"><span class="pre">Return.rename()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.Return.substitute"><code class="docutils literal notranslate"><span class="pre">Return.substitute()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.Return.with_args"><code class="docutils literal notranslate"><span class="pre">Return.with_args()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.Return.is_read_only"><code class="docutils literal notranslate"><span class="pre">Return.is_read_only()</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#Lib.Terminator.BranchingTerminator"><code class="docutils literal notranslate"><span class="pre">BranchingTerminator</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.BranchingTerminator.cond"><code class="docutils literal notranslate"><span class="pre">BranchingTerminator.cond</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.BranchingTerminator.label_then"><code class="docutils literal notranslate"><span class="pre">BranchingTerminator.label_then</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.BranchingTerminator.label_else"><code class="docutils literal notranslate"><span class="pre">BranchingTerminator.label_else</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.BranchingTerminator.op1"><code class="docutils literal notranslate"><span class="pre">BranchingTerminator.op1</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.BranchingTerminator.op2"><code class="docutils literal notranslate"><span class="pre">BranchingTerminator.op2</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.BranchingTerminator.args"><code class="docutils literal notranslate"><span class="pre">BranchingTerminator.args()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.BranchingTerminator.targets"><code class="docutils literal notranslate"><span class="pre">BranchingTerminator.targets()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.BranchingTerminator.rename"><code class="docutils literal notranslate"><span class="pre">BranchingTerminator.rename()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.BranchingTerminator.substitute"><code class="docutils literal notranslate"><span class="pre">BranchingTerminator.substitute()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#Lib.Terminator.BranchingTerminator.with_args"><code class="docutils literal notranslate"><span class="pre">BranchingTerminator.with_args()</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#Lib.Terminator.Terminator"><code class="docutils literal notranslate"><span class="pre">Terminator</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#Lib.Terminator.jump2terminator"><code class="docutils literal notranslate"><span class="pre">jump2terminator()</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Lib.Dominators.html">SSA form - Dominance frontier</a></li>
<li class="toctree-l1"><a class="reference internal" href="Lib.PhiNode.html">SSA form - Phi Nodes</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">MiniC</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Lib.Terminator module</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/api/Lib.Terminator.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="module-Lib.Terminator">
<span id="lib-terminator-module"></span><h1>Lib.Terminator module<a class="headerlink" href="#module-Lib.Terminator" title="Permalink to this heading"></a></h1>
<p>MIF08, CAP, CFG library - Terminators.</p>
<p>Each <a class="reference internal" href="Lib.CFG.html#Lib.CFG.Block" title="Lib.CFG.Block"><code class="xref py py-class docutils literal notranslate"><span class="pre">block</span></code></a> of a <a class="reference internal" href="Lib.CFG.html#Lib.CFG.CFG" title="Lib.CFG.CFG"><code class="xref py py-class docutils literal notranslate"><span class="pre">CFG</span></code></a>
ends with a branching instruction called a terminator.
There are three kinds of terminators:</p>
<ul class="simple">
<li><p><a class="reference internal" href="Lib.Statement.html#Lib.Statement.AbsoluteJump" title="Lib.Statement.AbsoluteJump"><code class="xref py py-class docutils literal notranslate"><span class="pre">Lib.Statement.AbsoluteJump</span></code></a> is a non-conditional jump
to another block of the CFG</p></li>
<li><p><a class="reference internal" href="#Lib.Terminator.BranchingTerminator" title="Lib.Terminator.BranchingTerminator"><code class="xref py py-class docutils literal notranslate"><span class="pre">BranchingTerminator</span></code></a> is a conditional branching
instruction with two successor blocks.
Unlike the class <a class="reference internal" href="Lib.Statement.html#Lib.Statement.ConditionalJump" title="Lib.Statement.ConditionalJump"><code class="xref py py-class docutils literal notranslate"><span class="pre">ConditionalJump</span></code></a>
that was used in <a class="reference internal" href="Lib.LinearCode.html#Lib.LinearCode.LinearCode" title="Lib.LinearCode.LinearCode"><code class="xref py py-class docutils literal notranslate"><span class="pre">LinearCode</span></code></a>,
both successor labels have to be specified.</p></li>
<li><p><a class="reference internal" href="#Lib.Terminator.Return" title="Lib.Terminator.Return"><code class="xref py py-class docutils literal notranslate"><span class="pre">Return</span></code></a> marks the end of the function</p></li>
</ul>
<p>During the construction of the CFG, <a class="reference internal" href="#Lib.Terminator.jump2terminator" title="Lib.Terminator.jump2terminator"><code class="xref py py-func docutils literal notranslate"><span class="pre">jump2terminator()</span></code></a> builds
a terminator for each extracted chunk of instructions.</p>
<dl class="py class">
<dt class="sig sig-object py" id="Lib.Terminator.Return">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">Lib.Terminator.</span></span><span class="sig-name descname"><span class="pre">Return</span></span><a class="reference internal" href="../_modules/Lib/Terminator.html#Return"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.Return" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="Lib.Statement.html#Lib.Statement.Statement" title="Lib.Statement.Statement"><code class="xref py py-class docutils literal notranslate"><span class="pre">Statement</span></code></a></p>
<p>A terminator that marks the end of the function.</p>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Terminator.Return.printIns">
<span class="sig-name descname"><span class="pre">printIns</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">stream</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/Lib/Terminator.html#Return.printIns"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.Return.printIns" title="Permalink to this definition"></a></dt>
<dd><p>Print the statement on the given output.
Should never be called on the base class.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Terminator.Return.targets">
<span class="sig-name descname"><span class="pre">targets</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="Lib.Statement.html#Lib.Statement.Label" title="Lib.Statement.Label"><span class="pre">Label</span></a><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="../_modules/Lib/Terminator.html#Return.targets"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.Return.targets" title="Permalink to this definition"></a></dt>
<dd><p>Return the labels targetted by the Return terminator.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Terminator.Return.args">
<span class="sig-name descname"><span class="pre">args</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Operand" title="Lib.Operands.Operand"><span class="pre">Operand</span></a><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="../_modules/Lib/Terminator.html#Return.args"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.Return.args" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Terminator.Return.rename">
<span class="sig-name descname"><span class="pre">rename</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">renamer</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Renamer" title="Lib.Operands.Renamer"><span class="pre">Renamer</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/Lib/Terminator.html#Return.rename"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.Return.rename" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Terminator.Return.substitute">
<span class="sig-name descname"><span class="pre">substitute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">subst</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Dict</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Operand" title="Lib.Operands.Operand"><span class="pre">Operand</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Operand" title="Lib.Operands.Operand"><span class="pre">Operand</span></a><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/Lib/Terminator.html#Return.substitute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.Return.substitute" title="Permalink to this definition"></a></dt>
<dd><p>Return a new instruction, cloned from this one, replacing operands
that appear as key in subst by their value.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Terminator.Return.with_args">
<span class="sig-name descname"><span class="pre">with_args</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">new_args</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Operand" title="Lib.Operands.Operand"><span class="pre">Operand</span></a><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/Lib/Terminator.html#Return.with_args"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.Return.with_args" title="Permalink to this definition"></a></dt>
<dd><p>Return a new instruction, cloned from this one, where operands have
been replaced by new_args.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Terminator.Return.is_read_only">
<span class="sig-name descname"><span class="pre">is_read_only</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="reference internal" href="../_modules/Lib/Terminator.html#Return.is_read_only"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.Return.is_read_only" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="Lib.Terminator.BranchingTerminator">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">Lib.Terminator.</span></span><span class="sig-name descname"><span class="pre">BranchingTerminator</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cond</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Condition" title="Lib.Operands.Condition"><span class="pre">Condition</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">op1</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Operand" title="Lib.Operands.Operand"><span class="pre">Operand</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">op2</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Operand" title="Lib.Operands.Operand"><span class="pre">Operand</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">label_then</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="Lib.Statement.html#Lib.Statement.Label" title="Lib.Statement.Label"><span class="pre">Label</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">label_else</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="Lib.Statement.html#Lib.Statement.Label" title="Lib.Statement.Label"><span class="pre">Label</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/Lib/Terminator.html#BranchingTerminator"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.BranchingTerminator" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="Lib.Statement.html#Lib.Statement.Instruction" title="Lib.Statement.Instruction"><code class="xref py py-class docutils literal notranslate"><span class="pre">Instruction</span></code></a></p>
<p>A terminating statement with a condition.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="Lib.Terminator.BranchingTerminator.cond">
<span class="sig-name descname"><span class="pre">cond</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Condition" title="Lib.Operands.Condition"><span class="pre">Condition</span></a></em><a class="headerlink" href="#Lib.Terminator.BranchingTerminator.cond" title="Permalink to this definition"></a></dt>
<dd><p>The condition of the branch</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="Lib.Terminator.BranchingTerminator.label_then">
<span class="sig-name descname"><span class="pre">label_then</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference internal" href="Lib.Statement.html#Lib.Statement.Label" title="Lib.Statement.Label"><span class="pre">Label</span></a></em><a class="headerlink" href="#Lib.Terminator.BranchingTerminator.label_then" title="Permalink to this definition"></a></dt>
<dd><p>The destination label if the condition is true</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="Lib.Terminator.BranchingTerminator.label_else">
<span class="sig-name descname"><span class="pre">label_else</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference internal" href="Lib.Statement.html#Lib.Statement.Label" title="Lib.Statement.Label"><span class="pre">Label</span></a></em><a class="headerlink" href="#Lib.Terminator.BranchingTerminator.label_else" title="Permalink to this definition"></a></dt>
<dd><p>The destination label if the condition is false</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="Lib.Terminator.BranchingTerminator.op1">
<span class="sig-name descname"><span class="pre">op1</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Operand" title="Lib.Operands.Operand"><span class="pre">Operand</span></a></em><a class="headerlink" href="#Lib.Terminator.BranchingTerminator.op1" title="Permalink to this definition"></a></dt>
<dd><p>The first operand of the condition</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="Lib.Terminator.BranchingTerminator.op2">
<span class="sig-name descname"><span class="pre">op2</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Operand" title="Lib.Operands.Operand"><span class="pre">Operand</span></a></em><a class="headerlink" href="#Lib.Terminator.BranchingTerminator.op2" title="Permalink to this definition"></a></dt>
<dd><p>The second operand of the condition</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Terminator.BranchingTerminator.args">
<span class="sig-name descname"><span class="pre">args</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Operand" title="Lib.Operands.Operand"><span class="pre">Operand</span></a><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="../_modules/Lib/Terminator.html#BranchingTerminator.args"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.BranchingTerminator.args" title="Permalink to this definition"></a></dt>
<dd><p>List of operands the instruction takes</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Terminator.BranchingTerminator.targets">
<span class="sig-name descname"><span class="pre">targets</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="Lib.Statement.html#Lib.Statement.Label" title="Lib.Statement.Label"><span class="pre">Label</span></a><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="../_modules/Lib/Terminator.html#BranchingTerminator.targets"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.BranchingTerminator.targets" title="Permalink to this definition"></a></dt>
<dd><p>Return the labels targetted by the Branching terminator.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Terminator.BranchingTerminator.rename">
<span class="sig-name descname"><span class="pre">rename</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">renamer</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Renamer" title="Lib.Operands.Renamer"><span class="pre">Renamer</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/Lib/Terminator.html#BranchingTerminator.rename"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.BranchingTerminator.rename" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Terminator.BranchingTerminator.substitute">
<span class="sig-name descname"><span class="pre">substitute</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">subst</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Dict</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Operand" title="Lib.Operands.Operand"><span class="pre">Operand</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Operand" title="Lib.Operands.Operand"><span class="pre">Operand</span></a><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/Lib/Terminator.html#BranchingTerminator.substitute"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.BranchingTerminator.substitute" title="Permalink to this definition"></a></dt>
<dd><p>Return a new instruction, cloned from this one, replacing operands
that appear as key in subst by their value.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Terminator.BranchingTerminator.with_args">
<span class="sig-name descname"><span class="pre">with_args</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">new_args</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="Lib.Operands.html#Lib.Operands.Operand" title="Lib.Operands.Operand"><span class="pre">Operand</span></a><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/Lib/Terminator.html#BranchingTerminator.with_args"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.BranchingTerminator.with_args" title="Permalink to this definition"></a></dt>
<dd><p>Return a new instruction, cloned from this one, where operands have
been replaced by new_args.</p>
</dd></dl>
</dd></dl>
<dl class="py data">
<dt class="sig sig-object py" id="Lib.Terminator.Terminator">
<span class="sig-prename descclassname"><span class="pre">Lib.Terminator.</span></span><span class="sig-name descname"><span class="pre">Terminator</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">Lib.Terminator.Return</span> <span class="pre">|</span> <span class="pre">Lib.Statement.AbsoluteJump</span> <span class="pre">|</span> <span class="pre">Lib.Terminator.BranchingTerminator</span></em><a class="headerlink" href="#Lib.Terminator.Terminator" title="Permalink to this definition"></a></dt>
<dd><p>Type alias for terminators</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="Lib.Terminator.jump2terminator">
<span class="sig-prename descclassname"><span class="pre">Lib.Terminator.</span></span><span class="sig-name descname"><span class="pre">jump2terminator</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">j</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="Lib.Statement.html#Lib.Statement.ConditionalJump" title="Lib.Statement.ConditionalJump"><span class="pre">ConditionalJump</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="Lib.Statement.html#Lib.Statement.AbsoluteJump" title="Lib.Statement.AbsoluteJump"><span class="pre">AbsoluteJump</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">next_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="Lib.Statement.html#Lib.Statement.Label" title="Lib.Statement.Label"><span class="pre">Label</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#Lib.Terminator.Return" title="Lib.Terminator.Return"><span class="pre">Return</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="Lib.Statement.html#Lib.Statement.AbsoluteJump" title="Lib.Statement.AbsoluteJump"><span class="pre">AbsoluteJump</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="#Lib.Terminator.BranchingTerminator" title="Lib.Terminator.BranchingTerminator"><span class="pre">BranchingTerminator</span></a></span></span><a class="reference internal" href="../_modules/Lib/Terminator.html#jump2terminator"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Terminator.jump2terminator" title="Permalink to this definition"></a></dt>
<dd><p>Construct the Terminator associated to the potential jump j
to the potential label next_label.</p>
</dd></dl>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="Lib.CFG.html" class="btn btn-neutral float-left" title="Lib.CFG module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="Lib.Dominators.html" class="btn btn-neutral float-right" title="Lib.Dominators module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2023, compil-lyon.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>