cda-group / arc

Programming Language for Continuous Deep Analytics
https://cda-group.github.io/arc/
44 stars 6 forks source link

Add codegen for MLIR enums #226

Closed segeljakt closed 3 years ago

segeljakt commented 3 years ago

Credit for most of these changes goes to Frej!

All types in MLIR are structural. Therefore this commit adds a conversion from nominal enums into structural enums.

The Arc-Script code:

    enum Foo {
        Bar(i32),
        Baz(f32),
    }

Becomes the MLIR type:

    !arc.enum<crate_Foo_Bar : i32 , crate_Foo_Baz : f32>
frej commented 3 years ago

Looks good, merge away!