mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 20:13:40 +00:00
wasm: implement the //go:wasmimport directive
It is implemented upstream and looks pretty stable.
This commit is contained in:
committed by
Ron Evans
parent
a4a1001dd3
commit
62e1c3ebb7
@@ -288,6 +288,15 @@ func (info *functionInfo) parsePragmas(f *ssa.Function) {
|
||||
continue
|
||||
}
|
||||
info.module = parts[1]
|
||||
case "//go:wasmimport":
|
||||
// Import a WebAssembly function, for example a WASI function.
|
||||
// For details, see: https://github.com/golang/go/issues/38248
|
||||
if len(parts) != 3 {
|
||||
continue
|
||||
}
|
||||
info.exported = true
|
||||
info.module = parts[1]
|
||||
info.importName = parts[2]
|
||||
case "//go:inline":
|
||||
info.inline = inlineHint
|
||||
case "//go:noinline":
|
||||
|
||||
Reference in New Issue
Block a user