tinygo: github.com/tinygo-org/tinygo/compiler Index | Files | Directories

package compiler

import "github.com/tinygo-org/tinygo/compiler"

Index

Package Files

asserts.go calls.go channel.go check.go compiler.go defer.go errors.go func.go gc.go goroutine-lowering.go goroutine.go inlineasm.go interface.go interrupt.go llvm.go map.go optimizer.go sizes.go symbol.go syscall.go volatile.go

Constants

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.

type Compiler Uses

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

func NewCompiler Uses

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

func (*Compiler) ApplyFunctionSections Uses

func (c *Compiler) ApplyFunctionSections()

func (*Compiler) Compile Uses

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 Uses

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

Emit LLVM bitcode file (.bc).

func (*Compiler) EmitObject Uses

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

Emit object file (.o).

func (*Compiler) EmitText Uses

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

Emit LLVM IR source file (.ll).

func (*Compiler) IR Uses

func (c *Compiler) IR() string

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

func (*Compiler) LowerGoroutines Uses

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 Uses

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

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

func (*Compiler) NonConstGlobals Uses

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 Uses

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 Uses

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

func (*Compiler) Verify Uses

func (c *Compiler) Verify() error

type Frame Uses

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

type Phi Uses

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

type StdSizes Uses

type StdSizes struct {
    IntSize  int64
    PtrSize  int64
    MaxAlign int64
}

func (*StdSizes) Alignof Uses

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

func (*StdSizes) Offsetsof Uses

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

func (*StdSizes) Sizeof Uses

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

Directories

PathSynopsis
llvmutilPackage llvmutil contains utility functions used across multiple compiler packages.

Package compiler imports 22 packages (graph) and is imported by 2 packages. Updated 2020-01-31. Refresh now. Tools for package owners.