diff --git a/compile.schala b/compile.schala index 04c7dc2..bd317ab 100644 --- a/compile.schala +++ b/compile.schala @@ -7,5 +7,7 @@ fn paha(x, y, z) { x * y * z } +q = 4 + +q + 1 -2 + 8 diff --git a/src/compilation.rs b/src/compilation.rs index 8a4144a..37cedaf 100644 --- a/src/compilation.rs +++ b/src/compilation.rs @@ -143,6 +143,8 @@ impl CodeGen for Function { ret = expr.codegen(data); } + LLVMWrap::BuildRet(data.builder, ret); + // get basic block of main let main_bb = LLVMWrap::GetBasicBlocks(data.main_function).get(0).expect("Couldn't get first block of main").clone(); LLVMWrap::PositionBuilderAtEnd(data.builder, main_bb);