change main return to C int

This commit is contained in:
tsingbx
2024-05-17 09:31:48 +08:00
parent 057af792df
commit 5bfeea67d7
3 changed files with 20 additions and 20 deletions

View File

@@ -241,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 && sig != nil && sig.Recv() != nil {
if debugInstr {
log.Println("==> NewFunc", name, "type:", sig.Recv(), sig, "ftype:", ftype)
}
}
@@ -250,7 +250,7 @@ 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)
ret := types.NewParam(token.NoPos, pkgTypes, "", types.Typ[types.Int])
ret := types.NewParam(token.NoPos, pkgTypes, "", p.prog.CInt().RawType())
results := types.NewTuple(ret)
sig = types.NewSignatureType(nil, nil, nil, params, results, false)
}