Remove various todos
With some items added to https://github.com/rust-lang/rustc-dev-guide/issues/674 Co-Authored-By: Chris Simpkins <git.simpkins@gmail.com>
This commit is contained in:
parent
034cb09659
commit
6b521a2504
|
|
@ -15,7 +15,6 @@ So first, let's look at what the compiler does to your code. For now, we will
|
||||||
avoid mentioning how the compiler implements these steps except as needed;
|
avoid mentioning how the compiler implements these steps except as needed;
|
||||||
we'll talk about that later.
|
we'll talk about that later.
|
||||||
|
|
||||||
**TODO: Would be great to have a diagram of this once we nail down the details...**
|
|
||||||
|
|
||||||
- The compile process begins when a user writes a Rust source program in text
|
- The compile process begins when a user writes a Rust source program in text
|
||||||
and invokes the `rustc` compiler on it. The work that the compiler needs to
|
and invokes the `rustc` compiler on it. The work that the compiler needs to
|
||||||
|
|
@ -74,10 +73,9 @@ we'll talk about that later.
|
||||||
HAIR is used for pattern and exhaustiveness checking. It is also more
|
HAIR is used for pattern and exhaustiveness checking. It is also more
|
||||||
convenient to convert into MIR than HIR is.
|
convenient to convert into MIR than HIR is.
|
||||||
- The MIR is used for [borrow checking].
|
- The MIR is used for [borrow checking].
|
||||||
- **TODO: const eval fits in somewhere here I think**
|
|
||||||
- We (want to) do [many optimizations on the MIR][mir-opt] because it is still
|
- We (want to) do [many optimizations on the MIR][mir-opt] because it is still
|
||||||
generic and that improves the code we generate later, improving compilation
|
generic and that improves the code we generate later, improving compilation
|
||||||
speed too. (**TODO: size optimizations too?**)
|
speed too.
|
||||||
- MIR is a higher level (and generic) representation, so it is easier to do
|
- MIR is a higher level (and generic) representation, so it is easier to do
|
||||||
some optimizations at MIR level than at LLVM-IR level. For example LLVM
|
some optimizations at MIR level than at LLVM-IR level. For example LLVM
|
||||||
doesn't seem to be able to optimize the pattern the [`simplify_try`] mir
|
doesn't seem to be able to optimize the pattern the [`simplify_try`] mir
|
||||||
|
|
@ -96,9 +94,8 @@ we'll talk about that later.
|
||||||
- The LLVM IR is passed to LLVM, which does a lot more optimizations on it.
|
- The LLVM IR is passed to LLVM, which does a lot more optimizations on it.
|
||||||
It then emits machine code. It is basically assembly code with additional
|
It then emits machine code. It is basically assembly code with additional
|
||||||
low-level types and annotations added. (e.g. an ELF object or wasm).
|
low-level types and annotations added. (e.g. an ELF object or wasm).
|
||||||
**TODO: reference for this section?**
|
|
||||||
- The different libraries/binaries are linked together to produce the final
|
- The different libraries/binaries are linked together to produce the final
|
||||||
binary. **TODO: reference for this section?**
|
binary.
|
||||||
|
|
||||||
[`librustc_lexer`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lexer/index.html
|
[`librustc_lexer`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lexer/index.html
|
||||||
[`librustc_driver`]: https://rustc-dev-guide.rust-lang.org/rustc-driver.html
|
[`librustc_driver`]: https://rustc-dev-guide.rust-lang.org/rustc-driver.html
|
||||||
|
|
@ -138,13 +135,13 @@ satisfy/optimize for. For example,
|
||||||
point.
|
point.
|
||||||
- Compiler compilation speed: how long does it take to compile the compiler?
|
- Compiler compilation speed: how long does it take to compile the compiler?
|
||||||
This impacts contributors and compiler maintenance.
|
This impacts contributors and compiler maintenance.
|
||||||
- Compiler implementation complexity: building a compiler is one of the hardest
|
- Implementation complexity: building a compiler is one of the hardest
|
||||||
things a person/group can do, and Rust is not a very simple language, so how
|
things a person/group can do, and Rust is not a very simple language, so how
|
||||||
do we make the compiler's code base manageable?
|
do we make the compiler's code base manageable?
|
||||||
- Compiler correctness: the binaries produced by the compiler should do what
|
- Compiler correctness: the binaries produced by the compiler should do what
|
||||||
the input programs says they do, and should continue to do so despite the
|
the input programs says they do, and should continue to do so despite the
|
||||||
tremendous amount of change constantly going on.
|
tremendous amount of change constantly going on.
|
||||||
- Compiler integration: a number of other tools need to use the compiler in
|
- Integration: a number of other tools need to use the compiler in
|
||||||
various ways (e.g. cargo, clippy, miri, RLS) that must be supported.
|
various ways (e.g. cargo, clippy, miri, RLS) that must be supported.
|
||||||
- Compiler stability: the compiler should not crash or fail ungracefully on the
|
- Compiler stability: the compiler should not crash or fail ungracefully on the
|
||||||
stable channel.
|
stable channel.
|
||||||
|
|
@ -283,7 +280,7 @@ program) is [`rustc::ty::Ty`][ty]. This is so important that we have a whole cha
|
||||||
on [`ty::Ty`][ty], but for now, we just want to mention that it exists and is the way
|
on [`ty::Ty`][ty], but for now, we just want to mention that it exists and is the way
|
||||||
`rustc` represents types!
|
`rustc` represents types!
|
||||||
|
|
||||||
Oh, and also the `rustc::ty` module defines the `TyCtxt` struct we mentioned before.
|
Also note that the `rustc::ty` module defines the `TyCtxt` struct we mentioned before.
|
||||||
|
|
||||||
[ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.Ty.html
|
[ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.Ty.html
|
||||||
|
|
||||||
|
|
@ -332,7 +329,6 @@ bootstrapping compiler will support them.
|
||||||
|
|
||||||
# Unresolved Questions
|
# Unresolved Questions
|
||||||
|
|
||||||
**TODO: find answers to these**
|
|
||||||
|
|
||||||
- Does LLVM ever do optimizations in debug builds?
|
- Does LLVM ever do optimizations in debug builds?
|
||||||
- How do I explore phases of the compile process in my own sources (lexer,
|
- How do I explore phases of the compile process in my own sources (lexer,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue