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

@@ -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