irx

package
v0.0.0-...-c756be7 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFunctionDecl

func NewFunctionDecl(md, linkage, hdr interface{}) (*ir.Function, error)

NewFunctionDecl returns a new function declaration based on the given metadata attachment, linkage and function header.

func NewFunctionDef

func NewFunctionDef(linkage, hdr, md, body interface{}) (*ir.Function, error)

NewFunctionDef returns a new function definition based on the given linkage, function header, metadata attachment and function body.

func Translate

func Translate(module *ast.Module) (*ir.Module, error)

Translate translates the AST of the given module to an equivalent LLVM IR module.

Types

type FunctionBody

type FunctionBody struct {
	Blocks        []*ir.BasicBlock
	UseListOrders []*ir.UseListOrder
}

FunctionBody is the body of an LLVM IR function.

type FunctionHeader

type FunctionHeader struct {
	Preemption      ir.Preemption      // zero value if not present
	Visibility      ir.Visibility      // zero value if not present
	DLLStorageClass ir.DLLStorageClass // zero value if not present
	CallingConv     ir.CallingConv     // zero value if not present
	ReturnAttrs     []ir.ReturnAttribute
	RetType         types.Type
	Name            string // *GlobalIdent
	Params          []*ir.Param
	Variadic        bool
	UnnamedAddr     ir.UnnamedAddr
	FuncAttrs       []ir.FuncAttribute
	Section         *ir.Section // nil if not present
	Comdat          *ir.Comdat  // nil if not present
	GC              string      // empty if not present
	Prefix          ir.Constant // *TypeConst; nil if not present
	Prologue        ir.Constant // *TypeConst; nil if not present
	Personality     ir.Constant // *TypeConst; nil if not present
}

FunctionHeader is the header of an LLVM IR function.

type Module

type Module struct {
	// Module being generated.
	*ir.Module
	// contains filtered or unexported fields
}

A Module represents an LLVM IR module generator.

func NewModule

func NewModule() *Module

NewModule returns a new module generator.

type TypeSetter

type TypeSetter interface {
	// SetType sets the type of the value to t.
	SetType(t types.Type)
}

TypeSetter is used during translation to set types of the underlying values and constants of *ast.TypeValue and *ast.TypeConst, respectively.

Jump to

Keyboard shortcuts

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