Skip to content

Commit 469c5af

Browse files
committed
add some placeholder text, short intro
1 parent f4f5d4c commit 469c5af

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

src/backend/backend.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
11
# The Compiler Backend
2+
3+
The _compiler backend_ refers to the parts of the compiler that turn rustc's
4+
MIR into actual executable code (e.g. an ELF or EXE binary) that can run on a
5+
processor. This is the last stage of compilation, and it has a few important
6+
parts:
7+
8+
0. First, we need to collect the set of things to generate code for. In
9+
particular, we need to find out which concrete types to substitute for
10+
generic ones, since we need to generate code for the concrete types.
11+
Generating code for the concrete types (i.e. emitting a copy of the code for
12+
each concrete type) is called _monomorphization_, so the process of
13+
collecting all the concrete types is called _monomorphization collection_.
14+
1. Next, we need to actually lower the MIR (which is generic) to a codegen IR
15+
(usually LLVM IR; which is not generic) for each concrete type we collected.
16+
2. Finally, we need to invoke LLVM, which runs a bunch of optimization passes,
17+
generates executable code, and links together an executable binary.

src/backend/lowering-mir.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Lowering MIR to a Codegen IR
2+
3+
TODO

src/backend/monomorph.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
11
# Monomorphization
2+
3+
TODO
4+
5+
6+
## Polymorphization
7+
8+
TODO

0 commit comments

Comments
 (0)