wasm: implement the //go:wasmimport directive

It is implemented upstream and looks pretty stable.
This commit is contained in:
Ayke van Laethem
2022-09-15 16:53:40 +02:00
committed by Ron Evans
parent a4a1001dd3
commit 62e1c3ebb7
3 changed files with 15 additions and 12 deletions
+9
View File
@@ -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":