builder

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Overview

Package builder is the compiler driver of TinyGo. It takes in a package name and an output path, and outputs an executable. It manages the entire compilation pipeline in between.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(pkgName, outpath string, config *compileopts.Config, action func(string) error) error

Build performs a single package to executable Go build. It takes in a package name, an output path, and set of compile options and from that it manages the whole compilation process.

The error value may be of type *MultiError. Callers will likely want to check for this case and print such errors individually.

func CompileBuiltins

func CompileBuiltins(target string, callback func(path string) error) error

CompileBuiltins compiles builtins from compiler-rt into a static library. When it succeeds, it will call the callback with the resulting path. The path will be removed after callback returns. If callback returns an error, this is passed through to the return value of this function.

func GorootVersionString

func GorootVersionString(goroot string) (string, error)

GorootVersionString returns the version string as reported by the Go toolchain for the given GOROOT path. It is usually of the form `go1.x.y` but can have some variations (for beta releases, for example).

func NewConfig

func NewConfig(options *compileopts.Options) (*compileopts.Config, error)

NewConfig builds a new Config object from a set of compiler options. It also loads some information from the environment while doing that. For example, it uses the currently active GOPATH (from the goenv package) to determine the Go version to use.

Types

type MultiError

type MultiError struct {
	Errs []error
}

MultiError is a list of multiple errors (actually: diagnostics) returned during LLVM IR generation.

func (*MultiError) Error

func (e *MultiError) Error() string

Jump to

Keyboard shortcuts

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