Versions in this module Expand all Collapse all v3 v3.0.0 Jan 29, 2019 Changes in this version + const BuilderModeDoc + func DefaultType(typ types.Type) types.Type + func FindTests(pkg *Package) (tests, benchmarks, examples []*Function, main *Function) + func HasEnclosingFunction(pkg *Package, path []ast.Node) bool + func WriteFunction(buf *bytes.Buffer, f *Function) + func WritePackage(buf *bytes.Buffer, p *Package) + type Alloc struct + Comment string + Heap bool + func (v *Alloc) Name() string + func (v *Alloc) Operands(rands []*Value) []*Value + func (v *Alloc) Pos() token.Pos + func (v *Alloc) Referrers() *[]Instruction + func (v *Alloc) String() string + func (v *Alloc) Type() types.Type + type BasicBlock struct + Comment string + Index int + Instrs []Instruction + Preds []*BasicBlock + Succs []*BasicBlock + func (b *BasicBlock) Dominates(c *BasicBlock) bool + func (b *BasicBlock) Dominees() []*BasicBlock + func (b *BasicBlock) Idom() *BasicBlock + func (b *BasicBlock) Parent() *Function + func (b *BasicBlock) String() string + type BinOp struct + Op token.Token + X Value + Y Value + func (v *BinOp) Name() string + func (v *BinOp) Operands(rands []*Value) []*Value + func (v *BinOp) Pos() token.Pos + func (v *BinOp) Referrers() *[]Instruction + func (v *BinOp) String() string + func (v *BinOp) Type() types.Type + type BuilderMode uint + const BareInits + const BuildSerially + const GlobalDebug + const LogSource + const NaiveForm + const PrintFunctions + const PrintPackages + const SanityCheckFunctions + func (m *BuilderMode) Set(s string) error + func (m BuilderMode) Get() interface{} + func (m BuilderMode) String() string + type Builtin struct + func (*Builtin) Referrers() *[]Instruction + func (v *Builtin) Name() string + func (v *Builtin) Object() types.Object + func (v *Builtin) Operands(rands []*Value) []*Value + func (v *Builtin) Parent() *Function + func (v *Builtin) Pos() token.Pos + func (v *Builtin) String() string + func (v *Builtin) Type() types.Type + type Call struct + Call CallCommon + func (s *Call) Common() *CallCommon + func (s *Call) Operands(rands []*Value) []*Value + func (s *Call) Value() *Call + func (v *Call) Name() string + func (v *Call) Pos() token.Pos + func (v *Call) Referrers() *[]Instruction + func (v *Call) String() string + func (v *Call) Type() types.Type + type CallCommon struct + Args []Value + Method *types.Func + Value Value + func (c *CallCommon) Description() string + func (c *CallCommon) IsInvoke() bool + func (c *CallCommon) Operands(rands []*Value) []*Value + func (c *CallCommon) Pos() token.Pos + func (c *CallCommon) Signature() *types.Signature + func (c *CallCommon) StaticCallee() *Function + func (c *CallCommon) String() string + type CallInstruction interface + Common func() *CallCommon + Value func() *Call + type ChangeInterface struct + X Value + func (v *ChangeInterface) Name() string + func (v *ChangeInterface) Operands(rands []*Value) []*Value + func (v *ChangeInterface) Pos() token.Pos + func (v *ChangeInterface) Referrers() *[]Instruction + func (v *ChangeInterface) String() string + func (v *ChangeInterface) Type() types.Type + type ChangeType struct + X Value + func (v *ChangeType) Name() string + func (v *ChangeType) Operands(rands []*Value) []*Value + func (v *ChangeType) Pos() token.Pos + func (v *ChangeType) Referrers() *[]Instruction + func (v *ChangeType) String() string + func (v *ChangeType) Type() types.Type + type Const struct + Value exact.Value + func NewConst(val exact.Value, typ types.Type) *Const + func (c *Const) Complex128() complex128 + func (c *Const) Float64() float64 + func (c *Const) Int64() int64 + func (c *Const) IsNil() bool + func (c *Const) Name() string + func (c *Const) Parent() *Function + func (c *Const) Pos() token.Pos + func (c *Const) Referrers() *[]Instruction + func (c *Const) RelString(from *types.Package) string + func (c *Const) String() string + func (c *Const) Type() types.Type + func (c *Const) Uint64() uint64 + func (v *Const) Operands(rands []*Value) []*Value + type Convert struct + X Value + func (v *Convert) Name() string + func (v *Convert) Operands(rands []*Value) []*Value + func (v *Convert) Pos() token.Pos + func (v *Convert) Referrers() *[]Instruction + func (v *Convert) String() string + func (v *Convert) Type() types.Type + type DebugRef struct + Expr ast.Expr + IsAddr bool + X Value + func (s *DebugRef) Operands(rands []*Value) []*Value + func (s *DebugRef) Pos() token.Pos + func (s *DebugRef) String() string + func (v *DebugRef) Block() *BasicBlock + func (v *DebugRef) Parent() *Function + func (v *DebugRef) Referrers() *[]Instruction + type Defer struct + Call CallCommon + func (s *Defer) Common() *CallCommon + func (s *Defer) Operands(rands []*Value) []*Value + func (s *Defer) Pos() token.Pos + func (s *Defer) String() string + func (s *Defer) Value() *Call + func (v *Defer) Block() *BasicBlock + func (v *Defer) Parent() *Function + func (v *Defer) Referrers() *[]Instruction + type Extract struct + Index int + Tuple Value + func (v *Extract) Name() string + func (v *Extract) Operands(rands []*Value) []*Value + func (v *Extract) Pos() token.Pos + func (v *Extract) Referrers() *[]Instruction + func (v *Extract) String() string + func (v *Extract) Type() types.Type + type Field struct + Field int + X Value + func (v *Field) Name() string + func (v *Field) Operands(rands []*Value) []*Value + func (v *Field) Pos() token.Pos + func (v *Field) Referrers() *[]Instruction + func (v *Field) String() string + func (v *Field) Type() types.Type + type FieldAddr struct + Field int + X Value + func (v *FieldAddr) Name() string + func (v *FieldAddr) Operands(rands []*Value) []*Value + func (v *FieldAddr) Pos() token.Pos + func (v *FieldAddr) Referrers() *[]Instruction + func (v *FieldAddr) String() string + func (v *FieldAddr) Type() types.Type + type FreeVar struct + func (v *FreeVar) Name() string + func (v *FreeVar) Operands(rands []*Value) []*Value + func (v *FreeVar) Parent() *Function + func (v *FreeVar) Pos() token.Pos + func (v *FreeVar) Referrers() *[]Instruction + func (v *FreeVar) String() string + func (v *FreeVar) Type() types.Type + type Function struct + AnonFuncs []*Function + Blocks []*BasicBlock + FreeVars []*FreeVar + Locals []*Alloc + Params []*Parameter + Pkg *Package + Prog *Program + Recover *BasicBlock + Signature *types.Signature + Synthetic string + func EnclosingFunction(pkg *Package, path []ast.Node) *Function + func (f *Function) DomPreorder() []*BasicBlock + func (f *Function) RelString(from *types.Package) string + func (f *Function) Syntax() ast.Node + func (f *Function) ValueForExpr(e ast.Expr) (value Value, isAddr bool) + func (f *Function) WriteTo(w io.Writer) (int64, error) + func (v *Function) Name() string + func (v *Function) Object() types.Object + func (v *Function) Operands(rands []*Value) []*Value + func (v *Function) Package() *Package + func (v *Function) Parent() *Function + func (v *Function) Pos() token.Pos + func (v *Function) Referrers() *[]Instruction + func (v *Function) String() string + func (v *Function) Token() token.Token + func (v *Function) Type() types.Type + type Global struct + Pkg *Package + func (v *Global) Name() string + func (v *Global) Object() types.Object + func (v *Global) Operands(rands []*Value) []*Value + func (v *Global) Package() *Package + func (v *Global) Parent() *Function + func (v *Global) Pos() token.Pos + func (v *Global) Referrers() *[]Instruction + func (v *Global) RelString(from *types.Package) string + func (v *Global) String() string + func (v *Global) Token() token.Token + func (v *Global) Type() types.Type + type Go struct + Call CallCommon + func (s *Go) Common() *CallCommon + func (s *Go) Operands(rands []*Value) []*Value + func (s *Go) Pos() token.Pos + func (s *Go) String() string + func (s *Go) Value() *Call + func (v *Go) Block() *BasicBlock + func (v *Go) Parent() *Function + func (v *Go) Referrers() *[]Instruction + type If struct + Cond Value + func (s *If) Operands(rands []*Value) []*Value + func (s *If) Pos() token.Pos + func (s *If) String() string + func (v *If) Block() *BasicBlock + func (v *If) Parent() *Function + func (v *If) Referrers() *[]Instruction + type Index struct + Index Value + X Value + func (v *Index) Name() string + func (v *Index) Operands(rands []*Value) []*Value + func (v *Index) Pos() token.Pos + func (v *Index) Referrers() *[]Instruction + func (v *Index) String() string + func (v *Index) Type() types.Type + type IndexAddr struct + Index Value + X Value + func (v *IndexAddr) Name() string + func (v *IndexAddr) Operands(rands []*Value) []*Value + func (v *IndexAddr) Pos() token.Pos + func (v *IndexAddr) Referrers() *[]Instruction + func (v *IndexAddr) String() string + func (v *IndexAddr) Type() types.Type + type Instruction interface + Block func() *BasicBlock + Operands func(rands []*Value) []*Value + Parent func() *Function + Pos func() token.Pos + String func() string + type Jump struct + func (*Jump) Operands(rands []*Value) []*Value + func (s *Jump) Pos() token.Pos + func (s *Jump) String() string + func (v *Jump) Block() *BasicBlock + func (v *Jump) Parent() *Function + func (v *Jump) Referrers() *[]Instruction + type Lookup struct + CommaOk bool + Index Value + X Value + func (v *Lookup) Name() string + func (v *Lookup) Operands(rands []*Value) []*Value + func (v *Lookup) Pos() token.Pos + func (v *Lookup) Referrers() *[]Instruction + func (v *Lookup) String() string + func (v *Lookup) Type() types.Type + type MakeChan struct + Size Value + func (v *MakeChan) Name() string + func (v *MakeChan) Operands(rands []*Value) []*Value + func (v *MakeChan) Pos() token.Pos + func (v *MakeChan) Referrers() *[]Instruction + func (v *MakeChan) String() string + func (v *MakeChan) Type() types.Type + type MakeClosure struct + Bindings []Value + Fn Value + func (v *MakeClosure) Name() string + func (v *MakeClosure) Operands(rands []*Value) []*Value + func (v *MakeClosure) Pos() token.Pos + func (v *MakeClosure) Referrers() *[]Instruction + func (v *MakeClosure) String() string + func (v *MakeClosure) Type() types.Type + type MakeInterface struct + X Value + func (v *MakeInterface) Name() string + func (v *MakeInterface) Operands(rands []*Value) []*Value + func (v *MakeInterface) Pos() token.Pos + func (v *MakeInterface) Referrers() *[]Instruction + func (v *MakeInterface) String() string + func (v *MakeInterface) Type() types.Type + type MakeMap struct + Reserve Value + func (v *MakeMap) Name() string + func (v *MakeMap) Operands(rands []*Value) []*Value + func (v *MakeMap) Pos() token.Pos + func (v *MakeMap) Referrers() *[]Instruction + func (v *MakeMap) String() string + func (v *MakeMap) Type() types.Type + type MakeSlice struct + Cap Value + Len Value + func (v *MakeSlice) Name() string + func (v *MakeSlice) Operands(rands []*Value) []*Value + func (v *MakeSlice) Pos() token.Pos + func (v *MakeSlice) Referrers() *[]Instruction + func (v *MakeSlice) String() string + func (v *MakeSlice) Type() types.Type + type MapUpdate struct + Key Value + Map Value + Value Value + func (s *MapUpdate) Pos() token.Pos + func (s *MapUpdate) String() string + func (v *MapUpdate) Block() *BasicBlock + func (v *MapUpdate) Operands(rands []*Value) []*Value + func (v *MapUpdate) Parent() *Function + func (v *MapUpdate) Referrers() *[]Instruction + type Member interface + Name func() string + Object func() types.Object + Package func() *Package + Pos func() token.Pos + RelString func(*types.Package) string + String func() string + Token func() token.Token + Type func() types.Type + type NamedConst struct + Value *Const + func (c *NamedConst) Name() string + func (c *NamedConst) Object() types.Object + func (c *NamedConst) Package() *Package + func (c *NamedConst) Pos() token.Pos + func (c *NamedConst) RelString(from *types.Package) string + func (c *NamedConst) String() string + func (c *NamedConst) Token() token.Token + func (c *NamedConst) Type() types.Type + type Next struct + IsString bool + Iter Value + func (v *Next) Name() string + func (v *Next) Operands(rands []*Value) []*Value + func (v *Next) Pos() token.Pos + func (v *Next) Referrers() *[]Instruction + func (v *Next) String() string + func (v *Next) Type() types.Type + type Node interface + Operands func(rands []*Value) []*Value + Parent func() *Function + Pos func() token.Pos + Referrers func() *[]Instruction + String func() string + type Package struct + Members map[string]Member + Pkg *types.Package + Prog *Program + func (p *Package) Build() + func (p *Package) Const(name string) (c *NamedConst) + func (p *Package) Func(name string) (f *Function) + func (p *Package) String() string + func (p *Package) Type(name string) (t *Type) + func (p *Package) Var(name string) (g *Global) + func (p *Package) WriteTo(w io.Writer) (int64, error) + func (pkg *Package) SetDebugMode(debug bool) + type Panic struct + X Value + func (s *Panic) Operands(rands []*Value) []*Value + func (s *Panic) Pos() token.Pos + func (s *Panic) String() string + func (v *Panic) Block() *BasicBlock + func (v *Panic) Parent() *Function + func (v *Panic) Referrers() *[]Instruction + type Parameter struct + func (v *Parameter) Name() string + func (v *Parameter) Object() types.Object + func (v *Parameter) Operands(rands []*Value) []*Value + func (v *Parameter) Parent() *Function + func (v *Parameter) Pos() token.Pos + func (v *Parameter) Referrers() *[]Instruction + func (v *Parameter) String() string + func (v *Parameter) Type() types.Type + type Phi struct + Comment string + Edges []Value + func (v *Phi) Name() string + func (v *Phi) Operands(rands []*Value) []*Value + func (v *Phi) Pos() token.Pos + func (v *Phi) Referrers() *[]Instruction + func (v *Phi) String() string + func (v *Phi) Type() types.Type + type Program struct + Fset *token.FileSet + MethodSets typeutil.MethodSetCache + func NewProgram(fset *token.FileSet, mode BuilderMode) *Program + func (prog *Program) AllPackages() []*Package + func (prog *Program) Build() + func (prog *Program) ConstValue(obj *types.Const) *Const + func (prog *Program) CreatePackage(pkg *types.Package, files []*ast.File, info *types.Info, importable bool) *Package + func (prog *Program) CreateTestMainPackage(pkg *Package) *Package + func (prog *Program) FuncValue(obj *types.Func) *Function + func (prog *Program) ImportedPackage(path string) *Package + func (prog *Program) LookupMethod(T types.Type, pkg *types.Package, name string) *Function + func (prog *Program) MethodValue(sel *types.Selection) *Function + func (prog *Program) NewFunction(name string, sig *types.Signature, provenance string) *Function + func (prog *Program) Package(obj *types.Package) *Package + func (prog *Program) RuntimeTypes() []types.Type + func (prog *Program) VarValue(obj *types.Var, pkg *Package, ref []ast.Node) (value Value, isAddr bool) + type Range struct + X Value + func (v *Range) Name() string + func (v *Range) Operands(rands []*Value) []*Value + func (v *Range) Pos() token.Pos + func (v *Range) Referrers() *[]Instruction + func (v *Range) String() string + func (v *Range) Type() types.Type + type Return struct + Results []Value + func (s *Return) Operands(rands []*Value) []*Value + func (s *Return) Pos() token.Pos + func (s *Return) String() string + func (v *Return) Block() *BasicBlock + func (v *Return) Parent() *Function + func (v *Return) Referrers() *[]Instruction + type RunDefers struct + func (*RunDefers) Operands(rands []*Value) []*Value + func (*RunDefers) String() string + func (s *RunDefers) Pos() token.Pos + func (v *RunDefers) Block() *BasicBlock + func (v *RunDefers) Parent() *Function + func (v *RunDefers) Referrers() *[]Instruction + type Select struct + Blocking bool + States []*SelectState + func (s *Select) String() string + func (v *Select) Name() string + func (v *Select) Operands(rands []*Value) []*Value + func (v *Select) Pos() token.Pos + func (v *Select) Referrers() *[]Instruction + func (v *Select) Type() types.Type + type SelectState struct + Chan Value + DebugNode ast.Node + Dir types.ChanDir + Pos token.Pos + Send Value + type Send struct + Chan Value + X Value + func (s *Send) Operands(rands []*Value) []*Value + func (s *Send) Pos() token.Pos + func (s *Send) String() string + func (v *Send) Block() *BasicBlock + func (v *Send) Parent() *Function + func (v *Send) Referrers() *[]Instruction + type Slice struct + High Value + Low Value + Max Value + X Value + func (v *Slice) Name() string + func (v *Slice) Operands(rands []*Value) []*Value + func (v *Slice) Pos() token.Pos + func (v *Slice) Referrers() *[]Instruction + func (v *Slice) String() string + func (v *Slice) Type() types.Type + type Store struct + Addr Value + Val Value + func (s *Store) Operands(rands []*Value) []*Value + func (s *Store) Pos() token.Pos + func (s *Store) String() string + func (v *Store) Block() *BasicBlock + func (v *Store) Parent() *Function + func (v *Store) Referrers() *[]Instruction + type Type struct + func (t *Type) Name() string + func (t *Type) Object() types.Object + func (t *Type) Package() *Package + func (t *Type) Pos() token.Pos + func (t *Type) RelString(from *types.Package) string + func (t *Type) String() string + func (t *Type) Token() token.Token + func (t *Type) Type() types.Type + type TypeAssert struct + AssertedType types.Type + CommaOk bool + X Value + func (v *TypeAssert) Name() string + func (v *TypeAssert) Operands(rands []*Value) []*Value + func (v *TypeAssert) Pos() token.Pos + func (v *TypeAssert) Referrers() *[]Instruction + func (v *TypeAssert) String() string + func (v *TypeAssert) Type() types.Type + type UnOp struct + CommaOk bool + Op token.Token + X Value + func (v *UnOp) Name() string + func (v *UnOp) Operands(rands []*Value) []*Value + func (v *UnOp) Pos() token.Pos + func (v *UnOp) Referrers() *[]Instruction + func (v *UnOp) String() string + func (v *UnOp) Type() types.Type + type Value interface + Name func() string + Parent func() *Function + Pos func() token.Pos + Referrers func() *[]Instruction + String func() string + Type func() types.Type