mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-01 10:19:01 +00:00
builder: add strlen to wasm builtins
LLVM 22 can replace string-scanning loops with calls to strlen during optimization. Add the implementation to wasmbuiltins and invalidate cached archives. Add an optimized wasm-unknown smoke test that exercises the reflect name-decoding path which exposed the missing symbol.
This commit is contained in:
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import "reflect"
|
||||
|
||||
type value struct {
|
||||
Field int
|
||||
}
|
||||
|
||||
//go:wasmexport typeNameLength
|
||||
func typeNameLength() uint32 {
|
||||
return uint32(len(reflect.TypeOf(value{}).String()))
|
||||
}
|
||||
|
||||
func main() {
|
||||
}
|
||||
Reference in New Issue
Block a user