CQCL / hugr-llvm

http://crates.io/crates/hugr-llvm
Apache License 2.0
4 stars 2 forks source link

Implement emission for `FuncDecl` + scoped `FuncDefn` #4

Closed doug-q closed 2 weeks ago

doug-q commented 1 month ago

Only for FuncDe{cl,fn} with no type params.

In both cases we should create the function in the module. In the FuncDefn case we should push_todo_func.

To test this properly the test scaffolding will need to be improved. Recommend factoring out a SimpleFuncBuilder from SimpleHugrBuilder and introducing a new ComplexHugrBuilder with an add_func_defn method that returns a SimpleFuncBuilder

Note that we should test scoped definitions appearing anywhere they are allowed. As children of: Module, FuncDefn, Conditional, CFG, DataflowBlock, Case, DFG, TailLoop.