Functions
AddImplicitDots
function
#
AddImplicitDots finds missing fields in obj.field that
will give the shortest unique addressing and
modifies the tree with missing field names.
func AddImplicitDots(n *ir.SelectorExpr) *ir.SelectorExpr
AssertFixedCall
function
#
func AssertFixedCall(call *ir.CallExpr)
AssignConv
function
#
func AssignConv(n ir.Node, t *types.Type, context string) ir.Node
AssignExpr
function
#
func AssignExpr(n ir.Node) ir.Node
AutoLabel
function
#
AutoLabel generates a new Name node for use with
an automatically generated label.
prefix is a short mnemonic (e.g. ".s" for switch)
to help with debugging.
It should begin with "." to avoid conflicts with
user labels.
func AutoLabel(prefix string) *types.Sym
BaseTypeIndex
function
#
func BaseTypeIndex(t *types.Type) int64
CalcMethods
function
#
CalcMethods calculates all the methods (including embedding) of a non-interface
type t.
func CalcMethods(t *types.Type)
Call
function
#
func Call(pos src.XPos, callee ir.Node, args []ir.Node, dots bool) ir.Node
Callee
function
#
func Callee(n ir.Node) ir.Node
CheckFuncStack
function
#
func CheckFuncStack()
ClosureType
function
#
ClosureType returns the struct type used to hold all the information
needed in the closure for clo (clo must be a OCLOSURE node).
The address of a variable of the returned type can be cast to a func.
func ClosureType(clo *ir.ClosureExpr) *types.Type
Conv
function
#
func Conv(n ir.Node, t *types.Type) ir.Node
ConvNop
function
#
ConvNop converts node n to type t using the OCONVNOP op
and typechecks the result with ctxExpr.
func ConvNop(n ir.Node, t *types.Type) ir.Node
ConvertVal
function
#
ConvertVal converts v into a representation appropriate for t. If
no such representation exists, it returns constant.MakeUnknown()
instead.
If explicit is true, then conversions from integer to string are
also allowed.
func ConvertVal(v constant.Value, t *types.Type, explicit bool) constant.Value
DeclFunc
function
#
DeclFunc declares the parameters for fn and adds it to
Target.Funcs.
Before returning, it sets CurFunc to fn. When the caller is done
constructing fn, it must call FinishFuncBody to restore CurFunc.
func DeclFunc(fn *ir.Func)
DefaultLit
function
#
func DefaultLit(n ir.Node, t *types.Type) ir.Node
DotField
function
#
DotField returns a field selector expression that selects the
index'th field of the given expression, which must be of struct or
pointer-to-struct type.
func DotField(pos src.XPos, x ir.Node, index int) *ir.SelectorExpr
Expr
function
#
func Expr(n ir.Node) ir.Node
Exprs
function
#
func Exprs(exprs []ir.Node)
FinishFuncBody
function
#
FinishFuncBody restores ir.CurFunc to its state before the last
call to DeclFunc.
func FinishFuncBody()
FixMethodCall
function
#
FixMethodCall rewrites a method call t.M(...) into a function call T.M(t, ...).
func FixMethodCall(call *ir.CallExpr)
FixVariadicCall
function
#
FixVariadicCall rewrites calls to variadic functions to use an
explicit ... argument if one is not already present.
func FixVariadicCall(call *ir.CallExpr)
Implements
function
#
Implements reports whether t implements the interface iface. t can be
an interface, a type parameter, or a concrete type.
func Implements(t *types.Type, iface *types.Type) bool
ImplementsExplain
function
#
ImplementsExplain reports whether t implements the interface iface. t can be
an interface, a type parameter, or a concrete type. If t does not implement
iface, a non-empty string is returned explaining why.
func ImplementsExplain(t *types.Type, iface *types.Type) string
IndexConst
function
#
IndexConst returns the index value of constant Node n.
func IndexConst(n ir.Node) int64
InitCoverage
function
#
InitCoverage loads the definitions for routines called
by code coverage instrumentation (similar to InitRuntime above).
func InitCoverage()
InitRuntime
function
#
InitRuntime loads the definitions for the low-level runtime functions,
so that the compiler can generate calls to them,
but does not make them visible to user code.
func InitRuntime()
InitUniverse
function
#
InitUniverse initializes the universe block.
func InitUniverse()
LinksymAddr
function
#
LinksymAddr returns a new expression that evaluates to the address
of lsym. typ specifies the type of the addressed memory.
func LinksymAddr(pos src.XPos, lsym *obj.LSym, typ *types.Type) *ir.AddrExpr
Lookdot
function
#
Lookdot looks up field or method n.Sel in the type t and returns the matching
field. It transforms the op of node n to ODOTINTER or ODOTMETH, if appropriate.
It also may add a StarExpr node to n.X as needed for access to non-pointer
methods. If dostrcmp is 0, it matches the field/method with the exact symbol
as n.Sel (appropriate for exported fields). If dostrcmp is 1, it matches by name
exactly. If dostrcmp is 2, it matches names with case folding.
func Lookdot(n *ir.SelectorExpr, t *types.Type, dostrcmp int) *types.Field
Lookdot1
function
#
Lookdot1 looks up the specified method s in the list fs of methods, returning
the matching field or nil. If dostrcmp is 0, it matches the symbols. If
dostrcmp is 1, it matches by name exactly. If dostrcmp is 2, it matches names
with case folding.
func Lookdot1(errnode ir.Node, s *types.Sym, t *types.Type, fs []*types.Field, dostrcmp int) *types.Field
Lookup
function
#
func Lookup(name string) *types.Sym
LookupCoverage
function
#
LookupCoverage looks up the Go function 'name' in package
runtime/coverage. This function must follow the internal calling
convention.
func LookupCoverage(name string) *ir.Name
LookupNum
function
#
LookupNum returns types.LocalPkg.LookupNum(prefix, n).
func LookupNum(prefix string, n int) *types.Sym
LookupRuntime
function
#
LookupRuntime returns a function or variable declared in
_builtin/runtime.go. If types_ is non-empty, successive occurrences
of the "any" placeholder type will be substituted.
func LookupRuntime(name string, types_ ...*types.Type) *ir.Name
LookupRuntimeABI
function
#
LookupRuntimeABI looks up a name in package runtime using the given ABI.
func LookupRuntimeABI(name string, abi obj.ABI) *obj.LSym
LookupRuntimeFunc
function
#
LookupRuntimeFunc looks up Go function name in package runtime. This function
must follow the internal calling convention.
func LookupRuntimeFunc(name string) *obj.LSym
LookupRuntimeVar
function
#
LookupRuntimeVar looks up a variable (or assembly function) name in package
runtime. If this is a function, it may have a special calling
convention.
func LookupRuntimeVar(name string) *obj.LSym
MakeDotArgs
function
#
MakeDotArgs package all the arguments that match a ... T parameter into a []T.
func MakeDotArgs(pos src.XPos, typ *types.Type, args []ir.Node) ir.Node
MethodValueType
function
#
MethodValueType returns the struct type used to hold all the information
needed in the closure for a OMETHVALUE node. The address of a variable of
the returned type can be cast to a func.
func MethodValueType(n *ir.SelectorExpr) *types.Type
NewClosureStructIter
function
#
NewClosureStructIter creates a new ClosureStructIter for closureVars.
func NewClosureStructIter(closureVars []*ir.Name) *ClosureStructIter
NewFuncParams
function
#
Given funarg struct list, return list of fn args.
func NewFuncParams(origs []*types.Field) []*types.Field
NewMethodExpr
function
#
NewMethodExpr returns an OMETHEXPR node representing method
expression "recv.sym".
func NewMethodExpr(pos src.XPos, recv *types.Type, sym *types.Sym) *ir.SelectorExpr
NewMethodType
function
#
f is method type, with receiver.
return function type, receiver as first argument (or not).
func NewMethodType(sig *types.Type, recv *types.Type) *types.Type
Next
method
#
Next returns the next name, type and offset of the next closure variable.
A nil name is returned after the last closure variable.
func (iter *ClosureStructIter) Next() (n *ir.Name, typ *types.Type, offset int64)
NodAddr
function
#
NodAddr returns a node representing &n at base.Pos.
func NodAddr(n ir.Node) *ir.AddrExpr
NodAddrAt
function
#
NodAddrAt returns a node representing &n at position pos.
func NodAddrAt(pos src.XPos, n ir.Node) *ir.AddrExpr
NodNil
function
#
func NodNil() ir.Node
RangeExprType
function
#
func RangeExprType(t *types.Type) *types.Type
RewriteMultiValueCall
function
#
RewriteMultiValueCall rewrites multi-valued f() to use temporaries,
so the backend wouldn't need to worry about tuple-valued expressions.
func RewriteMultiValueCall(n ir.InitNode, call ir.Node)
RewriteNonNameCall
function
#
RewriteNonNameCall replaces non-Name call expressions with temps,
rewriting f()(...) to t0 := f(); t0(...).
func RewriteNonNameCall(n *ir.CallExpr)
SetBaseTypeIndex
function
#
func SetBaseTypeIndex(t *types.Type, i int64, pi int64)
Stmt
function
#
func Stmt(n ir.Node) ir.Node
Stmts
function
#
func Stmts(stmts []ir.Node)
TempAt
function
#
make a new Node off the books.
func TempAt(pos src.XPos, curfn *ir.Func, typ *types.Type) *ir.Name
TparamName
function
#
TparamName returns the real name of a type parameter, after stripping its
qualifying prefix and reverting blank-name encoding. See TparamExportName
for details.
func TparamName(exportName string) string
XDotField
function
#
XDotField returns an expression representing the field selection
x.sym. If any implicit field selection are necessary, those are
inserted too.
func XDotField(pos src.XPos, x ir.Node, sym *types.Sym) *ir.SelectorExpr
XDotMethod
function
#
XDotMethod returns an expression representing the method value
x.sym (i.e., x is a value, not a type). If any implicit field
selection are necessary, those are inserted too.
If callee is true, the result is an ODOTMETH/ODOTINTER, otherwise
an OMETHVALUE.
func XDotMethod(pos src.XPos, x ir.Node, sym *types.Sym, callee bool) *ir.SelectorExpr
add
method
#
func (s *typeSet) add(pos src.XPos, typ *types.Type)
adddot1
function
#
adddot1 returns the number of fields or methods named s at depth d in Type t.
If exactly one exists, it will be returned in *save (if save is not nil),
and dotlist will contain the path of embedded fields traversed to find it,
in reverse order. If none exist, more will indicate whether t contains any
embedded fields at depth d, so callers can decide whether to retry at
a greater depth.
func adddot1(s *types.Sym, t *types.Type, d int, save **types.Field, ignorecase bool) (c int, more bool)
assign
function
#
func assign(stmt ir.Node, lhs []ir.Node, rhs []ir.Node)
assignOp
function
#
Is type src assignment compatible to type dst?
If so, return op code to use in conversion.
If not, return OXXX. In this case, the string return parameter may
hold a reason why. In all other cases, it'll be the empty string.
func assignOp(src *types.Type, dst *types.Type) (ir.Op, string)
assignconvfn
function
#
Convert node n for assignment to type t.
func assignconvfn(n ir.Node, t *types.Type, context func() string) ir.Node
autotmpname
function
#
autotmpname returns the name for an autotmp variable numbered n.
func autotmpname(n int) string
callOrChan
function
#
callOrChan reports whether n is a call or channel operation.
func callOrChan(n ir.Node) bool
checkassign
function
#
func checkassign(n ir.Node)
checkassignto
function
#
func checkassignto(src *types.Type, dst ir.Node)
checklvalue
function
#
func checklvalue(n ir.Node, verb string)
checkmake
function
#
func checkmake(t *types.Type, arg string, np *ir.Node) bool
checksliceindex
function
#
func checksliceindex(r ir.Node) bool
checkunsafesliceorstring
function
#
checkunsafesliceorstring is like checkmake but for unsafe.{Slice,String}.
func checkunsafesliceorstring(op ir.Op, np *ir.Node) bool
convertOp
function
#
Can we convert a value of type src to a value of type dst?
If so, return op code to use in conversion (maybe OCONVNOP).
If not, return OXXX. In this case, the string return parameter may
hold a reason why. In all other cases, it'll be the empty string.
srcConstant indicates whether the value of type src is a constant.
func convertOp(srcConstant bool, src *types.Type, dst *types.Type) (ir.Op, string)
convlit
function
#
TODO(mdempsky): Replace these with better APIs.
func convlit(n ir.Node, t *types.Type) ir.Node
convlit1
function
#
convlit1 converts an untyped expression n to type t. If n already
has a type, convlit1 has no effect.
For explicit conversions, t must be non-nil, and integer-to-string
conversions are allowed.
For implicit conversions (e.g., assignments), t may be nil; if so,
n is converted to its default type.
If there's an error converting n to t, context is used in the error
message.
func convlit1(n ir.Node, t *types.Type, explicit bool, context func() string) ir.Node
coverageTypes
function
#
func coverageTypes() []*types.Type
defaultType
function
#
func defaultType(t *types.Type) *types.Type
defaultlit2
function
#
DefaultLit on both nodes simultaneously;
if they're both ideal going in they better
get the same type going out.
force means must assign concrete (non-ideal) type.
The results of defaultlit2 MUST be assigned back to l and r, e.g.
n.Left, n.Right = defaultlit2(n.Left, n.Right, force)
func defaultlit2(l ir.Node, r ir.Node, force bool) (ir.Node, ir.Node)
derefall
function
#
func derefall(t *types.Type) *types.Type
dot
function
#
func dot(pos src.XPos, typ *types.Type, op ir.Op, x ir.Node, selection *types.Field) *ir.SelectorExpr
dotpath
function
#
dotpath computes the unique shortest explicit selector path to fully qualify
a selection expression x.f, where x is of type t and f is the symbol s.
If no such path exists, dotpath returns nil.
If there are multiple shortest paths to the same depth, ambig is true.
func dotpath(s *types.Sym, t *types.Type, save **types.Field, ignorecase bool) (path []dlist, ambig bool)
expand0
function
#
func expand0(t *types.Type)
expand1
function
#
func expand1(t *types.Type, top bool)
fielddup
function
#
type check composite.
func fielddup(name string, hash map[string]bool)
hasddd
function
#
func hasddd(params []*types.Field) bool
ifacelookdot
function
#
func ifacelookdot(s *types.Sym, t *types.Type, ignorecase bool) *types.Field
implements
function
#
implements reports whether t implements the interface iface. t can be
an interface, a type parameter, or a concrete type. If implements returns
false, it stores a method of iface that is not implemented in *m. If the
method name matches but the type is wrong, it additionally stores the type
of the method (on t) in *samename.
func implements(t *types.Type, iface *types.Type, m **types.Field, samename **types.Field, ptr *int) bool
implicitstar
function
#
The result of implicitstar MUST be assigned back to n, e.g.
n.Left = implicitstar(n.Left)
func implicitstar(n ir.Node) ir.Node
importfunc
function
#
importfunc declares symbol s as an imported function with type t.
func importfunc(s *types.Sym, t *types.Type)
importsym
function
#
func importsym(name *ir.Name)
importvar
function
#
importvar declares symbol s as an imported variable with type t.
func importvar(s *types.Sym, t *types.Type)
indexlit
function
#
indexlit implements typechecking of untyped values as
array/slice indexes. It is almost equivalent to DefaultLit
but also accepts untyped numeric values representable as
value of type int (see also checkmake for comparison).
The result of indexlit MUST be assigned back to n, e.g.
n.Left = indexlit(n.Left)
func indexlit(n ir.Node) ir.Node
isptrto
function
#
func isptrto(t *types.Type, et types.Kind) bool
lookdot0
function
#
lookdot0 returns the number of fields or methods named s associated
with Type t. If exactly one exists, it will be returned in *save
(if save is not nil).
func lookdot0(s *types.Sym, t *types.Type, save **types.Field, ignorecase bool) int
makeComplex
function
#
func makeComplex(real constant.Value, imag constant.Value) constant.Value
makeFloat64
function
#
func makeFloat64(f float64) constant.Value
mixUntyped
function
#
func mixUntyped(t1 *types.Type, t2 *types.Type) *types.Type
needOneArg
function
#
func needOneArg(n *ir.CallExpr, f string, args ...interface{}) (ir.Node, bool)
needTwoArgs
function
#
func needTwoArgs(n *ir.CallExpr) (ir.Node, ir.Node, bool)
newSig
function
#
Not inlining this function removes a significant chunk of init code.
go:noinline
func newSig(params []*types.Field, results []*types.Field) *types.Type
nokeys
function
#
func nokeys(l ir.Nodes) bool
nonexported
function
#
nonexported reports whether sym is an unexported field.
func nonexported(sym *types.Sym) bool
normalizeGoDeferCall
function
#
normalizeGoDeferCall normalizes call into a normal function call
with no arguments and no results, suitable for use in an OGO/ODEFER
statement.
For example, it normalizes:
f(x, y)
into:
x1, y1 := x, y // added to init
func() { f(x1, y1) }() // result
func normalizeGoDeferCall(pos src.XPos, op ir.Op, call ir.Node, init *ir.Nodes) *ir.CallExpr
operandType
function
#
func operandType(op ir.Op, t *types.Type) *types.Type
params
function
#
func params(tlist ...*types.Type) []*types.Field
plural
function
#
func plural(n int) string
roundFloat
function
#
func roundFloat(v constant.Value, sz int64) constant.Value
runtimeTypes
function
#
func runtimeTypes() []*types.Type
stringtoruneslit
function
#
The result of stringtoruneslit MUST be assigned back to n, e.g.
n.Left = stringtoruneslit(n.Left)
func stringtoruneslit(n *ir.ConvExpr) ir.Node
substArgTypes
function
#
SubstArgTypes substitutes the given list of types for
successive occurrences of the "any" placeholder in the
type syntax expression n.Type.
func substArgTypes(old *ir.Name, types_ ...*types.Type) *ir.Name
tcAppend
function
#
tcAppend typechecks an OAPPEND node.
func tcAppend(n *ir.CallExpr) ir.Node
tcArith
function
#
tcArith typechecks operands of a binary arithmetic expression.
The result of tcArith MUST be assigned back to original operands,
t is the type of the expression, and should be set by the caller. e.g:
n.X, n.Y, t = tcArith(n, op, n.X, n.Y)
n.SetType(t)
func tcArith(n ir.Node, op ir.Op, l ir.Node, r ir.Node) (ir.Node, ir.Node, *types.Type)
tcAssign
function
#
type check assignment.
if this assignment is the definition of a var on the left side,
fill in the var's type.
func tcAssign(n *ir.AssignStmt)
tcAssignList
function
#
func tcAssignList(n *ir.AssignListStmt)
tcCall
function
#
tcCall typechecks an OCALL node.
func tcCall(n *ir.CallExpr, top int) ir.Node
tcCheckNil
function
#
tcCheckNil typechecks an OCHECKNIL node.
func tcCheckNil(n *ir.UnaryExpr) ir.Node
tcClear
function
#
tcClear typechecks an OCLEAR node.
func tcClear(n *ir.UnaryExpr) ir.Node
tcClose
function
#
tcClose typechecks an OCLOSE node.
func tcClose(n *ir.UnaryExpr) ir.Node
tcCompLit
function
#
The result of tcCompLit MUST be assigned back to n, e.g.
n.Left = tcCompLit(n.Left)
func tcCompLit(n *ir.CompLitExpr) (res ir.Node)
tcComplex
function
#
tcComplex typechecks an OCOMPLEX node.
func tcComplex(n *ir.BinaryExpr) ir.Node
tcConv
function
#
tcConv typechecks an OCONV node.
func tcConv(n *ir.ConvExpr) ir.Node
tcCopy
function
#
tcCopy typechecks an OCOPY node.
func tcCopy(n *ir.BinaryExpr) ir.Node
tcDelete
function
#
tcDelete typechecks an ODELETE node.
func tcDelete(n *ir.CallExpr) ir.Node
tcDot
function
#
tcDot typechecks an OXDOT or ODOT node.
func tcDot(n *ir.SelectorExpr, top int) ir.Node
tcDotType
function
#
tcDotType typechecks an ODOTTYPE node.
func tcDotType(n *ir.TypeAssertExpr) ir.Node
tcFor
function
#
tcFor typechecks an OFOR node.
func tcFor(n *ir.ForStmt) ir.Node
tcFunc
function
#
type check function definition
To be called by typecheck, not directly.
(Call typecheck.Func instead.)
func tcFunc(n *ir.Func)
tcGoDefer
function
#
tcGoDefer typechecks (normalizes) an OGO/ODEFER statement.
func tcGoDefer(n *ir.GoDeferStmt)
tcITab
function
#
tcITab typechecks an OITAB node.
func tcITab(n *ir.UnaryExpr) ir.Node
tcIf
function
#
tcIf typechecks an OIF node.
func tcIf(n *ir.IfStmt) ir.Node
tcIndex
function
#
tcIndex typechecks an OINDEX node.
func tcIndex(n *ir.IndexExpr) ir.Node
tcLenCap
function
#
tcLenCap typechecks an OLEN or OCAP node.
func tcLenCap(n *ir.UnaryExpr) ir.Node
tcMake
function
#
tcMake typechecks an OMAKE node.
func tcMake(n *ir.CallExpr) ir.Node
tcMakeSliceCopy
function
#
tcMakeSliceCopy typechecks an OMAKESLICECOPY node.
func tcMakeSliceCopy(n *ir.MakeExpr) ir.Node
tcMinMax
function
#
tcMinMax typechecks an OMIN or OMAX node.
func tcMinMax(n *ir.CallExpr) ir.Node
tcNew
function
#
tcNew typechecks an ONEW node.
func tcNew(n *ir.UnaryExpr) ir.Node
tcPanic
function
#
tcPanic typechecks an OPANIC node.
func tcPanic(n *ir.UnaryExpr) ir.Node
tcPrint
function
#
tcPrint typechecks an OPRINT or OPRINTN node.
func tcPrint(n *ir.CallExpr) ir.Node
tcRange
function
#
range
func tcRange(n *ir.RangeStmt)
tcRealImag
function
#
tcRealImag typechecks an OREAL or OIMAG node.
func tcRealImag(n *ir.UnaryExpr) ir.Node
tcRecover
function
#
tcRecover typechecks an ORECOVER node.
func tcRecover(n *ir.CallExpr) ir.Node
tcRecv
function
#
tcRecv typechecks an ORECV node.
func tcRecv(n *ir.UnaryExpr) ir.Node
tcReturn
function
#
tcReturn typechecks an ORETURN node.
func tcReturn(n *ir.ReturnStmt) ir.Node
tcSPtr
function
#
tcSPtr typechecks an OSPTR node.
func tcSPtr(n *ir.UnaryExpr) ir.Node
tcSelect
function
#
select
func tcSelect(sel *ir.SelectStmt)
tcSend
function
#
tcSend typechecks an OSEND node.
func tcSend(n *ir.SendStmt) ir.Node
tcShift
function
#
func tcShift(n ir.Node, l ir.Node, r ir.Node) (ir.Node, ir.Node, *types.Type)
tcSlice
function
#
tcSlice typechecks an OSLICE or OSLICE3 node.
func tcSlice(n *ir.SliceExpr) ir.Node
tcStar
function
#
tcStar typechecks an ODEREF node, which may be an expression or a type.
func tcStar(n *ir.StarExpr, top int) ir.Node
tcStructLitKey
function
#
tcStructLitKey typechecks an OKEY node that appeared within a
struct literal.
func tcStructLitKey(typ *types.Type, kv *ir.KeyExpr) *ir.StructKeyExpr
tcSwitch
function
#
tcSwitch typechecks a switch statement.
func tcSwitch(n *ir.SwitchStmt)
tcSwitchExpr
function
#
func tcSwitchExpr(n *ir.SwitchStmt)
tcSwitchType
function
#
func tcSwitchType(n *ir.SwitchStmt)
tcUnaryArith
function
#
tcUnaryArith typechecks a unary arithmetic expression.
func tcUnaryArith(n *ir.UnaryExpr) ir.Node
tcUnsafeAdd
function
#
tcUnsafeAdd typechecks an OUNSAFEADD node.
func tcUnsafeAdd(n *ir.BinaryExpr) *ir.BinaryExpr
tcUnsafeData
function
#
tcUnsafeData typechecks an OUNSAFESLICEDATA or OUNSAFESTRINGDATA node.
func tcUnsafeData(n *ir.UnaryExpr) ir.Node
tcUnsafeSlice
function
#
tcUnsafeSlice typechecks an OUNSAFESLICE node.
func tcUnsafeSlice(n *ir.BinaryExpr) *ir.BinaryExpr
tcUnsafeString
function
#
tcUnsafeString typechecks an OUNSAFESTRING node.
func tcUnsafeString(n *ir.BinaryExpr) *ir.BinaryExpr
tocplx
function
#
func tocplx(v constant.Value) constant.Value
toflt
function
#
func toflt(v constant.Value) constant.Value
toint
function
#
func toint(v constant.Value) constant.Value
tostr
function
#
func tostr(v constant.Value) constant.Value
tracePrint
function
#
func tracePrint(title string, n ir.Node) (func(np *ir.Node))
trunccmplxlit
function
#
truncate Real and Imag parts of Mpcplx to 32-bit or 64-bit
precision, according to type; return truncated value. In case of
overflow, calls Errorf but does not truncate the input value.
func trunccmplxlit(v constant.Value, t *types.Type) constant.Value
truncfltlit
function
#
truncate float literal fv to 32-bit or 64-bit precision
according to type; return truncated value.
func truncfltlit(v constant.Value, t *types.Type) constant.Value
typecheck
function
#
typecheck type checks node n.
The result of typecheck MUST be assigned back to n, e.g.
n.Left = typecheck(n.Left, top)
func typecheck(n ir.Node, top int) (res ir.Node)
typecheck1
function
#
typecheck1 should ONLY be called from typecheck.
func typecheck1(n ir.Node, top int) ir.Node
typecheckargs
function
#
func typecheckargs(n ir.InitNode)
typecheckarraylit
function
#
typecheckarraylit type-checks a sequence of slice/array literal elements.
func typecheckarraylit(elemType *types.Type, bound int64, elts []ir.Node, ctx string) int64
typecheckaste
function
#
typecheck assignment: type list = expression list
func typecheckaste(op ir.Op, call ir.Node, isddd bool, params []*types.Field, nl ir.Nodes, desc func() string)
typecheckrangeExpr
function
#
func typecheckrangeExpr(n *ir.RangeStmt)
typecheckslice
function
#
func typecheckslice(l []ir.Node, top int)
typekind
function
#
func typekind(t *types.Type) string
visible
function
#
visible reports whether sym is exported or locally defined.
func visible(sym *types.Sym) bool