mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
350 lines
37 KiB
HTML
350 lines
37 KiB
HTML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<!-- This file is generated by Nim. -->
|
|
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>cgen</title>
|
|
|
|
<!-- Google fonts -->
|
|
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
|
|
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
|
|
|
|
<!-- Favicon -->
|
|
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
|
|
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
|
|
|
|
<!-- CSS -->
|
|
<link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
|
|
|
|
<!-- JS -->
|
|
<script type="text/javascript" src="dochack.js?v=2.3.1"></script>
|
|
</head>
|
|
<body>
|
|
<div class="document" id="documentId">
|
|
<div class="container">
|
|
<h1 class="title">cgen</h1>
|
|
<div class="row">
|
|
<div class="three columns">
|
|
<div class="theme-select-wrapper">
|
|
<label for="theme-select">Theme: </label>
|
|
<select id="theme-select" onchange="setTheme(this.value)">
|
|
<option value="auto">🌗 Match OS</option>
|
|
<option value="dark">🌑 Dark</option>
|
|
<option value="light">🌕 Light</option>
|
|
</select>
|
|
</div>
|
|
<div id="global-links">
|
|
<ul class="simple">
|
|
<li><a id="indexLink" href="theindex.html">Index</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="searchInputDiv">
|
|
Search: <input type="search" id="searchInput" oninput="search()"/>
|
|
</div>
|
|
<div>
|
|
Group by:
|
|
<select onchange="groupBy(this.value)">
|
|
<option value="section">Section</option>
|
|
<option value="type">Type</option>
|
|
</select>
|
|
</div>
|
|
<ul class="simple simple-toc" id="toc-list">
|
|
<li>
|
|
<a class="reference reference-toplevel" href="#6" id="56">Imports</a>
|
|
</li>
|
|
<li>
|
|
<details open>
|
|
<summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
|
|
<ul class="simple simple-toc-section">
|
|
<ul class="simple nested-toc-section">cgenWriteModules
|
|
<li><a class="reference" href="#cgenWriteModules%2CRootRef%2CConfigRef" title="cgenWriteModules(backend: RootRef; config: ConfigRef)">cgenWriteModules(backend: RootRef; config: ConfigRef)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">fillObjectFields
|
|
<li><a class="reference" href="#fillObjectFields%2CBModule%2CPType" title="fillObjectFields(m: BModule; typ: PType)">fillObjectFields(m: BModule; typ: PType)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">finalCodegenActions
|
|
<li><a class="reference" href="#finalCodegenActions%2CModuleGraph%2CBModule%2CPNode" title="finalCodegenActions(graph: ModuleGraph; m: BModule; n: PNode)">finalCodegenActions(graph: ModuleGraph; m: BModule; n: PNode)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">genProcLvl3
|
|
<li><a class="reference" href="#genProcLvl3%2CBModule%2CPSym" title="genProcLvl3(m: BModule; prc: PSym)">genProcLvl3(m: BModule; prc: PSym)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">genTopLevelStmt
|
|
<li><a class="reference" href="#genTopLevelStmt%2CBModule%2CPNode" title="genTopLevelStmt(m: BModule; n: PNode)">genTopLevelStmt(m: BModule; n: PNode)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">genTypeInfo
|
|
<li><a class="reference" href="#genTypeInfo%2CConfigRef%2CBModule%2CPType%2CTLineInfo" title="genTypeInfo(config: ConfigRef; m: BModule; t: PType; info: TLineInfo): Rope">genTypeInfo(config: ConfigRef; m: BModule; t: PType; info: TLineInfo): Rope</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">multiFormat
|
|
<li><a class="reference" href="#multiFormat%2Cstring%2CstaticopenArray%5Bchar%5D%2CopenArray%5Bseq%5Bstring%5D%5D" title="multiFormat(frmt: var string; chars: static openArray[char];
|
|
args: openArray[seq[string]])">multiFormat(frmt: var string; chars: static openArray[char];
|
|
args: openArray[seq[string]])</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">newModule
|
|
<li><a class="reference" href="#newModule%2CBModuleList%2CPSym%2CConfigRef%2CIdGenerator" title="newModule(g: BModuleList; module: PSym; conf: ConfigRef; idgen: IdGenerator): BModule">newModule(g: BModuleList; module: PSym; conf: ConfigRef; idgen: IdGenerator): BModule</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">registerInitProcs
|
|
<li><a class="reference" href="#registerInitProcs%2CBModuleList%2CPSym%2Cset%5BModuleBackendFlag%5D" title="registerInitProcs(g: BModuleList; m: PSym; flags: set[ModuleBackendFlag])">registerInitProcs(g: BModuleList; m: PSym; flags: set[ModuleBackendFlag])</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">setupCgen
|
|
<li><a class="reference" href="#setupCgen%2CModuleGraph%2CPSym%2CIdGenerator" title="setupCgen(graph: ModuleGraph; module: PSym; idgen: IdGenerator): PPassContext">setupCgen(graph: ModuleGraph; module: PSym; idgen: IdGenerator): PPassContext</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">whichInitProcs
|
|
<li><a class="reference" href="#whichInitProcs%2CBModule" title="whichInitProcs(m: BModule): set[ModuleBackendFlag]">whichInitProcs(m: BModule): set[ModuleBackendFlag]</a></li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
</details>
|
|
</li>
|
|
<li>
|
|
<details open>
|
|
<summary><a class="reference reference-toplevel" href="#18" id="68">Templates</a></summary>
|
|
<ul class="simple simple-toc-section">
|
|
<ul class="simple nested-toc-section">cgDeclFrmt
|
|
<li><a class="reference" href="#cgDeclFrmt.t%2CPSym" title="cgDeclFrmt(s: PSym): string">cgDeclFrmt(s: PSym): string</a></li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
</details>
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
<div class="nine columns" id="content">
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/cgen.nim#L1" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/cgen.nim#L1" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
<div id="tocRoot"></div>
|
|
|
|
<p class="module-desc">This module implements the C code generator.This include file contains the logic to produce constant string and seq literals. The code here is responsible that <tt class="docutils literal"><span class="pre">const x = ["a", "b"]</span></tt> works without hidden runtime creation code. The price is that seqs and strings are not purely a library implementation.Generates traversal procs for the C backend.Code specialization instead of the old, incredibly slow 'genericReset' implementation.Thread var support for architectures that lack native support for thread local storage.</p>
|
|
<div class="section" id="6">
|
|
<h1><a class="toc-backref" href="#6">Imports</a></h1>
|
|
<dl class="item">
|
|
<a class="reference external" href="ast.html">ast</a>, <a class="reference external" href="astalgo.html">astalgo</a>, <a class="reference external" href="trees.html">trees</a>, <a class="reference external" href="platform.html">platform</a>, <a class="reference external" href="magicsys.html">magicsys</a>, <a class="reference external" href="extccomp.html">extccomp</a>, <a class="reference external" href="options.html">options</a>, <a class="reference external" href="nversion.html">nversion</a>, <a class="reference external" href="nimsets.html">nimsets</a>, <a class="reference external" href="msgs.html">msgs</a>, <a class="reference external" href="bitsets.html">bitsets</a>, <a class="reference external" href="idents.html">idents</a>, <a class="reference external" href="types.html">types</a>, <a class="reference external" href="ccgutils.html">ccgutils</a>, <a class="reference external" href="ropes.html">ropes</a>, <a class="reference external" href="wordrecg.html">wordrecg</a>, <a class="reference external" href="treetab.html">treetab</a>, <a class="reference external" href="cgmeth.html">cgmeth</a>, <a class="reference external" href="rodutils.html">rodutils</a>, <a class="reference external" href="renderer.html">renderer</a>, <a class="reference external" href="cgendata.html">cgendata</a>, <a class="reference external" href="aliases.html">aliases</a>, <a class="reference external" href="lowerings.html">lowerings</a>, <a class="reference external" href="lineinfos.html">lineinfos</a>, <a class="reference external" href="pathutils.html">pathutils</a>, <a class="reference external" href="transf.html">transf</a>, <a class="reference external" href="injectdestructors.html">injectdestructors</a>, <a class="reference external" href="astmsgs.html">astmsgs</a>, <a class="reference external" href="modulepaths.html">modulepaths</a>, <a class="reference external" href="pushpoppragmas.html">pushpoppragmas</a>, <a class="reference external" href="mangleutils.html">mangleutils</a>, <a class="reference external" href="cbuilderbase.html">cbuilderbase</a>, <a class="reference external" href="modulegraphs.html">modulegraphs</a>, <a class="reference external" href="expanddefaults.html">expanddefaults</a>, <a class="reference external" href="pipelineutils.html">pipelineutils</a>, <a class="reference external" href="spawn.html">spawn</a>, <a class="reference external" href="semparallel.html">semparallel</a>, <a class="reference external" href="ic/ic.html">ic/ic</a>, <a class="reference external" href="sighashes.html">sighashes</a>, <a class="reference external" href="aliasanalysis.html">aliasanalysis</a>, <a class="reference external" href="parampatterns.html">parampatterns</a>
|
|
</dl>
|
|
</div>
|
|
<div class="section" id="12">
|
|
<h1><a class="toc-backref" href="#12">Procs</a></h1>
|
|
<dl class="item">
|
|
<div id="cgenWriteModules-procs-all">
|
|
<div id="cgenWriteModules,RootRef,ConfigRef">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#cgenWriteModules%2CRootRef%2CConfigRef"><span class="Identifier">cgenWriteModules</span></a><span class="Other">(</span><span class="Identifier">backend</span><span class="Other">:</span> <span class="Identifier">RootRef</span><span class="Other">;</span> <span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">,</span>
|
|
<span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">ERecoverableError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span>
|
|
<span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">,</span>
|
|
<span class="Identifier">TimeEffect</span><span class="Other">,</span> <span class="Identifier">WriteDirEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/cgen.nim#L2666" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/cgen.nim#L2666" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="fillObjectFields-procs-all">
|
|
<div id="fillObjectFields,BModule,PType">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#fillObjectFields%2CBModule%2CPType"><span class="Identifier">fillObjectFields</span></a><span class="Other">(</span><span class="Identifier">m</span><span class="Other">:</span> <a href="cgendata.html#BModule"><span class="Identifier">BModule</span></a><span class="Other">;</span> <span class="Identifier">typ</span><span class="Other">:</span> <a href="astdef.html#PType"><span class="Identifier">PType</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span>
|
|
<span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">ERecoverableError</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span>
|
|
<span class="Identifier">ReadDirEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ccgtypes.nim#L766" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ccgtypes.nim#L766" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="finalCodegenActions-procs-all">
|
|
<div id="finalCodegenActions,ModuleGraph,BModule,PNode">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#finalCodegenActions%2CModuleGraph%2CBModule%2CPNode"><span class="Identifier">finalCodegenActions</span></a><span class="Other">(</span><span class="Identifier">graph</span><span class="Other">:</span> <a href="modulegraphs.html#ModuleGraph"><span class="Identifier">ModuleGraph</span></a><span class="Other">;</span> <span class="Identifier">m</span><span class="Other">:</span> <a href="cgendata.html#BModule"><span class="Identifier">BModule</span></a><span class="Other">;</span> <span class="Identifier">n</span><span class="Other">:</span> <a href="astdef.html#PNode"><span class="Identifier">PNode</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span>
|
|
<span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">ERecoverableError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span>
|
|
<span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">,</span>
|
|
<span class="Identifier">TimeEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
Also called from IC.
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/cgen.nim#L2586" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/cgen.nim#L2586" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="genProcLvl3-procs-all">
|
|
<div id="genProcLvl3,BModule,PSym">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#genProcLvl3%2CBModule%2CPSym"><span class="Identifier">genProcLvl3</span></a><span class="Other">(</span><span class="Identifier">m</span><span class="Other">:</span> <a href="cgendata.html#BModule"><span class="Identifier">BModule</span></a><span class="Other">;</span> <span class="Identifier">prc</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span>
|
|
<span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">ERecoverableError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span>
|
|
<span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">,</span> <span class="Identifier">TimeEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/cgen.nim#L1302" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/cgen.nim#L1302" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="genTopLevelStmt-procs-all">
|
|
<div id="genTopLevelStmt,BModule,PNode">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#genTopLevelStmt%2CBModule%2CPNode"><span class="Identifier">genTopLevelStmt</span></a><span class="Other">(</span><span class="Identifier">m</span><span class="Other">:</span> <a href="cgendata.html#BModule"><span class="Identifier">BModule</span></a><span class="Other">;</span> <span class="Identifier">n</span><span class="Other">:</span> <a href="astdef.html#PNode"><span class="Identifier">PNode</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span>
|
|
<span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">ERecoverableError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span>
|
|
<span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">,</span> <span class="Identifier">TimeEffect</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
Also called from <tt class="docutils literal"><span class="pre"><span class="Identifier">ic</span><span class="Operator">/</span><span class="Identifier">cbackend</span><span class="Operator">.</span><span class="Identifier">nim</span></span></tt>.
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/cgen.nim#L2490" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/cgen.nim#L2490" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="genTypeInfo-procs-all">
|
|
<div id="genTypeInfo,ConfigRef,BModule,PType,TLineInfo">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#genTypeInfo%2CConfigRef%2CBModule%2CPType%2CTLineInfo"><span class="Identifier">genTypeInfo</span></a><span class="Other">(</span><span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">;</span> <span class="Identifier">m</span><span class="Other">:</span> <a href="cgendata.html#BModule"><span class="Identifier">BModule</span></a><span class="Other">;</span> <span class="Identifier">t</span><span class="Other">:</span> <a href="astdef.html#PType"><span class="Identifier">PType</span></a><span class="Other">;</span> <span class="Identifier">info</span><span class="Other">:</span> <a href="lineinfos.html#TLineInfo"><span class="Identifier">TLineInfo</span></a><span class="Other">)</span><span class="Other">:</span> <a href="ropes.html#Rope"><span class="Identifier">Rope</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span>
|
|
<span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">ERecoverableError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span>
|
|
<span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ccgtypes.nim#L2060" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ccgtypes.nim#L2060" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="multiFormat-procs-all">
|
|
<div id="multiFormat,string,staticopenArray[char],openArray[seq[string]]">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#multiFormat%2Cstring%2CstaticopenArray%5Bchar%5D%2CopenArray%5Bseq%5Bstring%5D%5D"><span class="Identifier">multiFormat</span></a><span class="Other">(</span><span class="Identifier">frmt</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">chars</span><span class="Other">:</span> <span class="Identifier">static</span> <span class="Identifier">openArray</span><span class="Other">[</span><span class="Identifier">char</span><span class="Other">]</span><span class="Other">;</span>
|
|
<span class="Identifier">args</span><span class="Other">:</span> <span class="Identifier">openArray</span><span class="Other">[</span><span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ccgtypes.nim#L479" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ccgtypes.nim#L479" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="newModule-procs-all">
|
|
<div id="newModule,BModuleList,PSym,ConfigRef,IdGenerator">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#newModule%2CBModuleList%2CPSym%2CConfigRef%2CIdGenerator"><span class="Identifier">newModule</span></a><span class="Other">(</span><span class="Identifier">g</span><span class="Other">:</span> <a href="cgendata.html#BModuleList"><span class="Identifier">BModuleList</span></a><span class="Other">;</span> <span class="Identifier">module</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">;</span> <span class="Identifier">conf</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">;</span> <span class="Identifier">idgen</span><span class="Other">:</span> <a href="ast.html#IdGenerator"><span class="Identifier">IdGenerator</span></a><span class="Other">)</span><span class="Other">:</span> <a href="cgendata.html#BModule"><span class="Identifier">BModule</span></a> {.
|
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span>
|
|
<span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/cgen.nim#L64" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/cgen.nim#L64" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="registerInitProcs-procs-all">
|
|
<div id="registerInitProcs,BModuleList,PSym,set[ModuleBackendFlag]">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#registerInitProcs%2CBModuleList%2CPSym%2Cset%5BModuleBackendFlag%5D"><span class="Identifier">registerInitProcs</span></a><span class="Other">(</span><span class="Identifier">g</span><span class="Other">:</span> <a href="cgendata.html#BModuleList"><span class="Identifier">BModuleList</span></a><span class="Other">;</span> <span class="Identifier">m</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">;</span> <span class="Identifier">flags</span><span class="Other">:</span> <span class="Identifier">set</span><span class="Other">[</span><a href="ic/ic.html#ModuleBackendFlag"><span class="Identifier">ModuleBackendFlag</span></a><span class="Other">]</span><span class="Other">)</span> {.
|
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span>
|
|
<span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
Called from the IC backend.
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/cgen.nim#L1929" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/cgen.nim#L1929" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="setupCgen-procs-all">
|
|
<div id="setupCgen,ModuleGraph,PSym,IdGenerator">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#setupCgen%2CModuleGraph%2CPSym%2CIdGenerator"><span class="Identifier">setupCgen</span></a><span class="Other">(</span><span class="Identifier">graph</span><span class="Other">:</span> <a href="modulegraphs.html#ModuleGraph"><span class="Identifier">ModuleGraph</span></a><span class="Other">;</span> <span class="Identifier">module</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">;</span> <span class="Identifier">idgen</span><span class="Other">:</span> <a href="ast.html#IdGenerator"><span class="Identifier">IdGenerator</span></a><span class="Other">)</span><span class="Other">:</span> <a href="modulegraphs.html#PPassContext"><span class="Identifier">PPassContext</span></a> {.
|
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span>
|
|
<span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">,</span>
|
|
<span class="Identifier">WriteDirEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/cgen.nim#L2404" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/cgen.nim#L2404" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="whichInitProcs-procs-all">
|
|
<div id="whichInitProcs,BModule">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#whichInitProcs%2CBModule"><span class="Identifier">whichInitProcs</span></a><span class="Other">(</span><span class="Identifier">m</span><span class="Other">:</span> <a href="cgendata.html#BModule"><span class="Identifier">BModule</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">set</span><span class="Other">[</span><a href="ic/ic.html#ModuleBackendFlag"><span class="Identifier">ModuleBackendFlag</span></a><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/cgen.nim#L1949" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/cgen.nim#L1949" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</dl>
|
|
</div>
|
|
<div class="section" id="18">
|
|
<h1><a class="toc-backref" href="#18">Templates</a></h1>
|
|
<dl class="item">
|
|
<div id="cgDeclFrmt-templates-all">
|
|
<div id="cgDeclFrmt.t,PSym">
|
|
<dt><pre><span class="Keyword">template</span> <a href="#cgDeclFrmt.t%2CPSym"><span class="Identifier">cgDeclFrmt</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/cbuilderdecls.nim#L437" class="link-seesrc" target="_blank">Source</a>
|
|
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/cbuilderdecls.nim#L437" class="link-seesrc" target="_blank" >Edit</a>
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</dl>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="twelve-columns footer">
|
|
<span class="nim-sprite"></span>
|
|
<br>
|
|
<small style="color: var(--hint);">Made with Nim. Generated: 2025-12-29 13:02:51 UTC</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
|
|
|
|
</body>
|
|
</html>
|