We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
print(foo(true)) print(foo(false)) String foo(Bool cond): if cond: return "a" else: return "b"
Generated code:
define i8* @M.if.F.foo$M.std.C.String$M.Bool.C.Bool(%M.Bool.C.Bool* %M.if.V.cond$M.Bool.C.Bool) { entry: %_unnamed_0 = getelementptr inbounds %M.Bool.C.Bool* %M.if.V.cond$M.Bool.C.Bool, i32 0,i32 1 %_unnamed_1 = load i1* %_unnamed_0 br i1 %_unnamed_1, label %if0.true, label %if0.false if0.true: ret i8* getelementptr inbounds ([2 x i8]* @.0, i32 0, i32 0) br label %if0.end if0.false: ret i8* getelementptr inbounds ([2 x i8]* @.1, i32 0, i32 0) br label %if0.end if0.end: }
I'm not sure wether this applies to the current master but the code generation for if-statements seems not to have changed recently.
The text was updated successfully, but these errors were encountered:
A possible solution (and as far as I can tell how other languages implement it):
ret_value
ret_label
ret
return
Sorry, something went wrong.
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: