Add return statements to generated functions
This commit is contained in:
parent
c8feaa9b57
commit
9454fc6194
@ -7,5 +7,7 @@ fn paha(x, y, z) {
|
|||||||
x * y * z
|
x * y * z
|
||||||
}
|
}
|
||||||
|
|
||||||
|
q = 4
|
||||||
|
|
||||||
|
q + 1
|
||||||
|
|
||||||
2 + 8
|
|
||||||
|
@ -143,6 +143,8 @@ impl CodeGen for Function {
|
|||||||
ret = expr.codegen(data);
|
ret = expr.codegen(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LLVMWrap::BuildRet(data.builder, ret);
|
||||||
|
|
||||||
// get basic block of main
|
// get basic block of main
|
||||||
let main_bb = LLVMWrap::GetBasicBlocks(data.main_function).get(0).expect("Couldn't get first block of main").clone();
|
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);
|
LLVMWrap::PositionBuilderAtEnd(data.builder, main_bb);
|
||||||
|
Loading…
Reference in New Issue
Block a user