This commit is contained in:
edg-l 2024-02-14 10:23:04 +00:00
parent 93fb6ccfbb
commit 9d5dc6d203
32 changed files with 192 additions and 81 deletions

View file

@ -1,5 +1,5 @@
<!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 `compile` fn in crate `edlang_codegen_llvm`."><title>compile in edlang_codegen_llvm::codegen - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="edlang_codegen_llvm" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../edlang_codegen_llvm/index.html">edlang_codegen_llvm</a><span class="version">0.0.1-alpha.5</span></h2></div><div class="sidebar-elems"><h2><a href="index.html">In edlang_codegen_llvm::codegen</a></h2></div></nav><div class="sidebar-resizer"></div>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../edlang_codegen_llvm/all.html" title="show sidebar"></a></div><input class="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"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../index.html">edlang_codegen_llvm</a>::<wbr><a href="index.html">codegen</a>::<wbr><a class="fn" href="#">compile</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/edlang_codegen_llvm/codegen.rs.html#59-167">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub fn compile(
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../edlang_codegen_llvm/all.html" title="show sidebar"></a></div><input class="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"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../index.html">edlang_codegen_llvm</a>::<wbr><a href="index.html">codegen</a>::<wbr><a class="fn" href="#">compile</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/edlang_codegen_llvm/codegen.rs.html#60-169">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub fn compile(
session: &amp;<a class="struct" href="../../edlang_session/struct.Session.html" title="struct edlang_session::Session">Session</a>,
program: &amp;<a class="struct" href="../../edlang_ir/struct.ProgramBody.html" title="struct edlang_ir::ProgramBody">ProgramBody</a>
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.76.0/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>, <a class="struct" href="https://doc.rust-lang.org/1.76.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/error/trait.Error.html" title="trait core::error::Error">Error</a>&gt;&gt;</code></pre></section></div></main></body></html>

View file

@ -1,2 +1,2 @@
<!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 `codegen` mod in crate `edlang_codegen_llvm`."><title>edlang_codegen_llvm::codegen - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="edlang_codegen_llvm" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../edlang_codegen_llvm/index.html">edlang_codegen_llvm</a><span class="version">0.0.1-alpha.5</span></h2></div><h2 class="location"><a href="#">Module codegen</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#functions">Functions</a></li></ul></section><h2><a href="../index.html">In crate edlang_codegen_llvm</a></h2></div></nav><div class="sidebar-resizer"></div>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../edlang_codegen_llvm/all.html" title="show sidebar"></a></div><input class="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"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../index.html">edlang_codegen_llvm</a>::<wbr><a class="mod" href="#">codegen</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/edlang_codegen_llvm/codegen.rs.html#1-1126">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.compile.html" title="fn edlang_codegen_llvm::codegen::compile">compile</a></div></li></ul></section></div></main></body></html>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../edlang_codegen_llvm/all.html" title="show sidebar"></a></div><input class="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"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../index.html">edlang_codegen_llvm</a>::<wbr><a class="mod" href="#">codegen</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/edlang_codegen_llvm/codegen.rs.html#1-1152">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.compile.html" title="fn edlang_codegen_llvm::codegen::compile">compile</a></div></li></ul></section></div></main></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
<!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 `lower_type` fn in crate `edlang_lowering`."><title>lower_type in edlang_lowering - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="edlang_lowering" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../edlang_lowering/index.html">edlang_lowering</a><span class="version">0.0.1-alpha.5</span></h2></div><div class="sidebar-elems"></div></nav><div class="sidebar-resizer"></div>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../edlang_lowering/all.html" title="show sidebar"></a></div><input class="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"><div id="help-button" tabindex="-1"><a href="../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="index.html">edlang_lowering</a>::<wbr><a class="fn" href="#">lower_type</a><button id="copy-path" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../src/edlang_lowering/lib.rs.html#792-840">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub fn lower_type(_ctx: &amp;BuildCtx, t: &amp;<a class="struct" href="../edlang_ast/struct.Type.html" title="struct edlang_ast::Type">Type</a>) -&gt; <a class="struct" href="../edlang_ir/struct.TypeInfo.html" title="struct edlang_ir::TypeInfo">TypeInfo</a></code></pre></section></div></main></body></html>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../edlang_lowering/all.html" title="show sidebar"></a></div><input class="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"><div id="help-button" tabindex="-1"><a href="../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="index.html">edlang_lowering</a>::<wbr><a class="fn" href="#">lower_type</a><button id="copy-path" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../src/edlang_lowering/lib.rs.html#803-863">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub fn lower_type(ctx: &amp;BuildCtx, t: &amp;<a class="struct" href="../edlang_ast/struct.Type.html" title="struct edlang_ast::Type">Type</a>) -&gt; <a class="struct" href="../edlang_ir/struct.TypeInfo.html" title="struct edlang_ir::TypeInfo">TypeInfo</a></code></pre></section></div></main></body></html>

View file

@ -1,3 +1,3 @@
<!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 `edlang_lowering` crate."><title>edlang_lowering - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="edlang_lowering" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../edlang_lowering/index.html">edlang_lowering</a><span class="version">0.0.1-alpha.5</span></h2></div><div class="sidebar-elems"><ul class="block">
<li><a id="all-types" href="all.html">All Items</a></li></ul><section><ul class="block"><li><a href="#functions">Functions</a></li></ul></section></div></nav><div class="sidebar-resizer"></div>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../edlang_lowering/all.html" title="show sidebar"></a></div><input class="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"><div id="help-button" tabindex="-1"><a href="../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Crate <a class="mod" href="#">edlang_lowering</a><button id="copy-path" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../src/edlang_lowering/lib.rs.html#1-840">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.lower_modules.html" title="fn edlang_lowering::lower_modules">lower_modules</a></div></li><li><div class="item-name"><a class="fn" href="fn.lower_type.html" title="fn edlang_lowering::lower_type">lower_type</a></div></li></ul></section></div></main></body></html>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../edlang_lowering/all.html" title="show sidebar"></a></div><input class="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"><div id="help-button" tabindex="-1"><a href="../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Crate <a class="mod" href="#">edlang_lowering</a><button id="copy-path" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../src/edlang_lowering/lib.rs.html#1-863">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.lower_modules.html" title="fn edlang_lowering::lower_modules">lower_modules</a></div></li><li><div class="item-name"><a class="fn" href="fn.lower_type.html" title="fn edlang_lowering::lower_type">lower_type</a></div></li></ul></section></div></main></body></html>

File diff suppressed because one or more lines are too long

View file

@ -1125,6 +1125,32 @@
<a href="#1124" id="1124">1124</a>
<a href="#1125" id="1125">1125</a>
<a href="#1126" id="1126">1126</a>
<a href="#1127" id="1127">1127</a>
<a href="#1128" id="1128">1128</a>
<a href="#1129" id="1129">1129</a>
<a href="#1130" id="1130">1130</a>
<a href="#1131" id="1131">1131</a>
<a href="#1132" id="1132">1132</a>
<a href="#1133" id="1133">1133</a>
<a href="#1134" id="1134">1134</a>
<a href="#1135" id="1135">1135</a>
<a href="#1136" id="1136">1136</a>
<a href="#1137" id="1137">1137</a>
<a href="#1138" id="1138">1138</a>
<a href="#1139" id="1139">1139</a>
<a href="#1140" id="1140">1140</a>
<a href="#1141" id="1141">1141</a>
<a href="#1142" id="1142">1142</a>
<a href="#1143" id="1143">1143</a>
<a href="#1144" id="1144">1144</a>
<a href="#1145" id="1145">1145</a>
<a href="#1146" id="1146">1146</a>
<a href="#1147" id="1147">1147</a>
<a href="#1148" id="1148">1148</a>
<a href="#1149" id="1149">1149</a>
<a href="#1150" id="1150">1150</a>
<a href="#1151" id="1151">1151</a>
<a href="#1152" id="1152">1152</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>std::{collections::HashMap, error::Error, path::PathBuf};
<span class="kw">use </span>edlang_ir <span class="kw">as </span>ir;
@ -1141,6 +1167,7 @@
targets::{InitializationConfig, Target, TargetData, TargetMachine},
types::{AnyType, BasicMetadataTypeEnum, BasicType},
values::{BasicValue, BasicValueEnum, PointerValue},
AddressSpace,
};
<span class="kw">use </span>ir::{LocalKind, ModuleBody, ProgramBody, TypeInfo, ValueTree};
<span class="kw">use </span>llvm_sys::debuginfo::LLVMDIFlagPublic;
@ -1229,6 +1256,7 @@
<span class="kw">let </span>llvm_module = context.create_module(<span class="kw-2">&amp;</span>module.name);
llvm_module.set_source_file_name(<span class="kw-2">&amp;</span>filename);
llvm_module.set_triple(<span class="kw-2">&amp;</span>triple);
llvm_module.set_data_layout(<span class="kw-2">&amp;</span>machine.get_target_data().get_data_layout());
<span class="kw">let </span>(di_builder, di_unit) = llvm_module.create_debug_info_builder(
<span class="bool-val">true</span>,
inkwell::debug_info::DWARFSourceLanguage::Rust,
@ -1495,7 +1523,7 @@
debug_loc = ctx.set_debug_loc(debug_loc.get_scope(), span);
}
<span class="macro">trace!</span>(<span class="string">"compiling stmt {}: {:?}"</span>, idx, stmt.kind);
<span class="macro">trace!</span>(<span class="string">"compiling stmt {}: {:?}"</span>, idx, stmt);
<span class="kw">match </span><span class="kw-2">&amp;</span>stmt.kind {
ir::StatementKind::Assign(place, rvalue) =&gt; {
<span class="kw">let </span>local = <span class="kw-2">&amp;</span>body.locals[place.local];
@ -1555,6 +1583,9 @@
}
<span class="macro">trace!</span>(<span class="string">"compiling terminator: {:?}"</span>, block.terminator);
<span class="kw">if let </span><span class="prelude-val">Some</span>(span) = block.terminator_span {
debug_loc = ctx.set_debug_loc(debug_loc.get_scope(), span);
}
<span class="kw">match </span><span class="kw-2">&amp;</span>block.terminator {
ir::Terminator::Target(id) =&gt; {
ctx.builder.build_unconditional_branch(blocks[<span class="kw-2">*</span>id])<span class="question-mark">?</span>;
@ -2081,6 +2112,10 @@
.const_float((<span class="kw-2">*</span>x) <span class="kw">as </span>f64)
.as_basic_value_enum(),
ir::ConstValue::F64(x) =&gt; ty.into_float_type().const_float(<span class="kw-2">*</span>x).as_basic_value_enum(),
ir::ConstValue::Char(x) =&gt; ty
.into_int_type()
.const_int((<span class="kw-2">*</span>x) <span class="kw">as </span>u64, <span class="bool-val">false</span>)
.as_basic_value_enum(),
},
ValueTree::Branch(<span class="kw">_</span>) =&gt; <span class="macro">todo!</span>(),
})
@ -2149,6 +2184,12 @@
ir::TypeKind::FnDef(_def_id, _generic_args) =&gt; {
<span class="macro">panic!</span>()
}
ir::TypeKind::Ptr(_pointee) =&gt; ctx
.ctx
.context
.ptr_sized_int_type(<span class="kw-2">&amp;</span>ctx.target_data, <span class="prelude-val">None</span>)
.ptr_type(AddressSpace::default())
.as_basic_type_enum(),
}
}
@ -2158,79 +2199,80 @@
// 4 = float
// 5 = signed
// 11 = numeric string
// https://dwarfstd.org/doc/DWARF5.pdf#section.7.8
</span><span class="kw">match </span><span class="kw-2">&amp;</span>ty.kind {
ir::TypeKind::Unit =&gt; <span class="macro">todo!</span>(),
ir::TypeKind::Bool =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"bool"</span>, <span class="number">1</span>, <span class="number">2</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"bool"</span>, <span class="number">1</span>, <span class="number">0x2</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
ir::TypeKind::Char =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"char"</span>, <span class="number">1</span>, <span class="number">6</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"char"</span>, <span class="number">8</span>, <span class="number">0x6</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
ir::TypeKind::Int(ty) =&gt; <span class="kw">match </span>ty {
ir::IntTy::I128 =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"i128"</span>, <span class="number">128</span>, <span class="number">5</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"i128"</span>, <span class="number">128</span>, <span class="number">0x5</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
ir::IntTy::I64 =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"i64"</span>, <span class="number">64</span>, <span class="number">5</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"i64"</span>, <span class="number">64</span>, <span class="number">0x5</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
ir::IntTy::I32 =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"i32"</span>, <span class="number">32</span>, <span class="number">5</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"i32"</span>, <span class="number">32</span>, <span class="number">0x5</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
ir::IntTy::I16 =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"i16"</span>, <span class="number">16</span>, <span class="number">5</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"i16"</span>, <span class="number">16</span>, <span class="number">0x5</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
ir::IntTy::I8 =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"i8"</span>, <span class="number">8</span>, <span class="number">5</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"i8"</span>, <span class="number">8</span>, <span class="number">0x5</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
ir::IntTy::Isize =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"isize"</span>, <span class="number">64</span>, <span class="number">5</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"isize"</span>, <span class="number">64</span>, <span class="number">0x5</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
},
ir::TypeKind::Uint(ty) =&gt; <span class="kw">match </span>ty {
ir::UintTy::U128 =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"u128"</span>, <span class="number">128</span>, <span class="number">7</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"u128"</span>, <span class="number">128</span>, <span class="number">0x7</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
ir::UintTy::U64 =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"u64"</span>, <span class="number">64</span>, <span class="number">7</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"u64"</span>, <span class="number">64</span>, <span class="number">0x7</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
ir::UintTy::U32 =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"u32"</span>, <span class="number">32</span>, <span class="number">7</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"u32"</span>, <span class="number">32</span>, <span class="number">0x7</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
ir::UintTy::U16 =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"u16"</span>, <span class="number">16</span>, <span class="number">7</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"u16"</span>, <span class="number">16</span>, <span class="number">0x7</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
ir::UintTy::U8 =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"u8"</span>, <span class="number">8</span>, <span class="number">7</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"u8"</span>, <span class="number">8</span>, <span class="number">0x7</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
ir::UintTy::Usize =&gt; ctx
.di_builder
.create_basic_type(<span class="string">"usize"</span>, <span class="number">64</span>, <span class="number">7</span>, LLVMDIFlagPublic)
.create_basic_type(<span class="string">"usize"</span>, <span class="number">64</span>, <span class="number">0x7</span>, LLVMDIFlagPublic)
.unwrap()
.as_type(),
},
@ -2249,6 +2291,16 @@
ir::TypeKind::FnDef(_def_id, _generic_args) =&gt; {
<span class="macro">panic!</span>()
}
ir::TypeKind::Ptr(pointee) =&gt; ctx
.di_builder
.create_pointer_type(
<span class="kw-2">&amp;</span><span class="macro">format!</span>(<span class="string">"ptr&lt;{:?}&gt;"</span>, pointee.kind),
compile_debug_type(ctx, pointee),
(ctx.target_data.get_pointer_byte_size(<span class="prelude-val">None</span>) * <span class="number">8</span>).into(),
ctx.target_data.get_pointer_byte_size(<span class="prelude-val">None</span>),
AddressSpace::default(),
)
.as_type(),
}
}
</code></pre></div></section></main></body></html>

View file

@ -442,6 +442,11 @@
<a href="#441" id="441">441</a>
<a href="#442" id="442">442</a>
<a href="#443" id="443">443</a>
<a href="#444" id="444">444</a>
<a href="#445" id="445">445</a>
<a href="#446" id="446">446</a>
<a href="#447" id="447">447</a>
<a href="#448" id="448">448</a>
</pre></div><pre class="rust"><code><span class="comment">// Based on a cfg
</span><span class="kw">use </span>std::collections::{BTreeMap, HashSet};
@ -541,6 +546,7 @@
</span><span class="kw">pub struct </span>BasicBlock {
<span class="kw">pub </span>statements: SmallVec&lt;[Statement; <span class="number">8</span>]&gt;,
<span class="kw">pub </span>terminator: Terminator,
<span class="kw">pub </span>terminator_span: <span class="prelude-ty">Option</span>&lt;Span&gt;,
}
<span class="attr">#[derive(Debug, Clone)]
@ -646,7 +652,8 @@
Uint(UintTy),
Float(FloatTy),
FnDef(DefId, Vec&lt;TypeInfo&gt;), <span class="comment">// The vec are generic types, not arg types
</span>}
</span>Ptr(Box&lt;TypeInfo&gt;),
}
<span class="kw">impl </span>TypeKind {
<span class="kw">pub fn </span>is_unit(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool {
@ -676,6 +683,7 @@
<span class="self">Self</span>::Float(<span class="kw">_</span>) =&gt; <span class="macro">todo!</span>(),
TypeKind::Unit =&gt; <span class="macro">unreachable!</span>(),
TypeKind::FnDef(<span class="kw">_</span>, <span class="kw">_</span>) =&gt; <span class="macro">unreachable!</span>(),
TypeKind::Ptr(_pointee) =&gt; <span class="macro">todo!</span>(),
}
}
}
@ -742,6 +750,7 @@
ConstValue::U128(<span class="kw">_</span>) =&gt; TypeKind::Uint(UintTy::U8),
ConstValue::F32(<span class="kw">_</span>) =&gt; TypeKind::Float(FloatTy::F32),
ConstValue::F64(<span class="kw">_</span>) =&gt; TypeKind::Float(FloatTy::F64),
ConstValue::Char(<span class="kw">_</span>) =&gt; TypeKind::Char,
},
ValueTree::Branch(<span class="kw">_</span>) =&gt; <span class="macro">todo!</span>(),
}
@ -872,6 +881,7 @@
<span class="attr">#[derive(Debug, Clone, Copy)]
</span><span class="kw">pub enum </span>ConstValue {
Bool(bool),
Char(char),
I8(i8),
I16(i16),
I32(i32),

View file

@ -839,9 +839,32 @@
<a href="#838" id="838">838</a>
<a href="#839" id="839">839</a>
<a href="#840" id="840">840</a>
<a href="#841" id="841">841</a>
<a href="#842" id="842">842</a>
<a href="#843" id="843">843</a>
<a href="#844" id="844">844</a>
<a href="#845" id="845">845</a>
<a href="#846" id="846">846</a>
<a href="#847" id="847">847</a>
<a href="#848" id="848">848</a>
<a href="#849" id="849">849</a>
<a href="#850" id="850">850</a>
<a href="#851" id="851">851</a>
<a href="#852" id="852">852</a>
<a href="#853" id="853">853</a>
<a href="#854" id="854">854</a>
<a href="#855" id="855">855</a>
<a href="#856" id="856">856</a>
<a href="#857" id="857">857</a>
<a href="#858" id="858">858</a>
<a href="#859" id="859">859</a>
<a href="#860" id="860">860</a>
<a href="#861" id="861">861</a>
<a href="#862" id="862">862</a>
<a href="#863" id="863">863</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>std::collections::HashMap;
<span class="kw">use </span>ast::{BinaryOp, ModuleStatement, WhileStmt};
<span class="kw">use </span>ast::{BinaryOp, ModuleStatement, Span, WhileStmt};
<span class="kw">use </span>common::{BodyBuilder, BuildCtx};
<span class="kw">use </span>edlang_ast <span class="kw">as </span>ast;
<span class="kw">use </span>edlang_ir <span class="kw">as </span>ir;
@ -1025,6 +1048,7 @@
builder.body.blocks.push(BasicBlock {
statements: statements.into(),
terminator: Terminator::Target(builder.body.blocks.len() + <span class="number">1</span>),
terminator_span: <span class="prelude-val">Some</span>(info.block.span),
});
<span class="kw">let </span>(discriminator, discriminator_type) = lower_expr(builder, <span class="kw-2">&amp;</span>info.condition, <span class="prelude-val">None</span>);
@ -1036,7 +1060,7 @@
};
builder.statements.push(Statement {
span: <span class="prelude-val">None</span>,
span: <span class="prelude-val">Some</span>(info.span),
kind: StatementKind::Assign(place.clone(), discriminator),
});
@ -1047,6 +1071,7 @@
builder.body.blocks.push(BasicBlock {
statements: statements.into(),
terminator: Terminator::Unreachable,
terminator_span: <span class="prelude-val">Some</span>(info.block.span),
});
<span class="comment">// keep idx for switch targets
@ -1067,6 +1092,7 @@
builder.body.blocks.push(BasicBlock {
statements: statements.into(),
terminator: Terminator::Unreachable,
terminator_span: <span class="prelude-val">Some</span>(Span::new(info.block.span.hi, info.block.span.hi)),
});
<span class="prelude-val">Some</span>(idx)
} <span class="kw">else </span>{
@ -1102,7 +1128,7 @@
};
builder.statements.push(Statement {
span: <span class="prelude-val">None</span>,
span: <span class="prelude-val">Some</span>(info.span),
kind: StatementKind::Assign(place.clone(), condition),
});
@ -1113,6 +1139,7 @@
builder.body.blocks.push(BasicBlock {
statements: statements.into(),
terminator: Terminator::Unreachable,
terminator_span: <span class="prelude-val">Some</span>(info.span),
});
<span class="comment">// keep idx for switch targets
@ -1132,6 +1159,7 @@
builder.body.blocks.push(BasicBlock {
statements: statements.into(),
terminator: Terminator::Unreachable,
terminator_span: <span class="prelude-val">Some</span>(Span::new(info.then_block.span.hi, info.then_block.span.hi)),
});
<span class="prelude-val">Some</span>(idx)
} <span class="kw">else </span>{
@ -1155,6 +1183,10 @@
builder.body.blocks.push(BasicBlock {
statements: statements.into(),
terminator: Terminator::Unreachable,
terminator_span: info
.else_block
.as_ref()
.map(|x| Span::new(x.span.hi, x.span.hi)),
});
<span class="prelude-val">Some</span>(idx)
} <span class="kw">else </span>{
@ -1224,8 +1256,7 @@
ast::ValueExpr::Str { .. } =&gt; <span class="macro">todo!</span>(),
ast::ValueExpr::Path(path) =&gt; {
<span class="comment">// todo: handle full path
</span><span class="macro">dbg!</span>(<span class="string">"found local"</span>);
builder.get_local(<span class="kw-2">&amp;</span>path.first.name)<span class="question-mark">?</span>.ty.kind.clone()
</span>builder.get_local(<span class="kw-2">&amp;</span>path.first.name)<span class="question-mark">?</span>.ty.kind.clone()
}
},
ast::Expression::FnCall(info) =&gt; {
@ -1448,6 +1479,7 @@
builder.body.blocks.push(BasicBlock {
statements: statements.into(),
terminator: kind,
terminator_span: <span class="prelude-val">Some</span>(info.span),
});
(Operand::Move(dest_place), ret_ty.kind.clone())
@ -1596,7 +1628,7 @@
<span class="kw">if let </span><span class="prelude-val">Some</span>(value_expr) = <span class="kw-2">&amp;</span>info.value {
<span class="kw">let </span>(value, _ty) = lower_expr(builder, value_expr, <span class="prelude-val">Some</span>(return_type));
builder.statements.push(Statement {
span: <span class="prelude-val">None</span>,
span: <span class="prelude-val">Some</span>(info.span),
kind: StatementKind::Assign(
Place {
local: builder.ret_local,
@ -1611,6 +1643,7 @@
builder.body.blocks.push(BasicBlock {
statements: statements.into(),
terminator: Terminator::Return,
terminator_span: <span class="prelude-val">Some</span>(info.span),
});
}
@ -1630,7 +1663,8 @@
)
}
<span class="kw">pub fn </span>lower_type(_ctx: <span class="kw-2">&amp;</span>BuildCtx, t: <span class="kw-2">&amp;</span>ast::Type) -&gt; ir::TypeInfo {
<span class="attr">#[allow(clippy::only_used_in_recursion)]
</span><span class="kw">pub fn </span>lower_type(ctx: <span class="kw-2">&amp;</span>BuildCtx, t: <span class="kw-2">&amp;</span>ast::Type) -&gt; ir::TypeInfo {
<span class="kw">match </span>t.name.name.as_str() {
<span class="string">"()" </span>=&gt; ir::TypeInfo {
span: <span class="prelude-val">Some</span>(t.span),
@ -1676,7 +1710,19 @@
span: <span class="prelude-val">Some</span>(t.span),
kind: ir::TypeKind::Int(ir::IntTy::I128),
},
<span class="kw">_ </span>=&gt; <span class="macro">todo!</span>(),
<span class="string">"char" </span>=&gt; ir::TypeInfo {
span: <span class="prelude-val">Some</span>(t.span),
kind: ir::TypeKind::Char,
},
<span class="string">"bool" </span>=&gt; ir::TypeInfo {
span: <span class="prelude-val">Some</span>(t.span),
kind: ir::TypeKind::Bool,
},
<span class="string">"ptr" </span>=&gt; ir::TypeInfo {
span: <span class="prelude-val">Some</span>(t.span),
kind: ir::TypeKind::Ptr(Box::new(lower_type(ctx, t.generics.first().unwrap()))),
},
x =&gt; <span class="macro">todo!</span>(<span class="string">"{:?}"</span>, x),
}
}
</code></pre></div></section></main></body></html>