Open skuzzle opened 8 years ago
A possible solution (and as far as I can tell how other languages implement it):
ret_value
variable on function definition generation at the top of the function definition.ret_label
block at the end of the function definition where the ret_value
is returned vial LLVM ret
.return
statement, but set the ret_value
and branch to the ret_label
.
Code generation for if-Statements seems broken. The following code produces the lli error
lli: C:\Users\Simon\Documents\Java\moco\target\test-classes\testPrograms\if.ll:110:1: error: expected instruction opcode
Generated code:
I'm not sure wether this applies to the current master but the code generation for if-statements seems not to have changed recently.