Merge commit 'd06146ed970f52d564521ff0be7d56839c85e497' into async-functions

* commit 'd06146ed970f52d564521ff0be7d56839c85e497': (152 commits)
  perf(lib/sync): avoid using `defer`
  refactor(c-libuv): Added TODO(uid) comment & adjusted the position of Handle, Stream, Req, Write, Connect
  README: io/ioutil
  library: io/ioutil
  c/openssl: bio, pem, rsa
  refactor(c/libuv): Adapt libuv.Fs struct
  Revert "fix(c/libuv): Add libuv fs struct new func"
  fix(c/libuv): Fix async_fs demo return 255 error & pointer not allocated error
  fix(c/libuv): Add libuv fs struct new func
  doc/c:refine symbol visibility description
  README: math/big
  library: math/big.Int (mini-impl for _cmptest/bigintdemo)
  doc/c:update implicit destructors description
  c/openssl: bignum, rsa
  library: crypto
  library: crypto/{sha1, sha256, sha512}
  doc/c:fix incorrect usage in construtors
  doc/c:update destructor usage
  delete sum
  fix test error
  ...

# Conflicts:
#	ssa/eh.go
This commit is contained in:
Li Jie
2024-08-04 10:26:27 +08:00
165 changed files with 11563 additions and 606 deletions

View File

@@ -19,6 +19,7 @@ package ssa
import (
"go/token"
"go/types"
"runtime"
"strconv"
"unsafe"
@@ -240,7 +241,10 @@ type Program = *aProgram
// NewProgram creates a new program.
func NewProgram(target *Target) Program {
if target == nil {
target = &Target{}
target = &Target{
GOOS: runtime.GOOS,
GOARCH: runtime.GOARCH,
}
}
ctx := llvm.NewContext()
td := target.targetData() // TODO(xsw): target config
@@ -653,7 +657,7 @@ const (
closureStub = "__llgo_stub."
)
func (p Package) closureStub(b Builder, t *types.Struct, v Expr) Expr {
func (p Package) closureStub(b Builder, t types.Type, v Expr) Expr {
name := v.impl.Name()
prog := b.Prog
nilVal := prog.Nil(prog.VoidPtr()).impl