ir

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2019 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MethodSignature

func MethodSignature(method *types.Func) string

Make a readable version of a method signature (including the function name, excluding the receiver name). This string is used internally to match interfaces and to call the correct method on an interface. Examples:

String() string
Read([]byte) (int, error)

Types

type Function

type Function struct {
	*ssa.Function
	LLVMFn llvm.Value
	// contains filtered or unexported fields
}

Function or method.

func (*Function) CName

func (f *Function) CName() string

Return the name of the C function if this is a CGo wrapper. Otherwise, return a zero-length string.

func (*Function) IsExported

func (f *Function) IsExported() bool

Return true iff this function is externally visible.

func (*Function) IsInterrupt

func (f *Function) IsInterrupt() bool

Return true for functions annotated with //go:interrupt. The function name is already customized in LinkName() to hook up in the interrupt vector.

On some platforms (like AVR), interrupts need a special compiler flag.

func (*Function) IsNoBounds

func (f *Function) IsNoBounds() bool

func (*Function) LinkName

func (f *Function) LinkName() string

Return the link name for this function.

type Global

type Global struct {
	*ssa.Global

	LLVMGlobal llvm.Value
	// contains filtered or unexported fields
}

Global variable, possibly constant.

func (*Global) CName

func (g *Global) CName() string

Return the name of the C global if this is a CGo wrapper. Otherwise, return a zero-length string.

func (*Global) IsExtern

func (g *Global) IsExtern() bool

func (*Global) LinkName

func (g *Global) LinkName() string

Return the link name for this global.

type Interface

type Interface struct {
	Num  int
	Type *types.Interface
}

Interface type that is at some point used in a type assert (to check whether it implements another interface).

type NamedType

type NamedType struct {
	*ssa.Type
	LLVMType llvm.Type
}

Type with a name and possibly methods.

type Program

type Program struct {
	Program       *ssa.Program
	LoaderProgram *loader.Program

	Functions []*Function

	Globals []*Global

	NamedTypes []*NamedType
	// contains filtered or unexported fields
}

View on all functions, types, and globals in a program, with analysis results.

func NewProgram

func NewProgram(lprogram *loader.Program, mainPath string) *Program

Create and intialize a new *Program from a *ssa.Program.

func (*Program) AddPackage

func (p *Program) AddPackage(pkg *ssa.Package)

Add a package to this Program. All packages need to be added first before any analysis is done for correct results.

func (*Program) GetFunction

func (p *Program) GetFunction(ssaFn *ssa.Function) *Function

func (*Program) GetGlobal

func (p *Program) GetGlobal(ssaGlobal *ssa.Global) *Global

func (*Program) IsVolatile

func (p *Program) IsVolatile(t types.Type) bool

Return true if this named type is annotated with the //go:volatile pragma, for volatile loads and stores.

func (*Program) MainPkg

func (p *Program) MainPkg() *ssa.Package

func (*Program) SimpleDCE

func (p *Program) SimpleDCE()

Simple pass that removes dead code. This pass makes later analysis passes more useful.

type TypeWithMethods

type TypeWithMethods struct {
	Num     int
	Methods map[string]*types.Selection
	// contains filtered or unexported fields
}

Type that is at some point put in an interface.

Jump to

Keyboard shortcuts

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