<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../../inkwell/all.html"title="show sidebar"></a></div><inputclass="search-input"name="search"aria-label="Run search in the documentation"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><divid="help-button"tabindex="-1"><ahref="../../help.html"title="help">?</a></div><divid="settings-menu"tabindex="-1"><ahref="../../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><sectionid="main-content"class="content"><divclass="main-heading"><h1>Module <ahref="../index.html">inkwell</a>::<wbr><aclass="mod"href="#">debug_info</a><buttonid="copy-path"title="Copy item path to clipboard"><imgsrc="../../static.files/clipboard-7571035ce49a181d.svg"width="19"height="18"alt="Copy item path"></button></h1><spanclass="out-of-band"><aclass="src"href="../../src/inkwell/debug_info.rs.html#1-1606">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>Debug symbols - <code>DebugInfoBuilder</code> interface</p>
<h2id="example-usage"><aclass="doc-anchor"href="#example-usage">§</a>Example usage</h2><h3id="setting-up-the-module-for-holding-debug-info"><aclass="doc-anchor"href="#setting-up-the-module-for-holding-debug-info">§</a>Setting up the module for holding debug info:</h3>
<divclass="example-wrap ignore"><ahref="#"class="tooltip"title="This example is not tested">ⓘ</a><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>context = Context::create();
<divclass="example-wrap ignore"><ahref="#"class="tooltip"title="This example is not tested">ⓘ</a><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>ditype = dibuilder.create_basic_type(
<p>The <code>DISubprogram</code> value must be attached to the generated <code>FunctionValue</code>:</p>
<divclass="example-wrap ignore"><ahref="#"class="tooltip"title="This example is not tested">ⓘ</a><preclass="rust rust-example-rendered"><code><spanclass="comment">/* after creating function: */
<divclass="example-wrap ignore"><ahref="#"class="tooltip"title="This example is not tested">ⓘ</a><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>lexical_block = dibuilder.create_lexical_block(
<p>Before any kind of code generation (including verification passes; they generate code and
validate debug info), do:</p>
<divclass="example-wrap ignore"><ahref="#"class="tooltip"title="This example is not tested">ⓘ</a><preclass="rust rust-example-rendered"><code>dibuilder.finalize();</code></pre></div>
</div></details><h2id="structs"class="section-header">Structs<ahref="#structs"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="struct"href="struct.DIBasicType.html"title="struct inkwell::debug_info::DIBasicType">DIBasicType</a></div><divclass="desc docblock-short">A primitive debug info type created by <code>create_basic_type</code> method of <code>DebugInfoBuilder</code></div></li><li><divclass="item-name"><aclass="struct"href="struct.DICompileUnit.html"title="struct inkwell::debug_info::DICompileUnit">DICompileUnit</a></div><divclass="desc docblock-short">Compilation unit scope for debug info</div></li><li><divclass="item-name"><aclass="struct"href="struct.DICompositeType.html"title="struct inkwell::debug_info::DICompositeType">DICompositeType</a></div><divclass="desc docblock-short">A wrapper around an array of types, such as a union or struct.</div></li><li><divclass="item-name"><aclass="struct"href="struct.DIDerivedType.html"title="struct inkwell::debug_info::DIDerivedType">DIDerivedType</a></div><divclass="desc docblock-short">A wrapper around a single type, such as a typedef or member type.</div></li><li><divclass="item-name"><aclass="struct"href="struct.DIExpression.html"title="struct inkwell::debug_info::DIExpression">DIExpression</a></div><divclass="desc docblock-short">https://llvm.org/docs/LangRef.html#diexpression</div></li><li><divclass="item-name"><aclass="struct"href="struct.DIFile.html"title="struct inkwell::debug_info::DIFile">DIFile</a></div><divclass="desc docblock-short">Source file scope for debug info</div></li><li><divclass="item-name"><aclass="struct"href="struct.DIGlobalVariableExpression.html"title="struct inkwell::debug_info::DIGlobalVariableExpression">DIGlobalVariableExpression</a></div></li><li><divclass="item-name"><aclass="struct"href="struct.DILexicalBlock.html"title="struct inkwell::debug_info::DILexicalBlock">DILexicalBlock</a></div><divclass="desc docblock-short">Lexical block scope for debug info</div></li><li><divclass="item-name"><aclass="struct"href="struct.DILocalVariable.html"title="struct inkwell::debug_info::DILocalVariable">DILocalVariable</a></div><divclass="desc docblock-short">Metadata representing a variable inside a scope</div></li><li><divclass="item-name"><aclass="struct"href="struct.DILocation.html"title="struct inkwell::debug_info::DILocation">DILocation</a></div><divclass="desc docblock-short">A debug location within the source code. Contains the following information:</div></li><li><divclass="item-name"><aclass="struct"href="struct.DINamespace.html"title="struct inkwell::debug_info::DINamespace">DINamespace</a></div><divclass="desc docblock-short">Namespace scope for debug info</div></li><li><divclass="item-name"><aclass="struct"href="struct.DIScope.html"title="struct inkwell::debug_info::DIScope">DIScope</a></div><divclass="desc docblock-short">Any kind of debug information scope (i.e. visibility of a source code symbol). Scopes are
created by special <code>DebugInfoBuilder</code> methods (eg <code>create_lexical_block</code>) and can be turned
into a <code>DIScope</code> with the <code>AsDIScope::as_debug_info_scope</code> trait method.</div></li><li><divclass="item-name"><aclass="struct"href="struct.DISubprogram.html"title="struct inkwell::debug_info::DISubprogram">DISubprogram</a></div><divclass="desc docblock-short">Function body scope for debug info</div></li><li><divclass="item-name"><aclass="struct"href="struct.DISubroutineType.html"title="struct inkwell::debug_info::DISubroutineType">DISubroutineType</a></div><divclass="desc docblock-short">Metadata representing the type of a function</div></li><li><divclass="item-name"><aclass="struct"href="struct.DIType.html"title="struct inkwell::debug_info::DIType">DIType</a></div><divclass="desc docblock-short">Any kind of debug info type</div></li><li><divclass="item-name"><aclass="struct"href="struct.DebugInfoBuilder.html"title="struct inkwell::debug_info::DebugInfoBuilder">DebugInfoBuilder</a></div><divclass="desc docblock-short">A builder object to create debug info metadata. Used along with <code>Builder</code> while producing
IR. Created by <code>Module::create_debug_info_builder</code>. See <code>debug_info</code> module level
documentation for more.</div></li></ul><h2id="enums"class="section-header">Enums<ahref="#enums"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="enum"href="enum.DWARFEmissionKind.html"title="enum inkwell::debug_info::DWARFEmissionKind">DWARFEmissionKind</a></div><divclass="desc docblock-short">The amount of debug information to emit. Corresponds to <code>LLVMDWARFEmissionKind</code> enum from LLVM.</div></li><li><divclass="item-name"><aclass="enum"href="enum.DWARFSourceLanguage.html"title="enum inkwell::debug_info::DWARFSourceLanguage">DWARFSourceLanguage</a></div><divclass="desc docblock-short">Source languages known by DWARF. Corresponds to <code>LLVMDWARFSourceLanguage</code> enum from LLVM.</div></li></ul><h2id="traits"class="section-header">Traits<ahref="#traits"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="trait"href="trait.AsDIScope.html"title="trait inkwell::debug_info::AsDIScope">AsDIScope</a></div><divclass="desc docblock-short">Specific scopes (i.e. <code>DILexicalBlock</code>) can be turned into a <code>DIScope</code> with the
<code>AsDIScope::as_debug_info_scope</code> trait method.</div></li><li><divclass="item-name"><aclass="trait"href="trait.DIFlagsConstants.html"title="trait inkwell::debug_info::DIFlagsConstants">DIFlagsConstants</a></div></li></ul><h2id="functions"class="section-header">Functions<ahref="#functions"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="fn"href="fn.debug_metadata_version.html"title="fn inkwell::debug_info::debug_metadata_version">debug_metadata_version</a></div><divclass="desc docblock-short">Gets the version of debug metadata produced by the current LLVM version.</div></li></ul><h2id="types"class="section-header">Type Aliases<ahref="#types"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="type"href="type.DIFlags.html"title="type inkwell::debug_info::DIFlags">DIFlags</a></div></li><li><divclass="item-name"><aclass="type"href="type.LLVMDWARFTypeEncoding.html"title="type inkwell::debug_info::LLVMDWARFTypeEncoding">LLVMDWARFTypeEncoding</a></div></li></ul></section></div></main></body></html>