github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/compile/internal/typecheck/subr.go (about) 1 // Copyright 2009 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package typecheck 6 7 import ( 8 "github.com/shogo82148/std/cmd/compile/internal/ir" 9 "github.com/shogo82148/std/cmd/compile/internal/types" 10 "github.com/shogo82148/std/cmd/internal/obj" 11 "github.com/shogo82148/std/cmd/internal/src" 12 ) 13 14 func AssignConv(n ir.Node, t *types.Type, context string) ir.Node 15 16 // LookupNum returns types.LocalPkg.LookupNum(prefix, n). 17 func LookupNum(prefix string, n int) *types.Sym 18 19 // Given funarg struct list, return list of fn args. 20 func NewFuncParams(origs []*types.Field) []*types.Field 21 22 // NodAddr returns a node representing &n at base.Pos. 23 func NodAddr(n ir.Node) *ir.AddrExpr 24 25 // NodAddrAt returns a node representing &n at position pos. 26 func NodAddrAt(pos src.XPos, n ir.Node) *ir.AddrExpr 27 28 // LinksymAddr returns a new expression that evaluates to the address 29 // of lsym. typ specifies the type of the addressed memory. 30 func LinksymAddr(pos src.XPos, lsym *obj.LSym, typ *types.Type) *ir.AddrExpr 31 32 func NodNil() ir.Node 33 34 // AddImplicitDots finds missing fields in obj.field that 35 // will give the shortest unique addressing and 36 // modifies the tree with missing field names. 37 func AddImplicitDots(n *ir.SelectorExpr) *ir.SelectorExpr 38 39 // CalcMethods calculates all the methods (including embedding) of a non-interface 40 // type t. 41 func CalcMethods(t *types.Type) 42 43 // Implements reports whether t implements the interface iface. t can be 44 // an interface, a type parameter, or a concrete type. 45 func Implements(t, iface *types.Type) bool 46 47 // ImplementsExplain reports whether t implements the interface iface. t can be 48 // an interface, a type parameter, or a concrete type. If t does not implement 49 // iface, a non-empty string is returned explaining why. 50 func ImplementsExplain(t, iface *types.Type) string