irgen

package
v0.0.0-...-4b1e478 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2015 License: BSD-3-Clause, MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AIK_Direct = abiArgInfo(iota)
	AIK_Indirect
)
View Source
const AttributeCommentPrefix = "#llgo "
View Source
const PNaClTriple = "armv7-none-linux-gnueabi"

PNaClTriple is the LLVM target triple that should be used to compile modules to be compatible with PNaCl (Portable Native Client).

Variables

This section is empty.

Functions

func GoVersion

func GoVersion() string

GoVersion returns the version of Go that we are targeting.

func NewLLVMTypeMap

func NewLLVMTypeMap(ctx llvm.Context, target llvm.TargetData) *llvmTypeMap

func Version

func Version() string

Version returns the version of the llgo compiler.

Types

type Attribute

type Attribute interface {
	Apply(llvm.Value)
}

Attribute represents an attribute associated with a global variable or function.

type Compiler

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

func NewCompiler

func NewCompiler(opts CompilerOptions) (*Compiler, error)

func (*Compiler) Compile

func (c *Compiler) Compile(filenames []string, importpath string) (m *Module, err error)

type CompilerOptions

type CompilerOptions struct {
	// TargetTriple is the LLVM triple for the target.
	TargetTriple string

	// GenerateDebug decides whether debug data is
	// generated in the output module.
	GenerateDebug bool

	// DebugPrefixMaps is a list of mappings from source prefixes to
	// replacement prefixes, to be applied in debug info.
	DebugPrefixMaps []debug.PrefixMap

	// Logger is a logger used for tracing compilation.
	Logger *log.Logger

	// DumpSSA is a debugging option that dumps each SSA function
	// to stderr before generating code for it.
	DumpSSA bool

	// GccgoPath is the path to the gccgo binary whose libgo we read import
	// data from. If blank, the caller is expected to supply an import
	// path in ImportPaths.
	GccgoPath string

	// ImportPaths is the list of additional import paths
	ImportPaths []string

	// SanitizerAttribute is an attribute to apply to functions to enable
	// dynamic instrumentation using a sanitizer.
	SanitizerAttribute llvm.Attribute
}

type MethodResolver

type MethodResolver interface {
	ResolveMethod(*types.Selection) *govalue
}

type Module

type Module struct {
	llvm.Module
	Path       string
	ExportData []byte
	// contains filtered or unexported fields
}

func (*Module) Dispose

func (m *Module) Dispose()

type TypeMap

type TypeMap struct {
	types.MethodSetCache
	// contains filtered or unexported fields
}

func NewTypeMap

func NewTypeMap(pkg *ssa.Package, llvmtm *llvmTypeMap, module llvm.Module, r *runtimeInterface, mr MethodResolver) *TypeMap

func (TypeMap) Alignof

func (tm TypeMap) Alignof(t types.Type) int64

func (TypeMap) Offsetsof

func (tm TypeMap) Offsetsof(fields []*types.Var) []int64

func (TypeMap) Sizeof

func (tm TypeMap) Sizeof(T types.Type) int64

func (TypeMap) ToLLVM

func (tm TypeMap) ToLLVM(t types.Type) llvm.Type

func (*TypeMap) ToRuntime

func (tm *TypeMap) ToRuntime(t types.Type) llvm.Value

Jump to

Keyboard shortcuts

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