compiler

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: BSD-3-Clause Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const MaxFieldsPerParam = 3

The maximum number of arguments that can be expanded from a single struct. If a struct contains more fields, it is passed as a struct without expanding.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

type Compiler struct {
	*compileopts.Config
	// contains filtered or unexported fields
}

func NewCompiler

func NewCompiler(pkgName string, config *compileopts.Config) (*Compiler, error)

func (*Compiler) ApplyFunctionSections

func (c *Compiler) ApplyFunctionSections()

func (*Compiler) Compile

func (c *Compiler) Compile(mainPath string) []error

Compile the given package path or .go file path. Return an error when this fails (in any stage).

func (*Compiler) EmitBitcode

func (c *Compiler) EmitBitcode(path string) error

Emit LLVM bitcode file (.bc).

func (*Compiler) EmitObject

func (c *Compiler) EmitObject(path string) error

Emit object file (.o).

func (*Compiler) EmitText

func (c *Compiler) EmitText(path string) error

Emit LLVM IR source file (.ll).

func (*Compiler) ExternalInt64AsPtr

func (c *Compiler) ExternalInt64AsPtr() error

When -wasm-abi flag set to "js" (default), replace i64 in an external function with a stack-allocated i64*, to work around the lack of 64-bit integers in JavaScript (commonly used together with WebAssembly). Once that's resolved, this pass may be avoided. See also the -wasm-abi= flag https://github.com/WebAssembly/design/issues/1172

func (*Compiler) IR

func (c *Compiler) IR() string

IR returns the whole IR as a human-readable string.

func (*Compiler) LowerGoroutines

func (c *Compiler) LowerGoroutines() error

LowerGoroutines performs some IR transformations necessary to support goroutines. It does something different based on whether it uses the coroutine or the tasks implementation of goroutines, and whether goroutines are necessary at all.

func (*Compiler) Module

func (c *Compiler) Module() llvm.Module

Return the LLVM module. Only valid after a successful compile.

func (*Compiler) NonConstGlobals

func (c *Compiler) NonConstGlobals()

Turn all global constants into global variables. This works around a limitation on Harvard architectures (e.g. AVR), where constant and non-constant pointers point to a different address space.

func (*Compiler) Optimize

func (c *Compiler) Optimize(optLevel, sizeLevel int, inlinerThreshold uint) []error

Run the LLVM optimizer over the module. The inliner can be disabled (if necessary) by passing 0 to the inlinerThreshold.

func (*Compiler) Packages

func (c *Compiler) Packages() []*loader.Package

func (*Compiler) Verify

func (c *Compiler) Verify() error

type Frame

type Frame struct {
	// contains filtered or unexported fields
}

type Phi

type Phi struct {
	// contains filtered or unexported fields
}

type StdSizes

type StdSizes struct {
	IntSize  int64
	PtrSize  int64
	MaxAlign int64
}

func (*StdSizes) Alignof

func (s *StdSizes) Alignof(T types.Type) int64

func (*StdSizes) Offsetsof

func (s *StdSizes) Offsetsof(fields []*types.Var) []int64

func (*StdSizes) Sizeof

func (s *StdSizes) Sizeof(T types.Type) int64

Directories

Path Synopsis
Package llvmutil contains utility functions used across multiple compiler packages.
Package llvmutil contains utility functions used across multiple compiler packages.

Jump to

Keyboard shortcuts

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