Skip to content

Commit 2f69d11

Browse files
committed
rust async: make a graphviz file for compilation flow
1 parent f7dc882 commit 2f69d11

3 files changed

+83
-74
lines changed

org/20220118160327-lowering_async_await_in_rust.org

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Here are a few references:
2525
+ [[https://github.com/rust-lang/rust/pull/43076/files][Generator support]]
2626
+ [[https://rust-lang.github.io/async-book/][Asynchronous Programming in Rust]]
2727

28-
Below is roughly how rust compiler compiles the rust source code into machine code.
28+
Below (adapted from [[https://blog.rust-lang.org/2016/04/19/MIR.html][here]]) is roughly how rust compiler compiles the rust source code into machine code.
2929

3030
[[file:assets/images/rust-compilation-flow.svg]]
3131

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
digraph G {
2+
source -> hir [label=" parsing\n desugaring"];
3+
hir -> mir [label=" type checking"];
4+
mir -> llir [label=" borrow checking\n optimization"];
5+
llir -> machine_code [label=" optimization"];
6+
source [shape=box,width=1.2,fixedsize=true,label="rust source"];
7+
hir [shape=box,width=1.2,fixedsize=true,label="HIR"];
8+
mir [shape=box,width=1.2,fixedsize=true,label="MIR"];
9+
llir [shape=box,width=1.2,fixedsize=true,label="LLVM IR"];
10+
machine_code [shape=box,width=1.2,fixedsize=true,label="machine code"]
11+
}
+71-73
Loading

0 commit comments

Comments
 (0)