[Phase 1] Lower Algebraic Data Types (Enums) to MLIR
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 14
- Forks
- 2
- Avg merge
- 12h 42m
- Merged PRs (30d)
- 61
Description
Currently, the Vx compiler supports Algebraic Data Types (Enums with data payloads) in the Lexer, Parser, AST, and Sema phases. We need to implement the lowering of these Enums to MLIR in src/codegen/generator.rs.
Tasks:
- Implement tagged union lowering for Enums.
- Each enum instance should be lowered as a tagged struct/union containing its variants' payloads.
- Update
lower_typeto correctly mapType::Enumto an appropriate MLIR tuple/struct type representing the tagged union.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/codegen/generator.rs and inspect the existing MLIR lowering paths, especially lower_type. Trace how enum variants and their payload types are represented before implementing tagged union lowering. Done means enum instances lower to tagged struct/union values and Type::Enum maps to an appropriate MLIR tuple or struct type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100