golang

package
v0.0.0-...-3940e3f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2021 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidMemoryIndex = fmt.Errorf("invalid memory index")

ErrInvalidMemoryIndex indicates that the memory index associated with a data section is not valid.

Functions

func CompileCommand

func CompileCommand(w io.Writer, name string, module *wasm.Module, options *Options) error

CompileCommand compiles the given WASI module into Go source code and writes the source to the given writer. The source will be contained in package main, and will contain a main function.

func CompileModule

func CompileModule(w io.Writer, packageName, name string, module *wasm.Module, options *Options) error

CompileModule compiles the given module into Go source code and writes the source to the given writer. The source will be contained in the named package, and will contain an exec.ModuleDefintion with the exported version of the given name.

func Format

func Format(w io.Writer) io.Writer

Format returns a Writer that formats Go source code prior to emitting it.

Types

type Options

type Options struct {
	// UseRawPointers enables the use of raw pointers in place of calls to exec.Memory methods for
	// loads and stores.
	UseRawPointers bool
	// NoInternalThreads disables the use of *exec.Thread inside the generated code.
	NoInternalThreads bool
}

Options records compilation options.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL