feat: upgrade to x/tools 0.28

This commit is contained in:
Li Jie
2024-11-29 14:23:46 +08:00
parent db3f6e077e
commit 03b469212e
29 changed files with 202 additions and 153 deletions

View File

@@ -854,7 +854,9 @@ var hasAltPkg = map[string]none{
"internal/bytealg": {},
"internal/itoa": {},
"internal/oserror": {},
"internal/race": {},
"internal/reflectlite": {},
"internal/stringslite": {},
"internal/syscall/execenv": {},
"internal/syscall/unix": {},
"math": {},

View File

@@ -18,9 +18,14 @@ package abi
// llgo:skipall
import (
_ "unsafe"
"unsafe"
"github.com/goplus/llgo/internal/abi"
)
type InterfaceType = abi.InterfaceType
func NoEscape(p unsafe.Pointer) unsafe.Pointer {
x := uintptr(p)
return unsafe.Pointer(x ^ 0)
}

View File

@@ -16,7 +16,7 @@
package bytealg
// llgo:skip init
// llgo:skip init CompareString
import (
"unsafe"
@@ -123,3 +123,26 @@ func LastIndexByteString(s string, c byte) int {
}
return -1
}
func CompareString(a, b string) int {
l := len(a)
if len(b) < l {
l = len(b)
}
for i := 0; i < l; i++ {
c1, c2 := a[i], b[i]
if c1 < c2 {
return -1
}
if c1 > c2 {
return +1
}
}
if len(a) < len(b) {
return -1
}
if len(a) > len(b) {
return +1
}
return 0
}

View File

@@ -0,0 +1 @@
package race

View File

@@ -0,0 +1 @@
package stringslite

View File

@@ -0,0 +1 @@
package iter

View File

@@ -155,9 +155,6 @@ func loadFromExportData(ld *loader, lpkg *loaderPackage) error
//go:linkname parseFiles golang.org/x/tools/go/packages.(*loader).parseFiles
func parseFiles(ld *loader, filenames []string) ([]*ast.File, []error)
//go:linkname versionsInitFileVersions golang.org/x/tools/internal/versions.InitFileVersions
func versionsInitFileVersions(*types.Info)
//go:linkname typesinternalSetUsesCgo golang.org/x/tools/internal/typesinternal.SetUsesCgo
func typesinternalSetUsesCgo(conf *types.Config) bool
@@ -354,7 +351,6 @@ func loadPackageEx(dedup Deduper, ld *loader, lpkg *loaderPackage) {
Scopes: make(map[ast.Node]*types.Scope),
Selections: make(map[*ast.SelectorExpr]*types.Selection),
}
versionsInitFileVersions(lpkg.TypesInfo)
lpkg.TypesSizes = ld.sizes
importer := importerFunc(func(path string) (*types.Package, error) {