Skip to content
New issue

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

Main return 0 #189

Merged
merged 6 commits into from
May 17, 2024
Merged

Main return 0 #189

merged 6 commits into from
May 17, 2024

Conversation

tsingbx
Copy link
Contributor

@tsingbx tsingbx commented May 16, 2024

No description provided.

@tsingbx tsingbx closed this May 16, 2024
@tsingbx tsingbx reopened this May 16, 2024
cl/compile.go Outdated
@@ -246,10 +250,13 @@ func (p *context) compileFuncDecl(pkg llssa.Package, f *ssa.Function) (llssa.Fun
argc := types.NewParam(token.NoPos, pkgTypes, "", types.Typ[types.Int32])
argv := types.NewParam(token.NoPos, pkgTypes, "", argvTy)
params := types.NewTuple(argc, argv)
sig = types.NewSignatureType(nil, nil, nil, params, nil, false)
ret := types.NewParam(token.NoPos, pkgTypes, "", types.Typ[types.Int])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main func return c int, not go int.

cl/compile.go Outdated
@@ -779,6 +786,10 @@ func (p *context) compileInstr(b llssa.Builder, instr ssa.Instruction) {
results[i] = p.compileValue(b, r)
}
}
if p.inMain(instr) {
results = make([]llssa.Expr, 1)
results[0] = p.prog.IntVal(0, p.prog.Int())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use prog.CInt() instead of prog.Int()

cl/compile.go Outdated
@@ -237,7 +241,7 @@ func (p *context) compileFuncDecl(pkg llssa.Package, f *ssa.Function) (llssa.Fun
ctx := makeClosureCtx(pkgTypes, f.FreeVars)
sig = llssa.FuncAddCtx(ctx, sig)
} else {
if debugInstr {
if debugInstr && sig != nil && sig.Recv() != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change this?

Copy link

qiniu-x bot commented May 17, 2024

[Git-flow] Hi @tsingbx, There are some suggestions for your information:


Rebase suggestions

  • Following commits seems generated via git merge

    Merge branch 'main' of https://github.com/goplus/llgo into main_return_0

    Merge branch 'main' into main_return_0

Which seems insignificant, recommend to use git rebase command to reorganize your PR.

For other git-flow instructions, recommend refer to these examples.

If you have any questions about this comment, feel free to raise an issue here:

@xushiwei xushiwei merged commit c92e9aa into goplus:main May 17, 2024
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants