mirror of
https://github.com/fluencelabs/wasmer
synced 2025-04-25 10:22:19 +00:00
73 lines
43 KiB
HTML
73 lines
43 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Context` struct in crate `cranelift_codegen`."><meta name="keywords" content="rust, rustlang, rust-lang, Context"><title>cranelift_codegen::Context - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../cranelift_codegen/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Context</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.func">func</a><a href="#structfield.cfg">cfg</a><a href="#structfield.domtree">domtree</a><a href="#structfield.regalloc">regalloc</a><a href="#structfield.loop_analysis">loop_analysis</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.build_value_labels_ranges">build_value_labels_ranges</a><a href="#method.canonicalize_nans">canonicalize_nans</a><a href="#method.clear">clear</a><a href="#method.compile">compile</a><a href="#method.compile_and_emit">compile_and_emit</a><a href="#method.compute_cfg">compute_cfg</a><a href="#method.compute_domtree">compute_domtree</a><a href="#method.compute_loop_analysis">compute_loop_analysis</a><a href="#method.dce">dce</a><a href="#method.eliminate_unreachable_code">eliminate_unreachable_code</a><a href="#method.emit_to_memory">emit_to_memory</a><a href="#method.flowgraph">flowgraph</a><a href="#method.for_function">for_function</a><a href="#method.legalize">legalize</a><a href="#method.licm">licm</a><a href="#method.new">new</a><a href="#method.postopt">postopt</a><a href="#method.preopt">preopt</a><a href="#method.prologue_epilogue">prologue_epilogue</a><a href="#method.regalloc">regalloc</a><a href="#method.relax_branches">relax_branches</a><a href="#method.shrink_instructions">shrink_instructions</a><a href="#method.simple_gvn">simple_gvn</a><a href="#method.verify">verify</a><a href="#method.verify_if">verify_if</a><a href="#method.verify_locations">verify_locations</a><a href="#method.verify_locations_if">verify_locations_if</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='index.html'>cranelift_codegen</a></p><script>window.sidebarCurrent = {name: 'Context', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/cranelift_codegen/context.rs.html#37-52' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>cranelift_codegen</a>::<wbr><a class="struct" href=''>Context</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Context {
|
||
pub func: <a class="struct" href="../cranelift_codegen/ir/function/struct.Function.html" title="struct cranelift_codegen::ir::function::Function">Function</a>,
|
||
pub cfg: <a class="struct" href="../cranelift_codegen/flowgraph/struct.ControlFlowGraph.html" title="struct cranelift_codegen::flowgraph::ControlFlowGraph">ControlFlowGraph</a>,
|
||
pub domtree: <a class="struct" href="../cranelift_codegen/dominator_tree/struct.DominatorTree.html" title="struct cranelift_codegen::dominator_tree::DominatorTree">DominatorTree</a>,
|
||
pub regalloc: Context,
|
||
pub loop_analysis: <a class="struct" href="../cranelift_codegen/loop_analysis/struct.LoopAnalysis.html" title="struct cranelift_codegen::loop_analysis::LoopAnalysis">LoopAnalysis</a>,
|
||
}</pre></div><div class='docblock'><p>Persistent data structures and compilation pipeline.</p>
|
||
</div><h2 id='fields' class='fields small-section-header'>
|
||
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.func" class="structfield small-section-header"><a href="#structfield.func" class="anchor field"></a><code id="func.v">func: <a class="struct" href="../cranelift_codegen/ir/function/struct.Function.html" title="struct cranelift_codegen::ir::function::Function">Function</a></code></span><div class='docblock'><p>The function we're compiling.</p>
|
||
</div><span id="structfield.cfg" class="structfield small-section-header"><a href="#structfield.cfg" class="anchor field"></a><code id="cfg.v">cfg: <a class="struct" href="../cranelift_codegen/flowgraph/struct.ControlFlowGraph.html" title="struct cranelift_codegen::flowgraph::ControlFlowGraph">ControlFlowGraph</a></code></span><div class='docblock'><p>The control flow graph of <code>func</code>.</p>
|
||
</div><span id="structfield.domtree" class="structfield small-section-header"><a href="#structfield.domtree" class="anchor field"></a><code id="domtree.v">domtree: <a class="struct" href="../cranelift_codegen/dominator_tree/struct.DominatorTree.html" title="struct cranelift_codegen::dominator_tree::DominatorTree">DominatorTree</a></code></span><div class='docblock'><p>Dominator tree for <code>func</code>.</p>
|
||
</div><span id="structfield.regalloc" class="structfield small-section-header"><a href="#structfield.regalloc" class="anchor field"></a><code id="regalloc.v">regalloc: Context</code></span><div class='docblock'><p>Register allocation context.</p>
|
||
</div><span id="structfield.loop_analysis" class="structfield small-section-header"><a href="#structfield.loop_analysis" class="anchor field"></a><code id="loop_analysis.v">loop_analysis: <a class="struct" href="../cranelift_codegen/loop_analysis/struct.LoopAnalysis.html" title="struct cranelift_codegen::loop_analysis::LoopAnalysis">LoopAnalysis</a></code></span><div class='docblock'><p>Loop analysis of <code>func</code>.</p>
|
||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../cranelift_codegen/struct.Context.html" title="struct cranelift_codegen::Context">Context</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/cranelift_codegen/context.rs.html#54-349' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>() -> Self</code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#59-61' title='goto source code'>[src]</a></h4><div class='docblock'><p>Allocate a new compilation context.</p>
|
||
<p>The returned instance should be reused for compiling multiple functions in order to avoid
|
||
needless allocator thrashing.</p>
|
||
</div><h4 id='method.for_function' class="method"><code id='for_function.v'>pub fn <a href='#method.for_function' class='fnname'>for_function</a>(func: <a class="struct" href="../cranelift_codegen/ir/function/struct.Function.html" title="struct cranelift_codegen::ir::function::Function">Function</a>) -> Self</code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#67-75' title='goto source code'>[src]</a></h4><div class='docblock'><p>Allocate a new compilation context with an existing Function.</p>
|
||
<p>The returned instance should be reused for compiling multiple functions in order to avoid
|
||
needless allocator thrashing.</p>
|
||
</div><h4 id='method.clear' class="method"><code id='clear.v'>pub fn <a href='#method.clear' class='fnname'>clear</a>(&mut self)</code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#78-84' title='goto source code'>[src]</a></h4><div class='docblock'><p>Clear all data structures in this context.</p>
|
||
</div><h4 id='method.compile_and_emit' class="method"><code id='compile_and_emit.v'>pub fn <a href='#method.compile_and_emit' class='fnname'>compile_and_emit</a>(<br> &mut self, <br> isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>, <br> mem: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>, <br> relocs: &mut dyn <a class="trait" href="../cranelift_codegen/binemit/trait.RelocSink.html" title="trait cranelift_codegen::binemit::RelocSink">RelocSink</a>, <br> traps: &mut dyn <a class="trait" href="../cranelift_codegen/binemit/trait.TrapSink.html" title="trait cranelift_codegen::binemit::TrapSink">TrapSink</a><br>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="struct" href="../cranelift_codegen/binemit/struct.CodeInfo.html" title="struct cranelift_codegen::binemit::CodeInfo">CodeInfo</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#97-111' title='goto source code'>[src]</a></h4><div class='docblock'><p>Compile the function, and emit machine code into a <code>Vec<u8></code>.</p>
|
||
<p>Run the function through all the passes necessary to generate code for the target ISA
|
||
represented by <code>isa</code>, as well as the final step of emitting machine code into a
|
||
<code>Vec<u8></code>. The machine code is not relocated. Instead, any relocations are emitted
|
||
into <code>relocs</code>.</p>
|
||
<p>This function calls <code>compile</code> and <code>emit_to_memory</code>, taking care to resize <code>mem</code> as
|
||
needed, so it provides a safe interface.</p>
|
||
<p>Returns information about the function's code and read-only data.</p>
|
||
</div><h4 id='method.compile' class="method"><code id='compile.v'>pub fn <a href='#method.compile' class='fnname'>compile</a>(&mut self, isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="struct" href="../cranelift_codegen/binemit/struct.CodeInfo.html" title="struct cranelift_codegen::binemit::CodeInfo">CodeInfo</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#120-152' title='goto source code'>[src]</a></h4><div class='docblock'><p>Compile the function.</p>
|
||
<p>Run the function through all the passes necessary to generate code for the target ISA
|
||
represented by <code>isa</code>. This does not include the final step of emitting machine code into a
|
||
code sink.</p>
|
||
<p>Returns information about the function's code and read-only data.</p>
|
||
</div><h4 id='method.emit_to_memory' class="method"><code id='emit_to_memory.v'>pub unsafe fn <a href='#method.emit_to_memory' class='fnname'>emit_to_memory</a>(<br> &self, <br> isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>, <br> mem: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, <br> relocs: &mut dyn <a class="trait" href="../cranelift_codegen/binemit/trait.RelocSink.html" title="trait cranelift_codegen::binemit::RelocSink">RelocSink</a>, <br> traps: &mut dyn <a class="trait" href="../cranelift_codegen/binemit/trait.TrapSink.html" title="trait cranelift_codegen::binemit::TrapSink">TrapSink</a><br>) -> <a class="struct" href="../cranelift_codegen/binemit/struct.CodeInfo.html" title="struct cranelift_codegen::binemit::CodeInfo">CodeInfo</a></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#165-176' title='goto source code'>[src]</a></h4><div class='docblock'><p>Emit machine code directly into raw memory.</p>
|
||
<p>Write all of the function's machine code to the memory at <code>mem</code>. The size of the machine
|
||
code is returned by <code>compile</code> above.</p>
|
||
<p>The machine code is not relocated. Instead, any relocations are emitted into <code>relocs</code>.</p>
|
||
<p>This function is unsafe since it does not perform bounds checking on the memory buffer,
|
||
and it can't guarantee that the <code>mem</code> pointer is valid.</p>
|
||
<p>Returns information about the emitted code and data.</p>
|
||
</div><h4 id='method.verify' class="method"><code id='verify.v'>pub fn <a href='#method.verify' class='fnname'>verify</a><'a, FOI: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="../cranelift_codegen/settings/struct.FlagsOrIsa.html" title="struct cranelift_codegen::settings::FlagsOrIsa">FlagsOrIsa</a><'a>>>(<br> &self, <br> fisa: FOI<br>) -> <a class="type" href="../cranelift_codegen/verifier/type.VerifierResult.html" title="type cranelift_codegen::verifier::VerifierResult">VerifierResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#181-190' title='goto source code'>[src]</a></h4><div class='docblock'><p>Run the verifier on the function.</p>
|
||
<p>Also check that the dominator tree and control flow graph are consistent with the function.</p>
|
||
</div><h4 id='method.verify_if' class="method"><code id='verify_if.v'>pub fn <a href='#method.verify_if' class='fnname'>verify_if</a><'a, FOI: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="../cranelift_codegen/settings/struct.FlagsOrIsa.html" title="struct cranelift_codegen::settings::FlagsOrIsa">FlagsOrIsa</a><'a>>>(<br> &self, <br> fisa: FOI<br>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#193-199' title='goto source code'>[src]</a></h4><div class='docblock'><p>Run the verifier only if the <code>enable_verifier</code> setting is true.</p>
|
||
</div><h4 id='method.verify_locations' class="method"><code id='verify_locations.v'>pub fn <a href='#method.verify_locations' class='fnname'>verify_locations</a>(&self, isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>) -> <a class="type" href="../cranelift_codegen/verifier/type.VerifierResult.html" title="type cranelift_codegen::verifier::VerifierResult">VerifierResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#202-211' title='goto source code'>[src]</a></h4><div class='docblock'><p>Run the locations verifier on the function.</p>
|
||
</div><h4 id='method.verify_locations_if' class="method"><code id='verify_locations_if.v'>pub fn <a href='#method.verify_locations_if' class='fnname'>verify_locations_if</a>(&self, isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#214-219' title='goto source code'>[src]</a></h4><div class='docblock'><p>Run the locations verifier only if the <code>enable_verifier</code> setting is true.</p>
|
||
</div><h4 id='method.dce' class="method"><code id='dce.v'>pub fn <a href='#method.dce' class='fnname'>dce</a><'a, FOI: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="../cranelift_codegen/settings/struct.FlagsOrIsa.html" title="struct cranelift_codegen::settings::FlagsOrIsa">FlagsOrIsa</a><'a>>>(<br> &mut self, <br> fisa: FOI<br>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#222-226' title='goto source code'>[src]</a></h4><div class='docblock'><p>Perform dead-code elimination on the function.</p>
|
||
</div><h4 id='method.preopt' class="method"><code id='preopt.v'>pub fn <a href='#method.preopt' class='fnname'>preopt</a>(&mut self, isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#229-233' title='goto source code'>[src]</a></h4><div class='docblock'><p>Perform pre-legalization rewrites on the function.</p>
|
||
</div><h4 id='method.canonicalize_nans' class="method"><code id='canonicalize_nans.v'>pub fn <a href='#method.canonicalize_nans' class='fnname'>canonicalize_nans</a>(&mut self, isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#236-239' title='goto source code'>[src]</a></h4><div class='docblock'><p>Perform NaN canonicalizing rewrites on the function.</p>
|
||
</div><h4 id='method.legalize' class="method"><code id='legalize.v'>pub fn <a href='#method.legalize' class='fnname'>legalize</a>(&mut self, isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#242-249' title='goto source code'>[src]</a></h4><div class='docblock'><p>Run the legalizer for <code>isa</code> on the function.</p>
|
||
</div><h4 id='method.postopt' class="method"><code id='postopt.v'>pub fn <a href='#method.postopt' class='fnname'>postopt</a>(&mut self, isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#252-256' title='goto source code'>[src]</a></h4><div class='docblock'><p>Perform post-legalization rewrites on the function.</p>
|
||
</div><h4 id='method.compute_cfg' class="method"><code id='compute_cfg.v'>pub fn <a href='#method.compute_cfg' class='fnname'>compute_cfg</a>(&mut self)</code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#259-261' title='goto source code'>[src]</a></h4><div class='docblock'><p>Compute the control flow graph.</p>
|
||
</div><h4 id='method.compute_domtree' class="method"><code id='compute_domtree.v'>pub fn <a href='#method.compute_domtree' class='fnname'>compute_domtree</a>(&mut self)</code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#264-266' title='goto source code'>[src]</a></h4><div class='docblock'><p>Compute dominator tree.</p>
|
||
</div><h4 id='method.compute_loop_analysis' class="method"><code id='compute_loop_analysis.v'>pub fn <a href='#method.compute_loop_analysis' class='fnname'>compute_loop_analysis</a>(&mut self)</code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#269-272' title='goto source code'>[src]</a></h4><div class='docblock'><p>Compute the loop analysis.</p>
|
||
</div><h4 id='method.flowgraph' class="method"><code id='flowgraph.v'>pub fn <a href='#method.flowgraph' class='fnname'>flowgraph</a>(&mut self)</code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#275-278' title='goto source code'>[src]</a></h4><div class='docblock'><p>Compute the control flow graph and dominator tree.</p>
|
||
</div><h4 id='method.simple_gvn' class="method"><code id='simple_gvn.v'>pub fn <a href='#method.simple_gvn' class='fnname'>simple_gvn</a><'a, FOI: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="../cranelift_codegen/settings/struct.FlagsOrIsa.html" title="struct cranelift_codegen::settings::FlagsOrIsa">FlagsOrIsa</a><'a>>>(<br> &mut self, <br> fisa: FOI<br>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#281-284' title='goto source code'>[src]</a></h4><div class='docblock'><p>Perform simple GVN on the function.</p>
|
||
</div><h4 id='method.licm' class="method"><code id='licm.v'>pub fn <a href='#method.licm' class='fnname'>licm</a>(&mut self, isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#287-296' title='goto source code'>[src]</a></h4><div class='docblock'><p>Perform LICM on the function.</p>
|
||
</div><h4 id='method.eliminate_unreachable_code' class="method"><code id='eliminate_unreachable_code.v'>pub fn <a href='#method.eliminate_unreachable_code' class='fnname'>eliminate_unreachable_code</a><'a, FOI>(<br> &mut self, <br> fisa: FOI<br>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> <span class="where fmt-newline">where<br> FOI: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="../cranelift_codegen/settings/struct.FlagsOrIsa.html" title="struct cranelift_codegen::settings::FlagsOrIsa">FlagsOrIsa</a><'a>>, </span></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#299-305' title='goto source code'>[src]</a></h4><div class='docblock'><p>Perform unreachable code elimination.</p>
|
||
</div><h4 id='method.regalloc' class="method"><code id='regalloc.v-1'>pub fn <a href='#method.regalloc' class='fnname'>regalloc</a>(&mut self, isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#308-311' title='goto source code'>[src]</a></h4><div class='docblock'><p>Run the register allocator.</p>
|
||
</div><h4 id='method.prologue_epilogue' class="method"><code id='prologue_epilogue.v'>pub fn <a href='#method.prologue_epilogue' class='fnname'>prologue_epilogue</a>(&mut self, isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#314-319' title='goto source code'>[src]</a></h4><div class='docblock'><p>Insert prologue and epilogues after computing the stack frame layout.</p>
|
||
</div><h4 id='method.shrink_instructions' class="method"><code id='shrink_instructions.v'>pub fn <a href='#method.shrink_instructions' class='fnname'>shrink_instructions</a>(&mut self, isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#322-327' title='goto source code'>[src]</a></h4><div class='docblock'><p>Run the instruction shrinking pass.</p>
|
||
</div><h4 id='method.relax_branches' class="method"><code id='relax_branches.v'>pub fn <a href='#method.relax_branches' class='fnname'>relax_branches</a>(&mut self, isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="struct" href="../cranelift_codegen/binemit/struct.CodeInfo.html" title="struct cranelift_codegen::binemit::CodeInfo">CodeInfo</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#331-336' title='goto source code'>[src]</a></h4><div class='docblock'><p>Run the branch relaxation pass and return information about the function's code and
|
||
read-only data.</p>
|
||
</div><h4 id='method.build_value_labels_ranges' class="method"><code id='build_value_labels_ranges.v'>pub fn <a href='#method.build_value_labels_ranges' class='fnname'>build_value_labels_ranges</a>(<br> &self, <br> isa: &dyn <a class="trait" href="../cranelift_codegen/isa/trait.TargetIsa.html" title="trait cranelift_codegen::isa::TargetIsa">TargetIsa</a><br>) -> <a class="type" href="../cranelift_codegen/type.CodegenResult.html" title="type cranelift_codegen::CodegenResult">CodegenResult</a><<a class="type" href="../cranelift_codegen/type.ValueLabelsRanges.html" title="type cranelift_codegen::ValueLabelsRanges">ValueLabelsRanges</a>></code><a class='srclink' href='../src/cranelift_codegen/context.rs.html#339-348' title='goto source code'>[src]</a></h4><div class='docblock'><p>Builds ranges and location for specified value labels.</p>
|
||
</div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../cranelift_codegen/struct.Context.html" title="struct cranelift_codegen::Context">Context</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../cranelift_codegen/struct.Context.html" title="struct cranelift_codegen::Context">Context</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../cranelift_codegen/struct.Context.html" title="struct cranelift_codegen::Context">Context</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../cranelift_codegen/struct.Context.html" title="struct cranelift_codegen::Context">Context</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../cranelift_codegen/struct.Context.html" title="struct cranelift_codegen::Context">Context</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "cranelift_codegen";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html> |