Feldspar / feldspar-compiler

This is the compiler for the Feldspar Language.
Other
22 stars 5 forks source link

Replace outParams with a return type in procedure entities. #263

Closed kffaxen closed 4 years ago

kffaxen commented 4 years ago

TheRight case of the outParams field in the Proc constructor is redundant since no part of the back end cares about what variable is there, only its type. Similarly, the Left case is always appended to the inParams. The Left vs Right distinction also determines th ereturn type of the generated C function; Left implies void wheras Right implies the type of the variable. Further, the variables included in a Left alternative are treated as having the same calling convention as those in the inParams list, just as in C. Hence we simplify the Proc constructor by moving its sematics closer to C semantics with just a single parameter list and a separate explicit return type.