Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <euclideanrn@163.com> Co-authored-by: Lucas Steuernagel <38472950+LucasSte@users.noreply.github.com>
- Loading branch information