11# Code generation
22
3- Code generation or "codegen" is the part of the compiler that actually generates
4- an executable binary. rustc uses LLVM for code generation.
3+ Code generation or "codegen" is the part of the compiler that actually
4+ generates an executable binary. rustc uses LLVM for code generation.
55
66## What is LLVM?
77
@@ -24,8 +24,9 @@ many compiler projects, including the `clang` C compiler and our beloved
2424
2525LLVM's "format ` X ` " is called LLVM IR. It is basically assembly code with
2626additional low-level types and annotations added. These annotations are helpful
27- for doing optimizations on the LLVM IR and outputed machine code. The end result
28- of all this is (at long last) something executable (e.g. an ELF object or wasm).
27+ for doing optimizations on the LLVM IR and outputed machine code. The end
28+ result of all this is (at long last) something executable (e.g. an ELF object
29+ or wasm).
2930
3031There are a few benefits to using LLVM:
3132
@@ -38,8 +39,8 @@ There are a few benefits to using LLVM:
3839 clang, and a bunch of other languages were able to compile to wasm! (Well,
3940 there was some extra stuff to be done, but we were 90% there anyway).
4041- We and other compiler projects benefit from each other. For example, when the
41- [ Spectre and Meltdown security vulnerabilities] [ spectre ] were discovered, only LLVM
42- needed to be patched.
42+ [ Spectre and Meltdown security vulnerabilities] [ spectre ] were discovered,
43+ only LLVM needed to be patched.
4344
4445[ spectre ] : https://meltdownattack.com/
4546
0 commit comments