From e19762b57c3ab2a17631ad02e3d80c8b33af854b Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sat, 7 Mar 2020 15:10:13 -0600 Subject: [PATCH] add some placeholder text, short intro --- src/backend/backend.md | 16 ++++++++++++++++ src/backend/lowering-mir.md | 3 +++ src/backend/monomorph.md | 7 +++++++ 3 files changed, 26 insertions(+) diff --git a/src/backend/backend.md b/src/backend/backend.md index 167391a8..cc477b3e 100644 --- a/src/backend/backend.md +++ b/src/backend/backend.md @@ -1 +1,17 @@ # The Compiler Backend + +The _compiler backend_ refers to the parts of the compiler that turn rustc's +MIR into actual executable code (e.g. an ELF or EXE binary) that can run on a +processor. This is the last stage of compilation, and it has a few important +parts: + +0. First, we need to collect the set of things to generate code for. In + particular, we need to find out which concrete types to substitute for + generic ones, since we need to generate code for the concrete types. + Generating code for the concrete types (i.e. emitting a copy of the code for + each concrete type) is called _monomorphization_, so the process of + collecting all the concrete types is called _monomorphization collection_. +1. Next, we need to actually lower the MIR (which is generic) to a codegen IR + (usually LLVM IR; which is not generic) for each concrete type we collected. +2. Finally, we need to invoke LLVM, which runs a bunch of optimization passes, + generates executable code, and links together an executable binary. diff --git a/src/backend/lowering-mir.md b/src/backend/lowering-mir.md index e69de29b..e3c13795 100644 --- a/src/backend/lowering-mir.md +++ b/src/backend/lowering-mir.md @@ -0,0 +1,3 @@ +# Lowering MIR to a Codegen IR + +TODO diff --git a/src/backend/monomorph.md b/src/backend/monomorph.md index fc54886f..eaf37f2e 100644 --- a/src/backend/monomorph.md +++ b/src/backend/monomorph.md @@ -1 +1,8 @@ # Monomorphization + +TODO + + +## Polymorphization + +TODO