|
1 |
| -//! Codegen the completed AST to the LLVM IR. |
2 |
| -//! |
3 |
| -//! Some functions here, such as codegen_block and codegen_expr, return a value -- |
4 |
| -//! the result of the codegen to LLVM -- while others, such as codegen_fn |
5 |
| -//! and mono_item, are called only for the side effect of adding a |
6 |
| -//! particular definition to the LLVM IR output we're producing. |
| 1 | +//! Codegen the MIR to the LLVM IR. |
7 | 2 | //!
|
8 | 3 | //! Hopefully useful general knowledge about codegen:
|
9 | 4 | //!
|
10 |
| -//! * There's no way to find out the `Ty` type of a Value. Doing so |
| 5 | +//! * There's no way to find out the [`Ty`] type of a [`Value`]. Doing so |
11 | 6 | //! would be "trying to get the eggs out of an omelette" (credit:
|
12 |
| -//! pcwalton). You can, instead, find out its `llvm::Type` by calling `val_ty`, |
13 |
| -//! but one `llvm::Type` corresponds to many `Ty`s; for instance, `tup(int, int, |
14 |
| -//! int)` and `rec(x=int, y=int, z=int)` will have the same `llvm::Type`. |
| 7 | +//! pcwalton). You can, instead, find out its [`llvm::Type`] by calling [`val_ty`], |
| 8 | +//! but one [`llvm::Type`] corresponds to many [`Ty`]s; for instance, `tup(int, int, |
| 9 | +//! int)` and `rec(x=int, y=int, z=int)` will have the same [`llvm::Type`]. |
| 10 | +//! |
| 11 | +//! [`Ty`]: rustc_middle::ty::Ty |
| 12 | +//! [`val_ty`]: common::val_ty |
15 | 13 |
|
16 | 14 | use super::ModuleLlvm;
|
17 | 15 |
|
|
0 commit comments