Commit 1474831
The three-address code format CFG (#1577)
This PR links to the issue#923.
Here's a summary of the tasks related to the new three-address code
format CFG:
1. Define the data structure of the new three-address code format CFG by
using the following files:
- `src/lir/cfg.rs`: defines the enum type `lir::LIR` and `lir::Block`
- `src/lir/instructions.rs`: defines the enum type
`lir::instructions::Instruction` for instructions
- `src/lir/expressions.rs`: defines the enum type
`lir::expressions::Expression`
- `src/lir/ssa_type.rs`: defines the enum type `lir::lir_type::Type`
2. Implement a text dump function for the new CFG by using the following
files:
- `src/lir/printer/mod.rs`: defines the struct `lir::printer::Printer`,
which delegates some operations on `lir::vartable::Vartable`
- Other files in the folder `src/lir/printer/`: implement the
`lir::printer::Printer` for the new CFG
3. Convert the old CFG into the new CFG of three-address codes by using
the following files:
- `src/lir/converter/mod.rs`: defines the struct type
`lir::converter::Converter`, which delegates some operations on
`sema::ast::Namespace`
- `src/lir/vartable.rs`: defines the struct type
`lir::vartable::Vartable`, which will later be used in the
`lir::converter::Converter` to mainly keep track of the temporary
identifiers' number, name, and type
- Other files in the folder `src/lir/converter/`: implements the
`lir::converter::Converter`, which converts the
`codegen::cfg::ControlFlowGraph` to the `lir::LIR`
---------
Signed-off-by: FANYI ZHAO <[email protected]>
Co-authored-by: Lucas Steuernagel <[email protected]>1 parent 358a184 commit 1474831
File tree
34 files changed
+7240
-63
lines changed- src
- abi
- bin/languageserver
- codegen
- lir
- converter
- printer
- sema
- yul
- tests
- lir_tests
34 files changed
+7240
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
497 | | - | |
| 497 | + | |
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1330 | 1330 | | |
1331 | 1331 | | |
1332 | 1332 | | |
1333 | | - | |
| 1333 | + | |
1334 | 1334 | | |
1335 | 1335 | | |
1336 | 1336 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
411 | | - | |
| 410 | + | |
| 411 | + | |
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
0 commit comments