ir

Imports

Imports #

"cmd/compile/internal/types"
"cmd/compile/internal/base"
"cmd/compile/internal/types"
"cmd/internal/src"
"cmd/compile/internal/base"
"cmd/internal/obj"
"go/constant"
"math"
"math/big"
"cmd/compile/internal/base"
"cmd/compile/internal/types"
"cmd/internal/src"
"cmd/internal/src"
"fmt"
"io"
"os"
"reflect"
"regexp"
"cmd/compile/internal/base"
"cmd/compile/internal/types"
"cmd/internal/src"
"bytes"
"fmt"
"go/constant"
"io"
"os"
"path/filepath"
"reflect"
"strings"
"unicode/utf8"
"cmd/compile/internal/base"
"cmd/compile/internal/types"
"cmd/internal/src"
"cmd/compile/internal/types"
"cmd/internal/src"
"fmt"
"go/constant"
"cmd/compile/internal/base"
"cmd/compile/internal/types"
"cmd/internal/obj"
"strconv"
"fmt"
"go/constant"
"cmd/compile/internal/base"
"cmd/compile/internal/types"
"cmd/internal/src"
"fmt"
"strconv"
"cmd/compile/internal/base"
"cmd/internal/src"
"fmt"
"path/filepath"
"strings"
"go/constant"
"cmd/compile/internal/base"
"cmd/compile/internal/types"
"cmd/compile/internal/base"
"cmd/compile/internal/types"
"cmd/internal/obj"
"cmd/internal/src"
"go/constant"
"bytes"
"cmd/compile/internal/base"
"cmd/compile/internal/types"
"cmd/internal/obj"
"cmd/internal/src"
"fmt"
"go/constant"
"go/token"
"cmd/compile/internal/base"
"cmd/compile/internal/types"
"cmd/internal/obj"
"cmd/internal/objabi"
"cmd/internal/src"
"fmt"
"strings"
"unicode/utf8"
"cmd/compile/internal/base"
"cmd/compile/internal/types"
"cmd/internal/obj"
"cmd/internal/objabi"
"cmd/internal/src"
"fmt"
"go/constant"

Constants & Variables

BlankNode var #

var BlankNode *Name

CgoUnsafeArgs const #

const CgoUnsafeArgs

ConstPrec const #

Maximum size in bits for big.Ints before signaling overflow and also mantissa precision for big.Floats.

const ConstPrec = 512

CurFunc var #

var CurFunc *Func

EscFmt var #

EscFmt is set by the escape analysis code to add escape analysis details to the node print.

var EscFmt func(n Node) string

EscHeap const #

const EscHeap

EscNever const #

const EscNever

EscNone const #

const EscNone

EscUnknown const #

const EscUnknown = iota

GoBuildPragma const #

Go command pragmas

const GoBuildPragma

IsIntrinsicCall var #

IsIntrinsicCall reports whether the compiler back end will treat the call as an intrinsic operation.

var IsIntrinsicCall = *ast.FuncLit

MaxImplicitStackVarSize var #

MaxImplicitStackVarSize is the maximum size of implicit variables that we will allocate on the stack. p := new(T) allocating T on the stack p := &T{} allocating T on the stack s := make([]T, n) allocating [n]T on the stack s := []byte("...") allocating [n]byte on the stack Note: the flag smallframes can update this value.

var MaxImplicitStackVarSize = *ast.CallExpr

MaxSmallArraySize var #

MaxSmallArraySize is the maximum size of an array which is considered small. Small arrays will be initialized directly with a sequence of constant stores. Large arrays will be initialized by copying from a static temp. 256 bytes was chosen to minimize generated code + statictmp size.

var MaxSmallArraySize = *ast.CallExpr

MaxStackVarSize var #

MaxStackVarSize is the maximum size variable which we will allocate on the stack. This limit is for explicit variable declarations like "var x T" or "x := ...". Note: the flag smallframes can update this value.

var MaxStackVarSize = *ast.CallExpr

NoCheckPtr const #

const NoCheckPtr

Noescape const #

const Noescape

Noinline const #

const Noinline

Nointerface const #

Func pragmas.

const Nointerface PragmaFlag = *ast.BinaryExpr

Norace const #

const Norace

Nosplit const #

const Nosplit

Nowritebarrier const #

const Nowritebarrier

Nowritebarrierrec const #

const Nowritebarrierrec

OADD const #

expressions

const OADD

OADDR const #

Node ops.

const OADDR

OADDSTR const #

Node ops.

const OADDSTR

OAND const #

Node ops.

const OAND

OANDAND const #

Node ops.

const OANDAND

OANDNOT const #

Node ops.

const OANDNOT

OAPPEND const #

Node ops.

const OAPPEND

OARRAYLIT const #

Node ops.

const OARRAYLIT

OAS const #

X = Y or (if Def=true) X := Y If Def, then Init includes a DCL node for X.

const OAS

OAS2 const #

Lhs = Rhs (x, y, z = a, b, c) or (if Def=true) Lhs := Rhs If Def, then Init includes DCL nodes for Lhs

const OAS2

OAS2DOTTYPE const #

Node ops.

const OAS2DOTTYPE

OAS2FUNC const #

Node ops.

const OAS2FUNC

OAS2MAPR const #

Node ops.

const OAS2MAPR

OAS2RECV const #

Node ops.

const OAS2RECV

OASOP const #

Node ops.

const OASOP

OBITNOT const #

Node ops.

const OBITNOT

OBLOCK const #

statements

const OBLOCK

OBREAK const #

Node ops.

const OBREAK

OBYTES2STR const #

Node ops.

const OBYTES2STR

OBYTES2STRTMP const #

Node ops.

const OBYTES2STRTMP

OCALL const #

Node ops.

const OCALL

OCALLFUNC const #

OCALLFUNC, OCALLMETH, and OCALLINTER have the same structure. Prior to walk, they are: X(Args), where Args is all regular arguments. After walk, if any argument whose evaluation might requires temporary variable, that temporary variable will be pushed to Init, Args will contain an updated set of arguments.

const OCALLFUNC

OCALLINTER const #

Node ops.

const OCALLINTER

OCALLMETH const #

Node ops.

const OCALLMETH

OCAP const #

Node ops.

const OCAP

OCASE const #

OCASE: case List: Body (List==nil means default) For OTYPESW, List is a OTYPE node for the specified type (or OLITERAL for nil) or an ODYNAMICTYPE indicating a runtime type for generics. If a type-switch variable is specified, Var is an ONAME for the version of the type-switch variable with the specified type.

const OCASE

OCFUNC const #

Node ops.

const OCFUNC

OCHECKNIL const #

Node ops.

const OCHECKNIL

OCLEAR const #

Node ops.

const OCLEAR

OCLOSE const #

Node ops.

const OCLOSE

OCLOSURE const #

Node ops.

const OCLOSURE

OCOMPLEX const #

Node ops.

const OCOMPLEX

OCOMPLIT const #

Node ops.

const OCOMPLIT

OCONTINUE const #

Node ops.

const OCONTINUE

OCONV const #

Node ops.

const OCONV

OCONVIFACE const #

Node ops.

const OCONVIFACE

OCONVNOP const #

Node ops.

const OCONVNOP

OCOPY const #

Node ops.

const OCOPY

ODCL const #

Node ops.

const ODCL

ODCLFUNC const #

Used during parsing but don't last.

const ODCLFUNC

ODEFER const #

Node ops.

const ODEFER

ODELETE const #

Node ops.

const ODELETE

ODEREF const #

Node ops.

const ODEREF

ODIV const #

Node ops.

const ODIV

ODOT const #

Node ops.

const ODOT

ODOTINTER const #

Node ops.

const ODOTINTER

ODOTMETH const #

Node ops.

const ODOTMETH

ODOTPTR const #

Node ops.

const ODOTPTR

ODOTTYPE const #

Node ops.

const ODOTTYPE

ODOTTYPE2 const #

Node ops.

const ODOTTYPE2

ODYNAMICDOTTYPE const #

opcodes for generics

const ODYNAMICDOTTYPE

ODYNAMICDOTTYPE2 const #

Node ops.

const ODYNAMICDOTTYPE2

ODYNAMICTYPE const #

Node ops.

const ODYNAMICTYPE

OEND const #

Node ops.

const OEND

OEQ const #

Node ops.

const OEQ

OFALL const #

Node ops.

const OFALL

OFOR const #

Node ops.

const OFOR

OGE const #

Node ops.

const OGE

OGETCALLERSP const #

Node ops.

const OGETCALLERSP

OGETG const #

Node ops.

const OGETG

OGO const #

Node ops.

const OGO

OGOTO const #

Node ops.

const OGOTO

OGT const #

Node ops.

const OGT

OIDATA const #

Node ops.

const OIDATA

OIF const #

Node ops.

const OIF

OIMAG const #

Node ops.

const OIMAG

OINDEX const #

Node ops.

const OINDEX

OINDEXMAP const #

Node ops.

const OINDEXMAP

OINLCALL const #

misc intermediate representation of an inlined call. Uses Init (assignments for the captured variables, parameters, retvars, & INLMARK op), Body (body of the inlined function), and ReturnVars (list of return values)

const OINLCALL

OINLMARK const #

Node ops.

const OINLMARK

OINTERFACESWITCH const #

Node ops.

const OINTERFACESWITCH

OITAB const #

Node ops.

const OITAB

OJUMPTABLE const #

Node ops.

const OJUMPTABLE

OKEY const #

Node ops.

const OKEY

OKForConst var #

var OKForConst [types.NTYPE]bool

OLABEL const #

Node ops.

const OLABEL

OLE const #

Node ops.

const OLE

OLEN const #

Node ops.

const OLEN

OLINKSYMOFFSET const #

Node ops.

const OLINKSYMOFFSET

OLITERAL const #

Node ops.

const OLITERAL

OLSH const #

Node ops.

const OLSH

OLT const #

Node ops.

const OLT

OMAKE const #

Node ops.

const OMAKE

OMAKECHAN const #

Node ops.

const OMAKECHAN

OMAKEFACE const #

Node ops.

const OMAKEFACE

OMAKEMAP const #

Node ops.

const OMAKEMAP

OMAKESLICE const #

Node ops.

const OMAKESLICE

OMAKESLICECOPY const #

Node ops.

const OMAKESLICECOPY

OMAPLIT const #

Node ops.

const OMAPLIT

OMAX const #

Node ops.

const OMAX

OMETHEXPR const #

Node ops.

const OMETHEXPR

OMETHVALUE const #

Node ops.

const OMETHVALUE

OMIN const #

Node ops.

const OMIN

OMOD const #

Node ops.

const OMOD

OMUL const #

OMAKESLICECOPY is created by the order pass and corresponds to: s = make(Type, Len); copy(s, Cap) Bounded can be set on the node when Len == len(Cap) is known at compile time. This node is created so the walk pass can optimize this pattern which would otherwise be hard to detect after the order pass.

const OMUL

ONAME const #

names

const ONAME

ONE const #

Node ops.

const ONE

ONEG const #

Node ops.

const ONEG

ONEW const #

Node ops.

const ONEW

ONIL const #

Node ops.

const ONIL

ONONAME const #

Unnamed arg or return value: f(int, string) (int, error) { etc } Also used for a qualified package identifier that hasn't been resolved yet.

const ONONAME

ONOT const #

Node ops.

const ONOT

OOR const #

Node ops.

const OOR

OOROR const #

Node ops.

const OOROR

OPANIC const #

Node ops.

const OPANIC

OPAREN const #

Node ops.

const OPAREN

OPLUS const #

Node ops.

const OPLUS

OPRINT const #

Node ops.

const OPRINT

OPRINTLN const #

Node ops.

const OPRINTLN

OPTRLIT const #

Node ops.

const OPTRLIT

ORANGE const #

Node ops.

const ORANGE

OREAL const #

Node ops.

const OREAL

ORECOVER const #

Node ops.

const ORECOVER

ORECOVERFP const #

Node ops.

const ORECOVERFP

ORECV const #

Node ops.

const ORECV

ORESULT const #

Node ops.

const ORESULT

ORETURN const #

Node ops.

const ORETURN

ORSH const #

Node ops.

const ORSH

ORUNES2STR const #

Node ops.

const ORUNES2STR

ORUNESTR const #

Node ops.

const ORUNESTR

OSELECT const #

Node ops.

const OSELECT

OSELRECV2 const #

Node ops.

const OSELRECV2

OSEND const #

Node ops.

const OSEND

OSLICE const #

Node ops.

const OSLICE

OSLICE2ARR const #

Node ops.

const OSLICE2ARR

OSLICE2ARRPTR const #

Node ops.

const OSLICE2ARRPTR

OSLICE3 const #

Node ops.

const OSLICE3

OSLICE3ARR const #

Node ops.

const OSLICE3ARR

OSLICEARR const #

Node ops.

const OSLICEARR

OSLICEHEADER const #

Node ops.

const OSLICEHEADER

OSLICELIT const #

Node ops.

const OSLICELIT

OSLICESTR const #

Node ops.

const OSLICESTR

OSPTR const #

Node ops.

const OSPTR

OSTR2BYTES const #

Node ops.

const OSTR2BYTES

OSTR2BYTESTMP const #

Node ops.

const OSTR2BYTESTMP

OSTR2RUNES const #

Node ops.

const OSTR2RUNES

OSTRINGHEADER const #

Node ops.

const OSTRINGHEADER

OSTRUCTKEY const #

Node ops.

const OSTRUCTKEY

OSTRUCTLIT const #

Node ops.

const OSTRUCTLIT

OSUB const #

Node ops.

const OSUB

OSWITCH const #

Node ops.

const OSWITCH

OTAILCALL const #

arch-specific opcodes

const OTAILCALL

OTYPE const #

Node ops.

const OTYPE

OTYPESW const #

OTYPESW: X := Y.(type) (appears as .Tag of OSWITCH) X is nil if there is no type-switch variable

const OTYPESW

OUNSAFEADD const #

Node ops.

const OUNSAFEADD

OUNSAFESLICE const #

Node ops.

const OUNSAFESLICE

OUNSAFESLICEDATA const #

Node ops.

const OUNSAFESLICEDATA

OUNSAFESTRING const #

Node ops.

const OUNSAFESTRING

OUNSAFESTRINGDATA const #

Node ops.

const OUNSAFESTRINGDATA

OXDOT const #

Node ops.

const OXDOT

OXOR const #

Node ops.

const OXOR

OXXX const #

Node ops.

const OXXX Op = iota

OpNames var #

var OpNames = []string{...}

OpPrec var #

var OpPrec = []int{...}

PAUTO const #

go:generate stringer -type=Class name.go

const PAUTO

PAUTOHEAP const #

go:generate stringer -type=Class name.go

const PAUTOHEAP

PEXTERN const #

go:generate stringer -type=Class name.go

const PEXTERN

PFUNC const #

go:generate stringer -type=Class name.go

const PFUNC

PPARAM const #

go:generate stringer -type=Class name.go

const PPARAM

PPARAMOUT const #

go:generate stringer -type=Class name.go

const PPARAMOUT

PTYPEPARAM const #

go:generate stringer -type=Class name.go

const PTYPEPARAM

Pkgs var #

Pkgs holds known packages.

var Pkgs struct{...}

Pxxx const #

go:generate stringer -type=Class name.go

const Pxxx Class = iota

RegisterParams const #

const RegisterParams

Syms var #

Syms holds known symbols.

var Syms symsStruct

Systemstack const #

Runtime-only func pragmas. See ../../../../runtime/HACKING.md for detailed descriptions.

const Systemstack

UintptrEscapes const #

const UintptrEscapes

UintptrKeepAlive const #

const UintptrKeepAlive

Yeswritebarrierrec const #

const Yeswritebarrierrec

_ const #

Careful: Class is stored in three bits in Node.flags.

const _ = *ast.CallExpr

_Class_index var #

var _Class_index = [...]uint8{...}

_Class_name const #

const _Class_name = "PxxxPEXTERNPAUTOPAUTOHEAPPPARAMPPARAMOUTPTYPEPARAMPFUNC"

_Op_index var #

var _Op_index = [...]uint16{...}

_Op_name const #

const _Op_name = "XXXNAMENONAMETYPELITERALNILADDSUBORXORADDSTRADDRANDANDAPPENDBYTES2STRBYTES2STRTMPRUNES2STRSTR2BYTESSTR2BYTESTMPSTR2RUNESSLICE2ARRSLICE2ARRPTRASAS2AS2DOTTYPEAS2FUNCAS2MAPRAS2RECVASOPCALLCALLFUNCCALLMETHCALLINTERCAPCLEARCLOSECLOSURECOMPLITMAPLITSTRUCTLITARRAYLITSLICELITPTRLITCONVCONVIFACECONVNOPCOPYDCLDCLFUNCDELETEDOTDOTPTRDOTMETHDOTINTERXDOTDOTTYPEDOTTYPE2EQNELTLEGEGTDEREFINDEXINDEXMAPKEYSTRUCTKEYLENMAKEMAKECHANMAKEMAPMAKESLICEMAKESLICECOPYMULDIVMODLSHRSHANDANDNOTNEWNOTBITNOTPLUSNEGORORPANICPRINTPRINTLNPARENSENDSLICESLICEARRSLICESTRSLICE3SLICE3ARRSLICEHEADERSTRINGHEADERRECOVERRECOVERFPRECVRUNESTRSELRECV2MINMAXREALIMAGCOMPLEXUNSAFEADDUNSAFESLICEUNSAFESLICEDATAUNSAFESTRINGUNSAFESTRINGDATAMETHEXPRMETHVALUEBLOCKBREAKCASECONTINUEDEFERFALLFORGOTOIFLABELGORANGERETURNSELECTSWITCHTYPESWINLCALLMAKEFACEITABIDATASPTRCFUNCCHECKNILRESULTINLMARKLINKSYMOFFSETJUMPTABLEINTERFACESWITCHDYNAMICDOTTYPEDYNAMICDOTTYPE2DYNAMICTYPETAILCALLGETGGETCALLERSPEND"

complexOne var #

var complexOne = *ast.CallExpr

complexZero var #

var complexZero = *ast.CallExpr

consistencyCheckEnabled const #

const consistencyCheckEnabled = true

consistencyCheckEnabled const #

const consistencyCheckEnabled = false

floatOne var #

var floatOne = *ast.CallExpr

floatZero var #

var floatZero = *ast.CallExpr

funcABIWrapper const #

const funcABIWrapper

funcClosureResultsLost const #

const funcClosureResultsLost

funcDupok const #

const funcDupok = *ast.BinaryExpr

funcHasDefer const #

const funcHasDefer

funcInlinabilityChecked const #

const funcInlinabilityChecked

funcNeedctxt const #

const funcNeedctxt

funcNeverReturns const #

const funcNeverReturns

funcNilCheckDisabled const #

const funcNilCheckDisabled

funcOpenCodedDeferDisallowed const #

const funcOpenCodedDeferDisallowed

funcPackageInit const #

const funcPackageInit

funcWrapper const #

const funcWrapper

globClosgen var #

globClosgen is like Func.Closgen, but for the global scope.

var globClosgen int32

indentBytes var #

var indentBytes = *ast.CallExpr

intOne var #

var intOne = *ast.CallExpr

intZero var #

var intZero = *ast.CallExpr

miniExprBounded const #

const miniExprBounded

miniExprCheckPtr const #

const miniExprCheckPtr

miniExprImplicit const #

const miniExprImplicit

miniExprNonNil const #

const miniExprNonNil = *ast.BinaryExpr

miniExprTransient const #

const miniExprTransient

miniTypecheckShift const #

const miniTypecheckShift = 0

miniWalked const #

const miniWalked = *ast.BinaryExpr

nameAddrtaken const #

const nameAddrtaken

nameAlias const #

const nameAlias

nameAutoTemp const #

const nameAutoTemp

nameByval const #

const nameByval

nameCoverageAuxVar const #

const nameCoverageAuxVar

nameInlFormal const #

const nameInlFormal

nameInlLocal const #

const nameInlLocal

nameIsClosureVar const #

const nameIsClosureVar

nameIsOutputParamHeapAddr const #

const nameIsOutputParamHeapAddr

nameIsOutputParamInRegisters const #

const nameIsOutputParamInRegisters

nameLibfuzzer8BitCounter const #

const nameLibfuzzer8BitCounter

nameNeedzero const #

const nameNeedzero

nameNonMergeable const #

const nameNonMergeable

nameOpenDeferSlot const #

const nameOpenDeferSlot

nameReadonly const #

const nameReadonly = *ast.BinaryExpr

nameUsed const #

const nameUsed

nodeType var #

var nodeType = *ast.CallExpr

Type Aliases

Class type #

The Class of a variable/function describes the "storage class" of a variable or function. During parsing, storage classes are called declaration contexts.

type Class uint8

NameSet type #

NameSet is a set of Names.

type NameSet map[*Name]struct{...}

Nodes type #

Nodes is a slice of Node.

type Nodes []Node

Op type #

type Op uint8

PragmaFlag type #

type PragmaFlag uint16

ScopeID type #

A ScopeID represents a lexical scope within a function.

type ScopeID int32

bitset16 type #

type bitset16 uint16

bitset8 type #

type bitset8 uint8

Interfaces

Expr interface #

An Expr is a Node that can appear as an expression.

type Expr interface {
Node
isExpr()
}

InitNode interface #

type InitNode interface {
Node
PtrInit() *Nodes
SetInit(x Nodes)
}

Node interface #

A Node is the abstract interface to an IR node.

type Node interface {
Format(s fmt.State, verb rune)
Pos() src.XPos
SetPos(x src.XPos)
copy() Node
doChildren(func(Node) bool) bool
doChildrenWithHidden(func(Node) bool) bool
editChildren(func(Node) Node)
editChildrenWithHidden(func(Node) Node)
Op() Op
Init() Nodes
Type() *types.Type
SetType(t *types.Type)
Name() *Name
Sym() *types.Sym
Val() constant.Value
SetVal(v constant.Value)
Esc() uint16
SetEsc(x uint16)
Typecheck() uint8
SetTypecheck(x uint8)
NonNil() bool
MarkNonNil()
}

Stmt interface #

A Stmt is a Node that can appear as a statement. This includes statement-like expressions such as f(). (It's possible it should include <-c, but that would require splitting ORECV out of UnaryExpr, which hasn't yet been necessary. Maybe instead we will introduce ExprStmt at some point.)

type Stmt interface {
Node
isStmt()
}

Structs

AddStringExpr struct #

An AddStringExpr is a string concatenation List[0] + List[1] + ... + List[len(List)-1].

type AddStringExpr struct {
miniExpr
List Nodes
Prealloc *Name
}

AddrExpr struct #

An AddrExpr is an address-of expression &X. It may end up being a normal address-of or an allocation of a composite literal.

type AddrExpr struct {
miniExpr
X Node
Prealloc *Name
}

AssignListStmt struct #

An AssignListStmt is an assignment statement with more than one item on at least one side: Lhs = Rhs. If Def is true, the assignment is a :=.

type AssignListStmt struct {
miniStmt
Lhs Nodes
Def bool
Rhs Nodes
}

AssignOpStmt struct #

An AssignOpStmt is an AsOp= assignment statement: X AsOp= Y.

type AssignOpStmt struct {
miniStmt
X Node
AsOp Op
Y Node
IncDec bool
}

AssignStmt struct #

An AssignStmt is a simple assignment statement: X = Y. If Def is true, the assignment is a :=.

type AssignStmt struct {
miniStmt
X Node
Def bool
Y Node
}

BasicLit struct #

A BasicLit is a literal of basic type.

type BasicLit struct {
miniExpr
val constant.Value
}

BinaryExpr struct #

A BinaryExpr is a binary expression X Op Y, or Op(X, Y) for builtin functions that do not become calls.

type BinaryExpr struct {
miniExpr
X Node
Y Node
RType Node `mknode:"-"`
}

BlockStmt struct #

A BlockStmt is a block: { List }.

type BlockStmt struct {
miniStmt
List Nodes
}

BranchStmt struct #

A BranchStmt is a break, continue, fallthrough, or goto statement.

type BranchStmt struct {
miniStmt
Label *types.Sym
}

CallExpr struct #

A CallExpr is a function call Fun(Args).

type CallExpr struct {
miniExpr
Fun Node
Args Nodes
DeferAt Node
RType Node `mknode:"-"`
KeepAlive []*Name
IsDDD bool
GoDefer bool
NoInline bool
}

CaseClause struct #

A CaseClause is a case statement in a switch or select: case List: Body.

type CaseClause struct {
miniStmt
Var *Name
List Nodes
RTypes Nodes
Body Nodes
}

ClosureExpr struct #

A ClosureExpr is a function literal expression.

type ClosureExpr struct {
miniExpr
Func *Func `mknode:"-"`
Prealloc *Name
IsGoWrap bool
}

CommClause struct #

type CommClause struct {
miniStmt
Comm Node
Body Nodes
}

CompLitExpr struct #

A CompLitExpr is a composite literal Type{Vals}. Before type-checking, the type is Ntype.

type CompLitExpr struct {
miniExpr
List Nodes
RType Node `mknode:"-"`
Prealloc *Name
Len int64
}

ConvExpr struct #

A ConvExpr is a conversion Type(X). It may end up being a value or a type.

type ConvExpr struct {
miniExpr
X Node
TypeWord Node `mknode:"-"`
SrcRType Node `mknode:"-"`
ElemRType Node `mknode:"-"`
ElemElemRType Node `mknode:"-"`
}

Decl struct #

A Decl is a declaration of a const, type, or var. (A declared func is a Func.)

type Decl struct {
miniNode
X *Name
}

DynamicType struct #

A DynamicType represents a type expression whose exact type must be computed dynamically.

type DynamicType struct {
miniExpr
RType Node
ITab Node
}

DynamicTypeAssertExpr struct #

A DynamicTypeAssertExpr asserts that X is of dynamic type RType.

type DynamicTypeAssertExpr struct {
miniExpr
X Node
SrcRType Node
RType Node
ITab Node
}

Embed struct #

type Embed struct {
Pos src.XPos
Patterns []string
}

ForStmt struct #

A ForStmt is a non-range for loop: for Init; Cond; Post { Body }

type ForStmt struct {
miniStmt
Label *types.Sym
Cond Node
Post Node
Body Nodes
DistinctVars bool
}

Func struct #

A Func corresponds to a single function in a Go program (and vice versa: each function is denoted by exactly one *Func). There are multiple nodes that represent a Func in the IR. The ONAME node (Func.Nname) is used for plain references to it. The ODCLFUNC node (the Func itself) is used for its declaration code. The OCLOSURE node (Func.OClosure) is used for a reference to a function literal. An imported function will have an ONAME node which points to a Func with an empty body. A declared function or method has an ODCLFUNC (the Func itself) and an ONAME. A function literal is represented directly by an OCLOSURE, but it also has an ODCLFUNC (and a matching ONAME) representing the compiled underlying form of the closure, which accesses the captured variables using a special data structure passed in a register. A method declaration is represented like functions, except f.Sym will be the qualified method name (e.g., "T.m"). A method expression (T.M) is represented as an OMETHEXPR node, in which n.Left and n.Right point to the type and method, respectively. Each distinct mention of a method expression in the source code constructs a fresh node. A method value (t.M) is represented by ODOTMETH/ODOTINTER when it is called directly and by OMETHVALUE otherwise. These are like method expressions, except that for ODOTMETH/ODOTINTER, the method name is stored in Sym instead of Right. Each OMETHVALUE ends up being implemented as a new function, a bit like a closure, with its own ODCLFUNC. The OMETHVALUE uses n.Func to record the linkage to the generated ODCLFUNC, but there is no pointer from the Func back to the OMETHVALUE.

type Func struct {
miniNode
Body Nodes
Nname *Name
OClosure *ClosureExpr
Dcl []*Name
ClosureVars []*Name
Closures []*Func
ClosureParent *Func
Parents []ScopeID
Marks []Mark
FieldTrack map[*obj.LSym]struct{...}
DebugInfo interface{}
LSym *obj.LSym
Inl *Inline
RangeParent *Func
funcLitGen int32
rangeLitGen int32
goDeferGen int32
Label int32
Endlineno src.XPos
WBPos src.XPos
Pragma PragmaFlag
flags bitset16
ABI obj.ABI
ABIRefs obj.ABISet
NumDefers int32
NumReturns int32
NWBRCalls *[]SymAndPos
WrappedFunc *Func
WasmImport *WasmImport
WasmExport *WasmExport
}

GoDeferStmt struct #

A GoDeferStmt is a go or defer statement: go Call / defer Call. The two opcodes use a single syntax because the implementations are very similar: both are concerned with saving Call and running it in a different context (a separate goroutine or a later time).

type GoDeferStmt struct {
miniStmt
Call Node
DeferAt Expr
}

Ident struct #

An Ident is an identifier, possibly qualified.

type Ident struct {
miniExpr
sym *types.Sym
}

IfStmt struct #

An IfStmt is a return statement: if Init; Cond { Body } else { Else }.

type IfStmt struct {
miniStmt
Cond Node
Body Nodes
Else Nodes
Likely bool
}

IndexExpr struct #

An IndexExpr is an index expression X[Index].

type IndexExpr struct {
miniExpr
X Node
Index Node
RType Node `mknode:"-"`
Assigned bool
}

Inline struct #

An Inline holds fields used for function bodies that can be inlined.

type Inline struct {
Cost int32
Dcl []*Name
HaveDcl bool
Properties string
CanDelayResults bool
}

InlineMarkStmt struct #

An InlineMarkStmt is a marker placed just before an inlined body.

type InlineMarkStmt struct {
miniStmt
Index int64
}

InlinedCallExpr struct #

An InlinedCallExpr is an inlined function call.

type InlinedCallExpr struct {
miniExpr
Body Nodes
ReturnVars Nodes
}

InterfaceSwitchStmt struct #

An InterfaceSwitchStmt is used to implement type switches. Its semantics are: if RuntimeType implements Descriptor.Cases[0] { Case, Itab = 0, itab } else if RuntimeType implements Descriptor.Cases[1] { Case, Itab = 1, itab ... } else if RuntimeType implements Descriptor.Cases[N-1] { Case, Itab = N-1, itab } else { Case, Itab = len(cases), nil } RuntimeType must be a non-nil *runtime._type. Hash must be the hash field of RuntimeType (or its copy loaded from an itab). Descriptor must represent an abi.InterfaceSwitch global variable.

type InterfaceSwitchStmt struct {
miniStmt
Case Node
Itab Node
RuntimeType Node
Hash Node
Descriptor *obj.LSym
}

JumpTableStmt struct #

A JumpTableStmt is used to implement switches. Its semantics are: tmp := jt.Idx if tmp == Cases[0] goto Targets[0] if tmp == Cases[1] goto Targets[1] ... if tmp == Cases[n] goto Targets[n] Note that a JumpTableStmt is more like a multiway-goto than a multiway-if. In particular, the case bodies are just labels to jump to, not full Nodes lists.

type JumpTableStmt struct {
miniStmt
Idx Node
Cases []constant.Value
Targets []*types.Sym
}

KeyExpr struct #

A KeyExpr is a Key: Value composite literal key.

type KeyExpr struct {
miniExpr
Key Node
Value Node
}

LabelStmt struct #

A LabelStmt is a label statement (just the label, not including the statement it labels).

type LabelStmt struct {
miniStmt
Label *types.Sym
}

LinksymOffsetExpr struct #

A LinksymOffsetExpr refers to an offset within a global variable. It is like a SelectorExpr but without the field name.

type LinksymOffsetExpr struct {
miniExpr
Linksym *obj.LSym
Offset_ int64
}

LogicalExpr struct #

A LogicalExpr is an expression X Op Y where Op is && or ||. It is separate from BinaryExpr to make room for statements that must be executed before Y but after X.

type LogicalExpr struct {
miniExpr
X Node
Y Node
}

MakeExpr struct #

A MakeExpr is a make expression: make(Type[, Len[, Cap]]). Op is OMAKECHAN, OMAKEMAP, OMAKESLICE, or OMAKESLICECOPY, but *not* OMAKE (that's a pre-typechecking CallExpr).

type MakeExpr struct {
miniExpr
RType Node `mknode:"-"`
Len Node
Cap Node
}

Mark struct #

A Mark represents a scope boundary.

type Mark struct {
Pos src.XPos
Scope ScopeID
}

Name struct #

Name holds Node fields used only by named nodes (ONAME, OTYPE, some OLITERAL).

type Name struct {
miniExpr
BuiltinOp Op
Class Class
pragma PragmaFlag
flags bitset16
DictIndex uint16
sym *types.Sym
Func *Func
Offset_ int64
val constant.Value
Opt interface{}
Embed *[]Embed
Defn Node
Curfn *Func
Heapaddr *Name
Outer *Name
}

NameQueue struct #

NameQueue is a FIFO queue of *Name. The zero value of NameQueue is a ready-to-use empty queue.

type NameQueue struct {
ring []*Name
head int
tail int
}

NilExpr struct #

A NilExpr represents the predefined untyped constant nil.

type NilExpr struct {
miniExpr
}

Package struct #

A Package holds information about the package being compiled.

type Package struct {
Imports []*types.Pkg
Inits []*Func
Funcs []*Func
Externs []*Name
AsmHdrDecls []*Name
CgoPragmas [][]string
Embeds []*Name
PluginExports []*Name
}

ParenExpr struct #

A ParenExpr is a parenthesized expression (X). It may end up being a value or a type.

type ParenExpr struct {
miniExpr
X Node
}

RangeStmt struct #

A RangeStmt is a range loop: for Key, Value = range X { Body }

type RangeStmt struct {
miniStmt
Label *types.Sym
Def bool
X Node
RType Node `mknode:"-"`
Key Node
Value Node
Body Nodes
DistinctVars bool
Prealloc *Name
KeyTypeWord Node `mknode:"-"`
KeySrcRType Node `mknode:"-"`
ValueTypeWord Node `mknode:"-"`
ValueSrcRType Node `mknode:"-"`
}

ReassignOracle struct #

A ReassignOracle efficiently answers queries about whether local variables are reassigned. This helper works by looking for function params and short variable declarations (e.g. https://go.dev/ref/spec#Short_variable_declarations) that are neither address taken nor subsequently re-assigned. It is intended to operate much like "ir.StaticValue" and "ir.Reassigned", but in a way that does just a single walk of the containing function (as opposed to a new walk on every call).

type ReassignOracle struct {
fn *Func
singleDef map[*Name]Node
}

ResultExpr struct #

A ResultExpr represents a direct access to a result.

type ResultExpr struct {
miniExpr
Index int64
}

ReturnStmt struct #

A ReturnStmt is a return statement.

type ReturnStmt struct {
miniStmt
Results Nodes
}

SelectStmt struct #

A SelectStmt is a block: { Cases }.

type SelectStmt struct {
miniStmt
Label *types.Sym
Cases []*CommClause
Compiled Nodes
}

SelectorExpr struct #

A SelectorExpr is a selector expression X.Sel.

type SelectorExpr struct {
miniExpr
X Node
Sel *types.Sym
Selection *types.Field
Prealloc *Name
}

SendStmt struct #

A SendStmt is a send statement: X <- Y.

type SendStmt struct {
miniStmt
Chan Node
Value Node
}

SliceExpr struct #

A SliceExpr is a slice expression X[Low:High] or X[Low:High:Max].

type SliceExpr struct {
miniExpr
X Node
Low Node
High Node
Max Node
}

SliceHeaderExpr struct #

A SliceHeader expression constructs a slice header from its parts.

type SliceHeaderExpr struct {
miniExpr
Ptr Node
Len Node
Cap Node
}

StarExpr struct #

A StarExpr is a dereference expression *X. It may end up being a value or a type.

type StarExpr struct {
miniExpr
X Node
}

StringHeaderExpr struct #

A StringHeaderExpr expression constructs a string header from its parts.

type StringHeaderExpr struct {
miniExpr
Ptr Node
Len Node
}

StructKeyExpr struct #

A StructKeyExpr is a Field: Value composite literal key.

type StructKeyExpr struct {
miniExpr
Field *types.Field
Value Node
}

SwitchStmt struct #

A SwitchStmt is a switch statement: switch Init; Tag { Cases }.

type SwitchStmt struct {
miniStmt
Tag Node
Cases []*CaseClause
Label *types.Sym
Compiled Nodes
}

SymAndPos struct #

type SymAndPos struct {
Sym *obj.LSym
Pos src.XPos
}

TailCallStmt struct #

A TailCallStmt is a tail call statement, which is used for back-end code generation to jump directly to another function entirely.

type TailCallStmt struct {
miniStmt
Call *CallExpr
}

TypeAssertExpr struct #

A TypeAssertionExpr is a selector expression X.(Type). Before type-checking, the type is Ntype.

type TypeAssertExpr struct {
miniExpr
X Node
ITab Node `mknode:"-"`
Descriptor *obj.LSym
}

TypeSwitchGuard struct #

A TypeSwitchGuard is the [Name :=] X.(type) in a type switch.

type TypeSwitchGuard struct {
miniNode
Tag *Ident
X Node
Used bool
}

UnaryExpr struct #

A UnaryExpr is a unary expression Op X, or Op(X) for a builtin function that does not end up being a call.

type UnaryExpr struct {
miniExpr
X Node
}

WasmExport struct #

WasmExport stores metadata associated with the //go:wasmexport pragma.

type WasmExport struct {
Name string
}

WasmImport struct #

WasmImport stores metadata associated with the //go:wasmimport pragma.

type WasmImport struct {
Module string
Name string
}

bottomUpVisitor struct #

type bottomUpVisitor struct {
analyze func([]*Func, bool)
visitgen uint32
nodeID map[*Func]uint32
stack []*Func
}

dumper struct #

type dumper struct {
output io.Writer
fieldrx *regexp.Regexp
ptrmap map[uintptr]int
lastadr string
indent int
last byte
line int
}

miniExpr struct #

A miniExpr is a miniNode with extra fields common to expressions. TODO(rsc): Once we are sure about the contents, compact the bools into a bit field and leave extra bits available for implementations embedding miniExpr. Right now there are ~60 unused bits sitting here.

type miniExpr struct {
miniNode
typ *types.Type
init Nodes
flags bitset8
}

miniNode struct #

A miniNode is a minimal node implementation, meant to be embedded as the first field in a larger node implementation, at a cost of 8 bytes. A miniNode is NOT a valid Node by itself: the embedding struct must at the least provide: func (n *MyNode) String() string { return fmt.Sprint(n) } func (n *MyNode) rawCopy() Node { c := *n; return &c } func (n *MyNode) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) } The embedding struct should also fill in n.op in its constructor, for more useful panic messages when invalid methods are called, instead of implementing Op itself.

type miniNode struct {
pos src.XPos
op Op
bits bitset8
esc uint16
}

miniStmt struct #

A miniStmt is a miniNode with extra fields common to statements.

type miniStmt struct {
miniNode
init Nodes
}

symsStruct struct #

type symsStruct struct {
AssertE2I *obj.LSym
AssertE2I2 *obj.LSym
Asanread *obj.LSym
Asanwrite *obj.LSym
CgoCheckMemmove *obj.LSym
CgoCheckPtrWrite *obj.LSym
CheckPtrAlignment *obj.LSym
Deferproc *obj.LSym
Deferprocat *obj.LSym
DeferprocStack *obj.LSym
Deferreturn *obj.LSym
Duffcopy *obj.LSym
Duffzero *obj.LSym
GCWriteBarrier [8]*obj.LSym
Goschedguarded *obj.LSym
Growslice *obj.LSym
InterfaceSwitch *obj.LSym
Memmove *obj.LSym
Msanread *obj.LSym
Msanwrite *obj.LSym
Msanmove *obj.LSym
Newobject *obj.LSym
Newproc *obj.LSym
Panicdivide *obj.LSym
Panicshift *obj.LSym
PanicdottypeE *obj.LSym
PanicdottypeI *obj.LSym
Panicnildottype *obj.LSym
Panicoverflow *obj.LSym
Racefuncenter *obj.LSym
Racefuncexit *obj.LSym
Raceread *obj.LSym
Racereadrange *obj.LSym
Racewrite *obj.LSym
Racewriterange *obj.LSym
TypeAssert *obj.LSym
WBZero *obj.LSym
WBMove *obj.LSym
SigPanic *obj.LSym
Staticuint64s *obj.LSym
Typedmemmove *obj.LSym
Udiv *obj.LSym
WriteBarrier *obj.LSym
Zerobase *obj.LSym
ARM64HasATOMICS *obj.LSym
ARMHasVFPv4 *obj.LSym
Loong64HasLAMCAS *obj.LSym
Loong64HasLAM_BH *obj.LSym
Loong64HasLSX *obj.LSym
X86HasFMA *obj.LSym
X86HasPOPCNT *obj.LSym
X86HasSSE41 *obj.LSym
WasmDiv *obj.LSym
WasmTruncS *obj.LSym
WasmTruncU *obj.LSym
}

typeNode struct #

A typeNode is a Node wrapper for type t.

type typeNode struct {
miniNode
typ *types.Type
}

Functions

ABIWrapper method #

func (f *Func) ABIWrapper() bool

Add method #

Add adds n to s.

func (s *NameSet) Add(n *Name)

Addrtaken method #

func (n *Name) Addrtaken() bool

Alias method #

Alias reports whether p, which must be for an OTYPE, is a type alias.

func (n *Name) Alias() bool

Any function #

Any looks for a non-nil node x in the IR tree rooted at n for which cond(x) returns true. Any considers nodes in a depth-first, preorder traversal. When Any finds a node x such that cond(x) is true, Any ends the traversal and returns true immediately. Otherwise Any returns false after completing the entire traversal.

func Any(n Node, cond func(Node) bool) bool

AnyList function #

AnyList calls Any(x, cond) for each node x in the list, in order. If any call returns true, AnyList stops and returns true. Otherwise, AnyList returns false after calling Any(x, cond) for every x in the list.

func AnyList(list Nodes, cond func(Node) bool) bool

Append method #

Append appends entries to Nodes.

func (n *Nodes) Append(a ...Node)

AssertValidTypeForConst function #

func AssertValidTypeForConst(t *types.Type, v constant.Value)

AutoTemp method #

func (n *Name) AutoTemp() bool

BigFloat function #

func BigFloat(v constant.Value) *big.Float

BoolVal function #

BoolVal returns n as a bool. n must be a boolean constant.

func BoolVal(n Node) bool

Bounded method #

func (n *miniExpr) Bounded() bool

Byval method #

func (n *Name) Byval() bool

CanBeAnSSAAux method #

func (*Name) CanBeAnSSAAux()

CanBeAnSSASym method #

func (*Name) CanBeAnSSASym()

CanBeNtype method #

func (*Name) CanBeNtype()

Canonical method #

Canonical returns the logical declaration that n represents. If n is a closure variable, then Canonical returns the original Name as it appears in the function that immediately contains the declaration. Otherwise, Canonical simply returns n itself.

func (n *Name) Canonical() *Name

CheckPtr method #

func (n *ConvExpr) CheckPtr() bool

ClosureDebugRuntimeCheck function #

ClosureDebugRuntimeCheck applies boilerplate checks for debug flags and compiling runtime.

func ClosureDebugRuntimeCheck(clo *ClosureExpr)

ClosureResultsLost method #

func (f *Func) ClosureResultsLost() bool

ConstOverflow function #

ConstOverflow reports whether constant value v is too large to represent with type t.

func ConstOverflow(v constant.Value, t *types.Type) bool

ConstType function #

func ConstType(n Node) constant.Kind

Copy method #

Copy returns a copy of the content of the slice.

func (n Nodes) Copy() Nodes

Copy function #

Copy returns a shallow copy of n.

func Copy(n Node) Node

CoverageAuxVar method #

func (n *Name) CoverageAuxVar() bool

DeclareParams method #

DeclareParams creates Names for all of the parameters in fn's signature and adds them to fn.Dcl. If setNname is true, then it also sets types.Field.Nname for each parameter.

func (fn *Func) DeclareParams(setNname bool)

DeclaredBy function #

DeclaredBy reports whether expression x refers (directly) to a variable that was declared by the given statement.

func DeclaredBy(x Node, stmt Node) bool

DeepCopy function #

DeepCopy returns a “deep” copy of n, with its entire structure copied (except for shared nodes like ONAME, ONONAME, OLITERAL, and OTYPE). If pos.IsKnown(), it sets the source position of newly allocated Nodes to pos.

func DeepCopy(pos src.XPos, n Node) Node

DeepCopyList function #

DeepCopyList returns a list of deep copies (using DeepCopy) of the nodes in list.

func DeepCopyList(pos src.XPos, list []Node) []Node

DoChildren function #

DoChildren calls do(x) on each of n's non-nil child nodes x. If any call returns true, DoChildren stops and returns true. Otherwise, DoChildren returns false. Note that DoChildren(n, do) only calls do(x) for n's immediate children. If x's children should be processed, then do(x) must call DoChildren(x, do). DoChildren allows constructing general traversals of the IR graph that can stop early if needed. The most general usage is: var do func(ir.Node) bool do = func(x ir.Node) bool { ... processing BEFORE visiting children ... if ... should visit children ... { ir.DoChildren(x, do) ... processing AFTER visiting children ... } if ... should stop parent DoChildren call from visiting siblings ... { return true } return false } do(root) Since DoChildren does not return true itself, if the do function never wants to stop the traversal, it can assume that DoChildren itself will always return false, simplifying to: var do func(ir.Node) bool do = func(x ir.Node) bool { ... processing BEFORE visiting children ... if ... should visit children ... { ir.DoChildren(x, do) } ... processing AFTER visiting children ... return false } do(root) The Visit function illustrates a further simplification of the pattern, only processing before visiting children and never stopping: func Visit(n ir.Node, visit func(ir.Node)) { if n == nil { return } var do func(ir.Node) bool do = func(x ir.Node) bool { visit(x) return ir.DoChildren(x, do) } do(n) } The Any function illustrates a different simplification of the pattern, visiting each node and then its children, recursively, until finding a node x for which cond(x) returns true, at which point the entire traversal stops and returns true. func Any(n ir.Node, cond(ir.Node) bool) bool { if n == nil { return false } var do func(ir.Node) bool do = func(x ir.Node) bool { return cond(x) || ir.DoChildren(x, do) } return do(n) } Visit and Any are presented above as examples of how to use DoChildren effectively, but of course, usage that fits within the simplifications captured by Visit or Any will be best served by directly calling the ones provided by this package.

func DoChildren(n Node, do func(Node) bool) bool

DoChildrenWithHidden function #

DoChildrenWithHidden is like DoChildren, but also visits Node-typed fields tagged with `mknode:"-"`. TODO(mdempsky): Remove the `mknode:"-"` tags so this function can go away.

func DoChildrenWithHidden(n Node, do func(Node) bool) bool

Dump function #

Dump prints the message s followed by a debug dump of n.

func Dump(s string, n Node)

DumpAny function #

DumpAny is like FDumpAny but prints to stderr.

func DumpAny(root interface{}, filter string, depth int)

DumpList function #

DumpList prints the message s followed by a debug dump of each node in the list.

func DumpList(s string, list Nodes)

Dupok method #

func (f *Func) Dupok() bool

EditChildren function #

EditChildren edits the child nodes of n, replacing each child x with edit(x). Note that EditChildren(n, edit) only calls edit(x) for n's immediate children. If x's children should be processed, then edit(x) must call EditChildren(x, edit). EditChildren allows constructing general editing passes of the IR graph. The most general usage is: var edit func(ir.Node) ir.Node edit = func(x ir.Node) ir.Node { ... processing BEFORE editing children ... if ... should edit children ... { EditChildren(x, edit) ... processing AFTER editing children ... } ... return x ... } n = edit(n) EditChildren edits the node in place. To edit a copy, call Copy first. As an example, a simple deep copy implementation would be: func deepCopy(n ir.Node) ir.Node { var edit func(ir.Node) ir.Node edit = func(x ir.Node) ir.Node { x = ir.Copy(x) ir.EditChildren(x, edit) return x } return edit(n) } Of course, in this case it is better to call ir.DeepCopy than to build one anew.

func EditChildren(n Node, edit func(Node) Node)

EditChildrenWithHidden function #

EditChildrenWithHidden is like EditChildren, but also edits Node-typed fields tagged with `mknode:"-"`. TODO(mdempsky): Remove the `mknode:"-"` tags so this function can go away.

func EditChildrenWithHidden(n Node, edit func(Node) Node)

Empty method #

Empty reports whether q contains no Names.

func (q *NameQueue) Empty() bool

Esc method #

func (n *miniNode) Esc() uint16

FDumpAny function #

FDumpAny prints the structure of a rooted data structure to w by depth-first traversal of the data structure. The filter parameter is a regular expression. If it is non-empty, only struct fields whose names match filter are printed. The depth parameter controls how deep traversal recurses before it returns (higher value means greater depth). If an empty field filter is given, a good depth default value is 4. A negative depth means no depth limit, which may be fine for small data structures or if there is a non-empty filter. In the output, Node structs are identified by their Op name rather than their type; struct fields with zero values or non-matching field names are omitted, and "…" means recursion depth has been reached or struct fields have been omitted.

func FDumpAny(w io.Writer, root interface{}, filter string, depth int)

FDumpList function #

FDumpList prints to w the message s followed by a debug dump of each node in the list.

func FDumpList(w io.Writer, s string, list Nodes)

Format method #

func (n *InlineMarkStmt) Format(s fmt.State, verb rune)

Format method #

func (n *IndexExpr) Format(s fmt.State, verb rune)

Format method #

Format implements formatting for an Op. The valid formats are: %v Go syntax ("+", "<-", "print") %+v Debug syntax ("ADD", "RECV", "PRINT")

func (o Op) Format(s fmt.State, verb rune)

Format method #

Format implements formatting for a Nodes. The valid formats are: %v Go syntax, semicolon-separated %.v Go syntax, comma-separated %+v Debug syntax, as in DumpList.

func (l Nodes) Format(s fmt.State, verb rune)

Format method #

func (n *Decl) Format(s fmt.State, verb rune)

Format method #

func (n *SliceHeaderExpr) Format(s fmt.State, verb rune)

Format method #

func (n *BlockStmt) Format(s fmt.State, verb rune)

Format method #

func (n *KeyExpr) Format(s fmt.State, verb rune)

Format method #

func (n *StructKeyExpr) Format(s fmt.State, verb rune)

Format method #

func (n *JumpTableStmt) Format(s fmt.State, verb rune)

Format method #

func (n *TypeAssertExpr) Format(s fmt.State, verb rune)

Format method #

func (n *SendStmt) Format(s fmt.State, verb rune)

Format method #

func (n *SelectorExpr) Format(s fmt.State, verb rune)

Format method #

func (n *SelectStmt) Format(s fmt.State, verb rune)

Format method #

func (n *ReturnStmt) Format(s fmt.State, verb rune)

Format method #

func (n *CommClause) Format(s fmt.State, verb rune)

Format method #

func (n *DynamicType) Format(s fmt.State, verb rune)

Format method #

func (n *ResultExpr) Format(s fmt.State, verb rune)

Format method #

func (n *LabelStmt) Format(s fmt.State, verb rune)

Format method #

func (n *BinaryExpr) Format(s fmt.State, verb rune)

Format method #

func (n *RangeStmt) Format(s fmt.State, verb rune)

Format method #

func (n *GoDeferStmt) Format(s fmt.State, verb rune)

Format method #

func (n *TypeSwitchGuard) Format(s fmt.State, verb rune)

Format method #

func (n *ForStmt) Format(s fmt.State, verb rune)

Format method #

func (n *BranchStmt) Format(s fmt.State, verb rune)

Format method #

func (n *ClosureExpr) Format(s fmt.State, verb rune)

Format method #

func (n *ParenExpr) Format(s fmt.State, verb rune)

Format method #

func (n *SwitchStmt) Format(s fmt.State, verb rune)

Format method #

func (n *BasicLit) Format(s fmt.State, verb rune)

Format method #

func (n *InterfaceSwitchStmt) Format(s fmt.State, verb rune)

Format method #

func (n *UnaryExpr) Format(s fmt.State, verb rune)

Format method #

func (n *AddStringExpr) Format(s fmt.State, verb rune)

Format method #

func (n *NilExpr) Format(s fmt.State, verb rune)

Format method #

func (n *Name) Format(s fmt.State, verb rune)

Format method #

func (n *CaseClause) Format(s fmt.State, verb rune)

Format method #

func (n *CallExpr) Format(s fmt.State, verb rune)

Format method #

func (n *Ident) Format(s fmt.State, verb rune)

Format method #

func (n *AddrExpr) Format(s fmt.State, verb rune)

Format method #

func (n *AssignStmt) Format(s fmt.State, verb rune)

Format method #

func (n *StringHeaderExpr) Format(s fmt.State, verb rune)

Format method #

func (n *typeNode) Format(s fmt.State, verb rune)

Format method #

func (n *MakeExpr) Format(s fmt.State, verb rune)

Format method #

func (n *AssignOpStmt) Format(s fmt.State, verb rune)

Format method #

func (n *TailCallStmt) Format(s fmt.State, verb rune)

Format method #

func (n *StarExpr) Format(s fmt.State, verb rune)

Format method #

func (n *IfStmt) Format(s fmt.State, verb rune)

Format method #

func (n *LogicalExpr) Format(s fmt.State, verb rune)

Format method #

func (n *DynamicTypeAssertExpr) Format(s fmt.State, verb rune)

Format method #

func (n *ConvExpr) Format(s fmt.State, verb rune)

Format method #

func (n *AssignListStmt) Format(s fmt.State, verb rune)

Format method #

func (n *LinksymOffsetExpr) Format(s fmt.State, verb rune)

Format method #

func (n *Func) Format(s fmt.State, verb rune)

Format method #

func (n *CompLitExpr) Format(s fmt.State, verb rune)

Format method #

func (n *SliceExpr) Format(s fmt.State, verb rune)

Format method #

func (n *InlinedCallExpr) Format(s fmt.State, verb rune)

FrameOffset method #

func (n *Name) FrameOffset() int64

FuncName method #

func (n *SelectorExpr) FuncName() *Name

FuncName function #

FuncName returns the name (without the package) of the function f.

func FuncName(f *Func) string

FuncPC function #

FuncPC returns a uintptr-typed expression that evaluates to the PC of a function as uintptr, as returned by internal/abi.FuncPC{ABI0,ABIInternal}. n should be a Node of an interface type, as is passed to internal/abi.FuncPC{ABI0,ABIInternal}. TODO(prattmic): Since n is simply an interface{} there is no assertion that it is actually a function at all. Perhaps we should emit a runtime type assertion?

func FuncPC(pos src.XPos, n Node, wantABI obj.ABI) Node

FuncSymName function #

func FuncSymName(s *types.Sym) string

GoString method #

GoString returns the Go syntax for the Op, or else its name.

func (o Op) GoString() string

Has method #

Has reports whether s contains n.

func (s NameSet) Has(n *Name) bool

HasDefer method #

func (f *Func) HasDefer() bool

HasUniquePos function #

HasUniquePos reports whether n has a unique position that can be used for reporting error messages. It's primarily used to distinguish references to named objects, whose Pos will point back to their declaration position rather than their usage position.

func HasUniquePos(n Node) bool

Implicit method #

func (n *AddrExpr) Implicit() bool

Implicit method #

func (n *SelectorExpr) Implicit() bool

Implicit method #

func (n *StarExpr) Implicit() bool

Implicit method #

func (n *CompLitExpr) Implicit() bool

Implicit method #

func (n *ConvExpr) Implicit() bool

Implicit method #

func (n *ParenExpr) Implicit() bool

Init method #

Init initializes the oracle based on the IR in function fn, laying the groundwork for future calls to the StaticValue and Reassigned methods. If the fn's IR is subsequently modified, Init must be called again.

func (ro *ReassignOracle) Init(fn *Func)

Init method #

func (n *miniExpr) Init() Nodes

Init method #

func (n *miniNode) Init() Nodes

Init method #

func (n *miniStmt) Init() Nodes

InitExpr function #

The result of InitExpr MUST be assigned back to n, e.g. n.X = InitExpr(init, n.X)

func InitExpr(init []Node, expr Node) Node

InitLSym function #

InitLSym defines f's obj.LSym and initializes it based on the properties of f. This includes setting the symbol flags and ABI and creating and initializing related DWARF symbols. InitLSym must be called exactly once per function and must be called for both functions with bodies and functions without bodies. For body-less functions, we only create the LSym; for functions with bodies call a helper to setup up / populate the LSym.

func InitLSym(f *Func, hasBody bool)

InlFormal method #

func (n *Name) InlFormal() bool

InlLocal method #

func (n *Name) InlLocal() bool

InlinabilityChecked method #

func (f *Func) InlinabilityChecked() bool

Int64Val function #

Int64Val returns n as an int64. n must be an integer or rune constant.

func Int64Val(n Node) int64

IntVal function #

IntVal returns v converted to int64. Note: if t is uint64, very large values will be converted to negative int64.

func IntVal(t *types.Type, v constant.Value) int64

IsAddressable function #

lvalue etc

func IsAddressable(n Node) bool

IsAutoTmp function #

IsAutoTmp indicates if n was created by the compiler as a temporary, based on the setting of the .AutoTemp flag in n's Name.

func IsAutoTmp(n Node) bool

IsBlank function #

func IsBlank(n Node) bool

IsClosure method #

IsClosure reports whether f is a function literal that captures at least one value.

func (f *Func) IsClosure() bool

IsClosureVar method #

func (n *Name) IsClosureVar() bool

IsCmp method #

IsCmp reports whether op is a comparison operation (==, !=, <, <=, >, or >=).

func (op Op) IsCmp() bool

IsConst function #

func IsConst(n Node, ct constant.Kind) bool

IsConstNode function #

IsConstNode reports whether n is a Go language constant (as opposed to a compile-time constant). Expressions derived from nil, like string([]byte(nil)), while they may be known at compile time, are not Go language constants.

func IsConstNode(n Node) bool

IsFuncPCIntrinsic function #

IsFuncPCIntrinsic returns whether n is a direct call of internal/abi.FuncPCABIxxx functions.

func IsFuncPCIntrinsic(n *CallExpr) bool

IsIfaceOfFunc function #

IsIfaceOfFunc inspects whether n is an interface conversion from a direct reference of a func. If so, it returns referenced Func; otherwise nil. This is only usable before walk.walkConvertInterface, which converts to an OMAKEFACE.

func IsIfaceOfFunc(n Node) *Func

IsMethod function #

IsMethod reports whether n is a method. n must be a function or a method.

func IsMethod(n Node) bool

IsNil function #

IsNil reports whether n represents the universal untyped zero value "nil".

func IsNil(n Node) bool

IsOutputParamHeapAddr method #

func (n *Name) IsOutputParamHeapAddr() bool

IsOutputParamInRegisters method #

func (n *Name) IsOutputParamInRegisters() bool

IsPackageInit method #

func (f *Func) IsPackageInit() bool

IsReflectHeaderDataField function #

IsReflectHeaderDataField reports whether l is an expression p.Data where p has type reflect.SliceHeader or reflect.StringHeader.

func IsReflectHeaderDataField(l Node) bool

IsSlice3 method #

IsSlice3 reports whether o is a slice3 op (OSLICE3, OSLICE3ARR). o must be a slicing op.

func (o Op) IsSlice3() bool

IsSmallIntConst function #

func IsSmallIntConst(n Node) bool

IsSynthetic function #

func IsSynthetic(n Node) bool

IsZero function #

func IsZero(n Node) bool

Libfuzzer8BitCounter method #

func (n *Name) Libfuzzer8BitCounter() bool

Line function #

Line returns n's position as a string. If n has been inlined, it uses the outermost position where n has been inlined.

func Line(n Node) string

LinkFuncName function #

LinkFuncName returns the name of the function f, as it will appear in the symbol table of the final linked binary.

func LinkFuncName(f *Func) string

Linksym method #

func (n *Name) Linksym() *obj.LSym

Linksym method #

func (f *Func) Linksym() *obj.LSym

LinksymABI method #

func (f *Func) LinksymABI(abi obj.ABI) *obj.LSym

LinksymABI method #

func (n *Name) LinksymABI(abi obj.ABI) *obj.LSym

LookupMethodSelector function #

LookupMethodSelector returns the types.Sym of the selector for a method named in local symbol name, as well as the types.Sym of the receiver. TODO(prattmic): this does not attempt to handle method suffixes (wrappers).

func LookupMethodSelector(pkg *types.Pkg, name string) (typ *types.Sym, meth *types.Sym, err error)

MarkNonNil method #

func (n *miniExpr) MarkNonNil()

MarkNonNil method #

func (n *miniNode) MarkNonNil()

MarkReadonly method #

MarkReadonly indicates that n is an ONAME with readonly contents.

func (n *Name) MarkReadonly()

MayBeShared function #

MayBeShared reports whether n may occur in multiple places in the AST. Extra care must be taken when mutating such a node.

func MayBeShared(n Node) bool

MethodExprFunc function #

MethodExprFunc is like MethodExprName, but returns the types.Field instead.

func MethodExprFunc(n Node) *types.Field

MethodExprName function #

MethodExprName returns the ONAME representing the method referenced by expression n, which must be a method selector, method expression, or method value.

func MethodExprName(n Node) *Name

MethodSym function #

MethodSym returns the method symbol representing a method name associated with a specific receiver type. Method symbols can be used to distinguish the same method appearing in different method sets. For example, T.M and (*T).M have distinct method symbols. The returned symbol will be marked as a function.

func MethodSym(recv *types.Type, msym *types.Sym) *types.Sym

MethodSymSuffix function #

MethodSymSuffix is like MethodSym, but allows attaching a distinguisher suffix. To avoid collisions, the suffix must not start with a letter, number, or period.

func MethodSymSuffix(recv *types.Type, msym *types.Sym, suffix string) *types.Sym

Name method #

func (n *miniNode) Name() *Name

Name method #

func (n *Name) Name() *Name

Needctxt method #

func (f *Func) Needctxt() bool

Needzero method #

func (n *Name) Needzero() bool

NeverReturns method #

func (f *Func) NeverReturns() bool

NewAddStringExpr function #

func NewAddStringExpr(pos src.XPos, list []Node) *AddStringExpr

NewAddrExpr function #

func NewAddrExpr(pos src.XPos, x Node) *AddrExpr

NewAssignListStmt function #

func NewAssignListStmt(pos src.XPos, op Op, lhs []Node, rhs []Node) *AssignListStmt

NewAssignOpStmt function #

func NewAssignOpStmt(pos src.XPos, asOp Op, x Node, y Node) *AssignOpStmt

NewAssignStmt function #

func NewAssignStmt(pos src.XPos, x Node, y Node) *AssignStmt

NewBasicLit function #

NewBasicLit returns an OLITERAL representing val with the given type.

func NewBasicLit(pos src.XPos, typ *types.Type, val constant.Value) Node

NewBinaryExpr function #

func NewBinaryExpr(pos src.XPos, op Op, x Node, y Node) *BinaryExpr

NewBlockStmt function #

func NewBlockStmt(pos src.XPos, list []Node) *BlockStmt

NewBool function #

NewBool returns an OLITERAL representing b as an untyped boolean.

func NewBool(pos src.XPos, b bool) Node

NewBranchStmt function #

func NewBranchStmt(pos src.XPos, op Op, label *types.Sym) *BranchStmt

NewBuiltin function #

NewBuiltin returns a new Name representing a builtin function, either predeclared or from package unsafe.

func NewBuiltin(sym *types.Sym, op Op) *Name

NewCallExpr function #

func NewCallExpr(pos src.XPos, op Op, fun Node, args []Node) *CallExpr

NewCaseStmt function #

func NewCaseStmt(pos src.XPos, list []Node, body []Node) *CaseClause

NewClosureFunc function #

NewClosureFunc creates a new Func to represent a function literal with the given type. fpos the position used for the underlying ODCLFUNC and ONAME, whereas cpos is the position used for the OCLOSURE. They're separate because in the presence of inlining, the OCLOSURE node should have an inline-adjusted position, whereas the ODCLFUNC and ONAME must not. outerfn is the enclosing function. The returned function is appending to pkg.Funcs. why is the reason we're generating this Func. It can be OCLOSURE (for a normal function literal) or OGO or ODEFER (for wrapping a call expression that has parameters or results).

func NewClosureFunc(fpos src.XPos, cpos src.XPos, why Op, typ *types.Type, outerfn *Func, pkg *Package) *Func

NewClosureVar function #

NewClosureVar returns a new closure variable for fn to refer to outer variable n.

func NewClosureVar(pos src.XPos, fn *Func, n *Name) *Name

NewCommStmt function #

func NewCommStmt(pos src.XPos, comm Node, body []Node) *CommClause

NewCompLitExpr function #

func NewCompLitExpr(pos src.XPos, op Op, typ *types.Type, list []Node) *CompLitExpr

NewConstAt function #

NewConstAt returns a new OLITERAL Node associated with symbol s at position pos.

func NewConstAt(pos src.XPos, sym *types.Sym, typ *types.Type, val constant.Value) *Name

NewConstExpr function #

NewConstExpr returns an OLITERAL representing val, copying the position and type from orig.

func NewConstExpr(val constant.Value, orig Node) Node

NewConvExpr function #

func NewConvExpr(pos src.XPos, op Op, typ *types.Type, x Node) *ConvExpr

NewDecl function #

func NewDecl(pos src.XPos, op Op, x *Name) *Decl

NewDeclNameAt function #

NewDeclNameAt returns a new Name associated with symbol s at position pos. The caller is responsible for setting Curfn.

func NewDeclNameAt(pos src.XPos, op Op, sym *types.Sym) *Name

NewDynamicType function #

func NewDynamicType(pos src.XPos, rtype Node) *DynamicType

NewDynamicTypeAssertExpr function #

func NewDynamicTypeAssertExpr(pos src.XPos, op Op, x Node, rtype Node) *DynamicTypeAssertExpr

NewForStmt function #

func NewForStmt(pos src.XPos, init Node, cond Node, post Node, body []Node, distinctVars bool) *ForStmt

NewFunc function #

NewFunc returns a new Func with the given name and type. fpos is the position of the "func" token, and npos is the position of the name identifier. TODO(mdempsky): I suspect there's no need for separate fpos and npos.

func NewFunc(fpos src.XPos, npos src.XPos, sym *types.Sym, typ *types.Type) *Func

NewGoDeferStmt function #

func NewGoDeferStmt(pos src.XPos, op Op, call Node) *GoDeferStmt

NewHiddenParam function #

NewHiddenParam returns a new hidden parameter for fn with the given name and type.

func NewHiddenParam(pos src.XPos, fn *Func, sym *types.Sym, typ *types.Type) *Name

NewIdent function #

func NewIdent(pos src.XPos, sym *types.Sym) *Ident

NewIfStmt function #

func NewIfStmt(pos src.XPos, cond Node, body []Node, els []Node) *IfStmt

NewIndexExpr function #

func NewIndexExpr(pos src.XPos, x Node, index Node) *IndexExpr

NewInlineMarkStmt function #

func NewInlineMarkStmt(pos src.XPos, index int64) *InlineMarkStmt

NewInlinedCallExpr function #

func NewInlinedCallExpr(pos src.XPos, body []Node, retvars []Node) *InlinedCallExpr

NewInt function #

NewInt returns an OLITERAL representing v as an untyped integer.

func NewInt(pos src.XPos, v int64) Node

NewInterfaceSwitchStmt function #

func NewInterfaceSwitchStmt(pos src.XPos, case_ Node, itab Node, runtimeType Node, hash Node, descriptor *obj.LSym) *InterfaceSwitchStmt

NewJumpTableStmt function #

func NewJumpTableStmt(pos src.XPos, idx Node) *JumpTableStmt

NewKeyExpr function #

func NewKeyExpr(pos src.XPos, key Node, value Node) *KeyExpr

NewLabelStmt function #

func NewLabelStmt(pos src.XPos, label *types.Sym) *LabelStmt

NewLinksymExpr function #

NewLinksymExpr is NewLinksymOffsetExpr, but with offset fixed at 0.

func NewLinksymExpr(pos src.XPos, lsym *obj.LSym, typ *types.Type) *LinksymOffsetExpr

NewLinksymOffsetExpr function #

func NewLinksymOffsetExpr(pos src.XPos, lsym *obj.LSym, offset int64, typ *types.Type) *LinksymOffsetExpr

NewLocal method #

NewLocal returns a new function-local variable with the given name and type.

func (fn *Func) NewLocal(pos src.XPos, sym *types.Sym, typ *types.Type) *Name

NewLogicalExpr function #

func NewLogicalExpr(pos src.XPos, op Op, x Node, y Node) *LogicalExpr

NewMakeExpr function #

func NewMakeExpr(pos src.XPos, op Op, len Node, cap Node) *MakeExpr

NewNameAt function #

NewNameAt returns a new ONAME Node associated with symbol s at position pos. The caller is responsible for setting Curfn.

func NewNameAt(pos src.XPos, sym *types.Sym, typ *types.Type) *Name

NewNameOffsetExpr function #

NewNameOffsetExpr is NewLinksymOffsetExpr, but taking a *Name representing a global variable instead of an *obj.LSym directly.

func NewNameOffsetExpr(pos src.XPos, name *Name, offset int64, typ *types.Type) *LinksymOffsetExpr

NewNilExpr function #

func NewNilExpr(pos src.XPos, typ *types.Type) *NilExpr

NewOne function #

NewOne returns an OLITERAL representing 1 with the given type.

func NewOne(pos src.XPos, typ *types.Type) Node

NewParenExpr function #

func NewParenExpr(pos src.XPos, x Node) *ParenExpr

NewRangeStmt function #

func NewRangeStmt(pos src.XPos, key Node, value Node, x Node, body []Node, distinctVars bool) *RangeStmt

NewResultExpr function #

func NewResultExpr(pos src.XPos, typ *types.Type, index int64) *ResultExpr

NewReturnStmt function #

func NewReturnStmt(pos src.XPos, results []Node) *ReturnStmt

NewSelectStmt function #

func NewSelectStmt(pos src.XPos, cases []*CommClause) *SelectStmt

NewSelectorExpr function #

func NewSelectorExpr(pos src.XPos, op Op, x Node, sel *types.Sym) *SelectorExpr

NewSendStmt function #

func NewSendStmt(pos src.XPos, ch Node, value Node) *SendStmt

NewSliceExpr function #

func NewSliceExpr(pos src.XPos, op Op, x Node, low Node, high Node, max Node) *SliceExpr

NewSliceHeaderExpr function #

func NewSliceHeaderExpr(pos src.XPos, typ *types.Type, ptr Node, len Node, cap Node) *SliceHeaderExpr

NewStarExpr function #

func NewStarExpr(pos src.XPos, x Node) *StarExpr

NewString function #

NewString returns an OLITERAL representing s as an untyped string.

func NewString(pos src.XPos, s string) Node

NewStringHeaderExpr function #

func NewStringHeaderExpr(pos src.XPos, ptr Node, len Node) *StringHeaderExpr

NewStructKeyExpr function #

func NewStructKeyExpr(pos src.XPos, field *types.Field, value Node) *StructKeyExpr

NewSwitchStmt function #

func NewSwitchStmt(pos src.XPos, tag Node, cases []*CaseClause) *SwitchStmt

NewTailCallStmt function #

func NewTailCallStmt(pos src.XPos, call *CallExpr) *TailCallStmt

NewTypeAssertExpr function #

func NewTypeAssertExpr(pos src.XPos, x Node, typ *types.Type) *TypeAssertExpr

NewTypeSwitchGuard function #

func NewTypeSwitchGuard(pos src.XPos, tag *Ident, x Node) *TypeSwitchGuard

NewUintptr function #

NewUintptr returns an OLITERAL representing v as a uintptr.

func NewUintptr(pos src.XPos, v int64) Node

NewUnaryExpr function #

func NewUnaryExpr(pos src.XPos, op Op, x Node) *UnaryExpr

NewZero function #

NewZero returns a zero value of the given type.

func NewZero(pos src.XPos, typ *types.Type) Node

NilCheckDisabled method #

func (f *Func) NilCheckDisabled() bool

NonMergeable method #

func (n *Name) NonMergeable() bool

NonNil method #

func (n *miniNode) NonNil() bool

NonNil method #

func (n *miniExpr) NonNil() bool

Offset method #

func (n *SelectorExpr) Offset() int64

Offset method #

func (n *InlineMarkStmt) Offset() int64

OnStack method #

OnStack reports whether variable n may reside on the stack.

func (n *Name) OnStack() bool

Op method #

op can be read, but not written. An embedding implementation can provide a SetOp if desired. (The panicking SetOp is with the other panics below.)

func (n *miniNode) Op() Op

OpenCodedDeferDisallowed method #

func (f *Func) OpenCodedDeferDisallowed() bool

OpenDeferSlot method #

func (n *Name) OpenDeferSlot() bool

OuterValue function #

what's the outer value that a write to n affects? outer value means containing struct or array.

func OuterValue(n Node) Node

ParamNames function #

func ParamNames(ft *types.Type) []Node

ParseLinkFuncName function #

ParseLinkFuncName parsers a symbol name (as returned from LinkFuncName) back to the package path and local symbol name.

func ParseLinkFuncName(name string) (pkg string, sym string, err error)

PkgFuncName function #

PkgFuncName returns the name of the function referenced by f, with package prepended. This differs from the compiler's internal convention where local functions lack a package. This is primarily useful when the ultimate consumer of this is a human looking at message.

func PkgFuncName(f *Func) string

PopLeft method #

PopLeft pops a Name from the left of the queue. It panics if q is empty.

func (q *NameQueue) PopLeft() *Name

Pos method #

func (n *miniNode) Pos() src.XPos

Pragma method #

Pragma returns the PragmaFlag for p, which must be for an OTYPE.

func (n *Name) Pragma() PragmaFlag

Prepend method #

Prepend prepends entries to Nodes. If a slice is passed in, this will take ownership of it.

func (n *Nodes) Prepend(a ...Node)

PtrInit method #

func (n *miniStmt) PtrInit() *Nodes

PtrInit method #

func (n *miniExpr) PtrInit() *Nodes

PushRight method #

PushRight appends n to the right of the queue.

func (q *NameQueue) PushRight(n *Name)

Readonly method #

func (n *Name) Readonly() bool

Reassigned method #

Reassigned method has the same semantics as the ir package function of the same name; see comments on [Reassigned] for more info.

func (ro *ReassignOracle) Reassigned(n *Name) bool

Reassigned function #

Reassigned takes an ONAME node, walks the function in which it is defined, and returns a boolean indicating whether the name has any assignments other than its declaration. NB: global variables are always considered to be re-assigned. TODO: handle initial declaration not including an assignment and followed by a single assignment? NOTE: any changes made here should also be made in the corresponding code in the ReassignOracle.Init method.

func Reassigned(name *Name) bool

RecordFrameOffset method #

RecordFrameOffset records the frame offset for the name. It is used by package types when laying out function arguments.

func (n *Name) RecordFrameOffset(offset int64)

SameSafeExpr function #

SameSafeExpr checks whether it is safe to reuse one of l and r instead of computing both. SameSafeExpr assumes that l and r are used in the same statement or expression. In order for it to be safe to reuse l or r, they must: - be the same expression - not have side-effects (no function calls, no channel ops); however, panics are ok - not cause inappropriate aliasing; e.g. two string to []byte conversions, must result in two distinct slices The handling of OINDEXMAP is subtle. OINDEXMAP can occur both as an lvalue (map assignment) and an rvalue (map access). This is currently OK, since the only place SameSafeExpr gets used on an lvalue expression is for OSLICE and OAPPEND optimizations, and it is correct in those settings.

func SameSafeExpr(l Node, r Node) bool

SameSource function #

SameSource reports whether two nodes refer to the same source element. It exists to help incrementally migrate the compiler towards allowing the introduction of IdentExpr (#42990). Once we have IdentExpr, it will no longer be safe to directly compare Node values to tell if they refer to the same Name. Instead, code will need to explicitly get references to the underlying Name object(s), and compare those instead. It will still be safe to compare Nodes directly for checking if two nodes are syntactically the same. The SameSource function exists to indicate code that intentionally compares Nodes for syntactic equality as opposed to code that has yet to be updated in preparation for IdentExpr.

func SameSource(n1 Node, n2 Node) bool

SetABIWrapper method #

func (f *Func) SetABIWrapper(b bool)

SetAddrtaken method #

func (n *Name) SetAddrtaken(b bool)

SetAlias method #

SetAlias sets whether p, which must be for an OTYPE, is a type alias.

func (n *Name) SetAlias(alias bool)

SetAutoTemp method #

func (n *Name) SetAutoTemp(b bool)

SetBounded method #

func (n *miniExpr) SetBounded(b bool)

SetByval method #

func (n *Name) SetByval(b bool)

SetCheckPtr method #

func (n *ConvExpr) SetCheckPtr(b bool)

SetClosureResultsLost method #

func (f *Func) SetClosureResultsLost(b bool)

SetCoverageAuxVar method #

func (n *Name) SetCoverageAuxVar(b bool)

SetDupok method #

func (f *Func) SetDupok(b bool)

SetEsc method #

func (n *miniNode) SetEsc(x uint16)

SetFrameOffset method #

func (n *Name) SetFrameOffset(x int64)

SetFunc method #

func (n *Name) SetFunc(x *Func)

SetHasDefer method #

func (f *Func) SetHasDefer(b bool)

SetImplicit method #

func (n *AddrExpr) SetImplicit(b bool)

SetImplicit method #

func (n *CompLitExpr) SetImplicit(b bool)

SetImplicit method #

func (n *ConvExpr) SetImplicit(b bool)

SetImplicit method #

func (n *ParenExpr) SetImplicit(b bool)

SetImplicit method #

func (n *StarExpr) SetImplicit(b bool)

SetImplicit method #

func (n *SelectorExpr) SetImplicit(b bool)

SetInit method #

func (n *miniExpr) SetInit(x Nodes)

SetInit method #

func (n *miniStmt) SetInit(x Nodes)

SetInlFormal method #

func (n *Name) SetInlFormal(b bool)

SetInlLocal method #

func (n *Name) SetInlLocal(b bool)

SetInlinabilityChecked method #

func (f *Func) SetInlinabilityChecked(b bool)

SetIsClosureVar method #

func (n *Name) SetIsClosureVar(b bool)

SetIsOutputParamHeapAddr method #

func (n *Name) SetIsOutputParamHeapAddr(b bool)

SetIsOutputParamInRegisters method #

func (n *Name) SetIsOutputParamInRegisters(b bool)

SetIsPackageInit method #

func (f *Func) SetIsPackageInit(b bool)

SetLibfuzzer8BitCounter method #

func (n *Name) SetLibfuzzer8BitCounter(b bool)

SetNeedctxt method #

func (f *Func) SetNeedctxt(b bool)

SetNeedzero method #

func (n *Name) SetNeedzero(b bool)

SetNeverReturns method #

func (f *Func) SetNeverReturns(b bool)

SetNilCheckDisabled method #

func (f *Func) SetNilCheckDisabled(b bool)

SetNonMergeable method #

func (n *Name) SetNonMergeable(b bool)

SetOffset method #

func (n *InlineMarkStmt) SetOffset(x int64)

SetOp method #

func (n *AssignStmt) SetOp(op Op)

SetOp method #

func (n *TypeAssertExpr) SetOp(op Op)

SetOp method #

func (n *SliceExpr) SetOp(op Op)

SetOp method #

func (n *BinaryExpr) SetOp(op Op)

SetOp method #

func (n *CallExpr) SetOp(op Op)

SetOp method #

func (n *IndexExpr) SetOp(op Op)

SetOp method #

func (n *AssignListStmt) SetOp(op Op)

SetOp method #

func (n *UnaryExpr) SetOp(op Op)

SetOp method #

func (n *CompLitExpr) SetOp(op Op)

SetOp method #

func (n *MakeExpr) SetOp(op Op)

SetOp method #

func (n *AddrExpr) SetOp(op Op)

SetOp method #

func (n *SelectorExpr) SetOp(op Op)

SetOp method #

func (n *DynamicTypeAssertExpr) SetOp(op Op)

SetOp method #

func (n *LogicalExpr) SetOp(op Op)

SetOp method #

func (n *BranchStmt) SetOp(op Op)

SetOp method #

func (n *ConvExpr) SetOp(op Op)

SetOpenCodedDeferDisallowed method #

func (f *Func) SetOpenCodedDeferDisallowed(b bool)

SetOpenDeferSlot method #

func (n *Name) SetOpenDeferSlot(b bool)

SetPos function #

func SetPos(n Node) src.XPos

SetPos method #

func (n *miniNode) SetPos(x src.XPos)

SetPragma method #

SetPragma sets the PragmaFlag for p, which must be for an OTYPE.

func (n *Name) SetPragma(flag PragmaFlag)

SetSubOp method #

func (n *Name) SetSubOp(x Op)

SetSym method #

func (n *Name) SetSym(x *types.Sym)

SetTransient method #

func (n *miniExpr) SetTransient(b bool)

SetType method #

func (n *miniExpr) SetType(x *types.Type)

SetType method #

func (n *miniNode) SetType(*types.Type)

SetTypecheck method #

func (n *miniNode) SetTypecheck(x uint8)

SetUsed method #

func (n *Name) SetUsed(b bool)

SetVal method #

func (n *BasicLit) SetVal(val constant.Value)

SetVal method #

func (n *miniNode) SetVal(v constant.Value)

SetVal method #

SetVal sets the constant.Value for the node.

func (n *Name) SetVal(v constant.Value)

SetWBPos method #

func (f *Func) SetWBPos(pos src.XPos)

SetWalked method #

func (n *miniNode) SetWalked(x bool)

SetWrapper method #

func (f *Func) SetWrapper(b bool)

ShouldAsanCheckPtr function #

ShouldAsanCheckPtr reports whether pointer checking should be enabled for function fn when -asan is enabled.

func ShouldAsanCheckPtr(fn *Func) bool

ShouldCheckPtr function #

ShouldCheckPtr reports whether pointer checking should be enabled for function fn at a given level. See debugHelpFooter for defined levels.

func ShouldCheckPtr(fn *Func, level int) bool

SingleResult method #

func (n *InlinedCallExpr) SingleResult() Node

StaticCalleeName function #

StaticCalleeName returns the ONAME/PFUNC for n, if known.

func StaticCalleeName(n Node) *Name

StaticValue function #

StaticValue analyzes n to find the earliest expression that always evaluates to the same value as n, which might be from an enclosing function. For example, given: var x int = g() func() { y := x *p = int(y) } calling StaticValue on the "int(y)" expression returns the outer "g()" expression.

func StaticValue(n Node) Node

StaticValue method #

StaticValue method has the same semantics as the ir package function of the same name; see comments on [StaticValue].

func (ro *ReassignOracle) StaticValue(n Node) Node

StmtWithInit function #

StmtWithInit reports whether op is a statement with an explicit init list.

func StmtWithInit(op Op) bool

String method #

func (i Class) String() string

String method #

func (i Op) String() string

StringVal function #

StringVal returns the value of a literal string Node as a string. n must be a string constant.

func StringVal(n Node) string

SubOp method #

func (n *Name) SubOp() Op

Sym method #

func (f *Func) Sym() *types.Sym

Sym method #

func (n *BranchStmt) Sym() *types.Sym

Sym method #

func (n *Ident) Sym() *types.Sym

Sym method #

func (n *miniNode) Sym() *types.Sym

Sym method #

func (n *SelectorExpr) Sym() *types.Sym

Sym method #

func (n *Name) Sym() *types.Sym

Sym method #

func (n *typeNode) Sym() *types.Sym

Sym method #

func (n *StructKeyExpr) Sym() *types.Sym

Sym method #

func (n *LabelStmt) Sym() *types.Sym

Take method #

Take clears n, returning its former contents.

func (n *Nodes) Take() []Node

TakeInit function #

func TakeInit(n Node) Nodes

ToNodes function #

ToNodes returns s as a slice of Nodes.

func ToNodes(s []T) Nodes

ToStatic method #

ToStatic returns static type of dt if it is actually static.

func (dt *DynamicType) ToStatic() Node

Transient method #

func (n *miniExpr) Transient() bool

Type method #

func (n *miniExpr) Type() *types.Type

Type method #

func (f *Func) Type() *types.Type

Type method #

func (n *typeNode) Type() *types.Type

Type method #

func (n *miniNode) Type() *types.Type

TypeNode function #

TypeNode returns the Node representing the type t.

func TypeNode(t *types.Type) Node

Typecheck method #

func (n *miniNode) Typecheck() uint8

Uint64Val function #

Uint64Val returns n as a uint64. n must be an integer or rune constant.

func Uint64Val(n Node) uint64

Used method #

func (n *Name) Used() bool

Uses function #

Uses reports whether expression x is a (direct) use of the given variable.

func Uses(x Node, v *Name) bool

Val method #

func (n *miniNode) Val() constant.Value

Val method #

Val returns the constant.Value for the node.

func (n *Name) Val() constant.Value

Val method #

func (n *BasicLit) Val() constant.Value

ValidTypeForConst function #

func ValidTypeForConst(t *types.Type, v constant.Value) bool

Visit function #

Visit visits each non-nil node x in the IR tree rooted at n in a depth-first preorder traversal, calling visit on each node visited.

func Visit(n Node, visit func(Node))

VisitFuncAndClosures function #

VisitFuncAndClosures calls visit on each non-nil node in fn.Body, including any nested closure bodies.

func VisitFuncAndClosures(fn *Func, visit func(n Node))

VisitFuncsBottomUp function #

VisitFuncsBottomUp invokes analyze on the ODCLFUNC nodes listed in list. It calls analyze with successive groups of functions, working from the bottom of the call graph upward. Each time analyze is called with a list of functions, every function on that list only calls other functions on the list or functions that have been passed in previous invocations of analyze. Closures appear in the same list as their outer functions. The lists are as short as possible while preserving those requirements. (In a typical program, many invocations of analyze will be passed just a single function.) The boolean argument 'recursive' passed to analyze specifies whether the functions on the list are mutually recursive. If recursive is false, the list consists of only a single function and its closures. If recursive is true, the list may still contain only a single function, if that function is itself recursive.

func VisitFuncsBottomUp(list []*Func, analyze func(list []*Func, recursive bool))

VisitList function #

VisitList calls Visit(x, visit) for each node x in the list.

func VisitList(list Nodes, visit func(Node))

Walked method #

func (n *miniNode) Walked() bool

WithFunc function #

WithFunc invokes do with CurFunc and base.Pos set to curfn and curfn.Pos(), respectively, and then restores their previous values before returning.

func WithFunc(curfn *Func, do func())

Wrapper method #

func (f *Func) Wrapper() bool

Write method #

func (p *dumper) Write(data []byte) (n int, err error)

_ function #

func _()

_ function #

func _()

addr method #

addr returns the (hexadecimal) address string of the object represented by x (or "?" if x is not addressable), with the common prefix between this and the prior address replaced by "0x…" to make it easier to visually match addresses.

func (p *dumper) addr(x reflect.Value) string

checkReassignedResult function #

checkReassignedResult compares the result from ReassignOracle.Reassigned with the corresponding result from ir.Reassigned to make sure they agree. This method is called only when turned on via build tag.

func checkReassignedResult(n *Name, newres bool)

checkStaticValueResult function #

checkStaticValueResult compares the result from ReassignOracle.StaticValue with the corresponding result from ir.StaticValue to make sure they agree. This method is called only when turned on via build tag.

func checkStaticValueResult(n Node, newres Node)

closureName function #

closureName generates a new unique name for a closure within outerfn at pos.

func closureName(outerfn *Func, pos src.XPos, why Op) *types.Sym

commonPrefixLen function #

func commonPrefixLen(a string, b string) (i int)

copy method #

func (n *SliceExpr) copy() Node

copy method #

func (n *InlinedCallExpr) copy() Node

copy method #

func (n *NilExpr) copy() Node

copy method #

func (n *AddStringExpr) copy() Node

copy method #

func (n *RangeStmt) copy() Node

copy method #

func (n *AddrExpr) copy() Node

copy method #

func (n *MakeExpr) copy() Node

copy method #

func (n *TypeAssertExpr) copy() Node

copy method #

func (n *LogicalExpr) copy() Node

copy method #

func (n *AssignListStmt) copy() Node

copy method #

func (n *ResultExpr) copy() Node

copy method #

func (n *AssignOpStmt) copy() Node

copy method #

func (n *LinksymOffsetExpr) copy() Node

copy method #

func (n *TypeSwitchGuard) copy() Node

copy method #

func (n *ReturnStmt) copy() Node

copy method #

func (n *AssignStmt) copy() Node

copy method #

func (n *LabelStmt) copy() Node

copy method #

func (n *BasicLit) copy() Node

copy method #

func (n *KeyExpr) copy() Node

copy method #

func (n *UnaryExpr) copy() Node

copy method #

func (n *SelectStmt) copy() Node

copy method #

func (n *BinaryExpr) copy() Node

copy method #

func (n *JumpTableStmt) copy() Node

copy method #

func (n *BlockStmt) copy() Node

copy method #

func (n *InterfaceSwitchStmt) copy() Node

copy method #

func (n *typeNode) copy() Node

copy method #

func (n *SelectorExpr) copy() Node

copy method #

func (n *ParenExpr) copy() Node

copy method #

func (n *BranchStmt) copy() Node

copy method #

func (n *DynamicTypeAssertExpr) copy() Node

copy method #

func (n *ForStmt) copy() Node

copy method #

func (n *DynamicType) copy() Node

copy method #

func (n *CallExpr) copy() Node

copy method #

func (n *Func) copy() Node

copy method #

func (n *SendStmt) copy() Node

copy method #

func (n *TailCallStmt) copy() Node

copy method #

func (n *Decl) copy() Node

copy method #

func (n *Name) copy() Node

copy method #

func (n *CaseClause) copy() Node

copy method #

func (n *StringHeaderExpr) copy() Node

copy method #

func (n *InlineMarkStmt) copy() Node

copy method #

func (n *ClosureExpr) copy() Node

copy method #

func (n *SwitchStmt) copy() Node

copy method #

func (n *IndexExpr) copy() Node

copy method #

func (n *CommClause) copy() Node

copy method #

func (n *IfStmt) copy() Node

copy method #

func (n *CompLitExpr) copy() Node

copy method #

func (n *SliceHeaderExpr) copy() Node

copy method #

func (n *StructKeyExpr) copy() Node

copy method #

func (n *Ident) copy() Node

copy method #

func (n *ConvExpr) copy() Node

copy method #

func (n *GoDeferStmt) copy() Node

copy method #

func (n *StarExpr) copy() Node

copyCaseClauses function #

func copyCaseClauses(list []*CaseClause) []*CaseClause

copyCommClauses function #

func copyCommClauses(list []*CommClause) []*CommClause

copyNames function #

func copyNames(list []*Name) []*Name

copyNodes function #

func copyNodes(list []Node) []Node

doCaseClauses function #

func doCaseClauses(list []*CaseClause, do func(Node) bool) bool

doChildren method #

func (n *BlockStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *DynamicTypeAssertExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *DynamicType) doChildren(do func(Node) bool) bool

doChildren method #

func (n *Func) doChildren(do func(Node) bool) bool

doChildren method #

func (n *Decl) doChildren(do func(Node) bool) bool

doChildren method #

func (n *ForStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *StarExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *StringHeaderExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *ConvExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *GoDeferStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *CompLitExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *SliceHeaderExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *StructKeyExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *Ident) doChildren(do func(Node) bool) bool

doChildren method #

func (n *CommClause) doChildren(do func(Node) bool) bool

doChildren method #

func (n *IfStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *SliceExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *ClosureExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *IndexExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *CaseClause) doChildren(do func(Node) bool) bool

doChildren method #

func (n *Name) doChildren(do func(Node) bool) bool

doChildren method #

func (n *SendStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *CallExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *InlineMarkStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *BranchStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *InlinedCallExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *SelectorExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *typeNode) doChildren(do func(Node) bool) bool

doChildren method #

func (n *SwitchStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *InterfaceSwitchStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *BinaryExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *SelectStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *UnaryExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *JumpTableStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *BasicLit) doChildren(do func(Node) bool) bool

doChildren method #

func (n *KeyExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *ReturnStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *AssignStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *TypeSwitchGuard) doChildren(do func(Node) bool) bool

doChildren method #

func (n *LabelStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *AssignOpStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *LinksymOffsetExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *ResultExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *AssignListStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *TypeAssertExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *LogicalExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *AddrExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *RangeStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *AddStringExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *MakeExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *TailCallStmt) doChildren(do func(Node) bool) bool

doChildren method #

func (n *NilExpr) doChildren(do func(Node) bool) bool

doChildren method #

func (n *ParenExpr) doChildren(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *SendStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *CompLitExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *SliceExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *NilExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *ParenExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *IfStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *SliceHeaderExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *GoDeferStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *TailCallStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *MakeExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *AddStringExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *RangeStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *AddrExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *TypeAssertExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *LogicalExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *AssignListStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *AssignOpStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *TypeSwitchGuard) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *AssignStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *LinksymOffsetExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *ResultExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *SwitchStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *BasicLit) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *UnaryExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *LabelStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *BinaryExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *typeNode) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *BlockStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *BranchStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *KeyExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *ReturnStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *ForStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *StarExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *CallExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *JumpTableStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *Name) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *SelectStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *IndexExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *Func) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *InterfaceSwitchStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *CaseClause) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *ClosureExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *StructKeyExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *CommClause) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *InlinedCallExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *SelectorExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *Ident) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *StringHeaderExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *ConvExpr) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *InlineMarkStmt) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *Decl) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *DynamicType) doChildrenWithHidden(do func(Node) bool) bool

doChildrenWithHidden method #

func (n *DynamicTypeAssertExpr) doChildrenWithHidden(do func(Node) bool) bool

doCommClauses function #

func doCommClauses(list []*CommClause, do func(Node) bool) bool

doNames function #

func doNames(list []*Name, do func(Node) bool) bool

doNodes function #

func doNodes(list []Node, do func(Node) bool) bool

dump method #

dump prints the contents of x.

func (p *dumper) dump(x reflect.Value, depth int)

dumpNode function #

func dumpNode(w io.Writer, n Node, depth int)

dumpNodeHeader function #

dumpNodeHeader prints the debug-format node header line to w.

func dumpNodeHeader(w io.Writer, n Node)

dumpNodes function #

func dumpNodes(w io.Writer, list Nodes, depth int)

editCaseClauses function #

func editCaseClauses(list []*CaseClause, edit func(Node) Node)

editChildren method #

func (n *SendStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *StructKeyExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *NilExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *Ident) editChildren(edit func(Node) Node)

editChildren method #

func (n *SliceExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *ParenExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *IfStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *MakeExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *GoDeferStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *TailCallStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *SliceHeaderExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *AddStringExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *AddrExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *LogicalExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *ForStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *TypeAssertExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *RangeStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *AssignListStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *SwitchStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *AssignOpStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *IndexExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *Func) editChildren(edit func(Node) Node)

editChildren method #

func (n *TypeSwitchGuard) editChildren(edit func(Node) Node)

editChildren method #

func (n *LinksymOffsetExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *AssignStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *DynamicTypeAssertExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *ResultExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *StarExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *BasicLit) editChildren(edit func(Node) Node)

editChildren method #

func (n *LabelStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *DynamicType) editChildren(edit func(Node) Node)

editChildren method #

func (n *UnaryExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *BinaryExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *BlockStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *typeNode) editChildren(edit func(Node) Node)

editChildren method #

func (n *Decl) editChildren(edit func(Node) Node)

editChildren method #

func (n *KeyExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *BranchStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *ReturnStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *JumpTableStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *ConvExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *InlineMarkStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *Name) editChildren(edit func(Node) Node)

editChildren method #

func (n *StringHeaderExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *CallExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *CompLitExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *SelectorExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *InterfaceSwitchStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *SelectStmt) editChildren(edit func(Node) Node)

editChildren method #

func (n *CaseClause) editChildren(edit func(Node) Node)

editChildren method #

func (n *CommClause) editChildren(edit func(Node) Node)

editChildren method #

func (n *InlinedCallExpr) editChildren(edit func(Node) Node)

editChildren method #

func (n *ClosureExpr) editChildren(edit func(Node) Node)

editChildrenWithHidden method #

func (n *InterfaceSwitchStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *IndexExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *SliceExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *MakeExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *GoDeferStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *InlinedCallExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *SelectStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *StructKeyExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *IfStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *CaseClause) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *CommClause) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *ParenExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *StringHeaderExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *SliceHeaderExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *CallExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *CompLitExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *AddStringExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *Ident) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *TailCallStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *ReturnStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *InlineMarkStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *Name) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *ConvExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *JumpTableStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *StarExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *BranchStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *SwitchStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *SelectorExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *LogicalExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *typeNode) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *Decl) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *BlockStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *ForStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *KeyExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *AddrExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *UnaryExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *BinaryExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *AssignListStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *ResultExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *NilExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *DynamicType) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *BasicLit) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *TypeAssertExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *LabelStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *ClosureExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *TypeSwitchGuard) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *AssignStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *DynamicTypeAssertExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *RangeStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *Func) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *LinksymOffsetExpr) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *AssignOpStmt) editChildrenWithHidden(edit func(Node) Node)

editChildrenWithHidden method #

func (n *SendStmt) editChildrenWithHidden(edit func(Node) Node)

editCommClauses function #

func editCommClauses(list []*CommClause, edit func(Node) Node)

editNames function #

func editNames(list []*Name, edit func(Node) Node)

editNodes function #

func editNodes(list []Node, edit func(Node) Node)

ellipsisIf function #

func ellipsisIf(b bool) string

escapedImportPathOK function #

func escapedImportPathOK(r rune) bool

exprFmt function #

func exprFmt(n Node, s fmt.State, prec int)

fmtFullPos function #

fmtFullPos returns a verbose dump for pos p, including inlines.

func fmtFullPos(p src.XPos) string

fmtNode function #

fmtNode implements formatting for a Node n. Every Node implementation must define a Format method that calls fmtNode. The valid formats are: %v Go syntax %L Go syntax followed by " (type T)" if type is known. %+v Debug syntax, as in Dump.

func fmtNode(n Node, s fmt.State, verb rune)

get2 method #

func (f bitset8) get2(shift uint8) uint8

indent function #

indent prints indentation to w.

func indent(w io.Writer, depth int)

isExpr method #

func (*miniExpr) isExpr()

isExpr method #

func (n *Name) isExpr()

isStmt method #

func (*miniStmt) isStmt()

isStmt method #

func (f *Func) isStmt()

isStmt method #

func (*CallExpr) isStmt()

isStmt method #

func (*Decl) isStmt()

modPathOK function #

Borrowed from x/mod.

func modPathOK(r rune) bool

newNameAt function #

newNameAt is like NewNameAt but allows sym == nil.

func newNameAt(pos src.XPos, op Op, sym *types.Sym) *Name

newTypeNode function #

func newTypeNode(typ *types.Type) *typeNode

no method #

func (n *miniNode) no(name string) string

posOr method #

posOr returns pos if known, or else n.pos. For use in DeepCopy.

func (n *miniNode) posOr(pos src.XPos) src.XPos

printf method #

printf is a convenience wrapper.

func (p *dumper) printf(format string, args ...interface{})

set method #

func (f *bitset16) set(mask uint16, b bool)

set method #

func (f *bitset8) set(mask uint8, b bool)

set2 method #

set2 sets two bits in f using the bottom two bits of b.

func (f *bitset8) set2(shift uint8, b uint8)

setReadonly method #

func (n *Name) setReadonly(b bool)

setupTextLSym function #

setupTextLSym initializes the LSym for a with-body text symbol.

func setupTextLSym(f *Func, flag int)

splitPkg function #

splitPkg splits the full linker symbol name into package and local symbol name.

func splitPkg(name string) (pkgpath string, sym string)

splitType function #

splitType splits a local symbol name into type and method (fn). If this a free function, typ == "". N.B. closures and methods can be ambiguous (e.g., bar.func1). These cases are returned as methods.

func splitType(name string) (typ string, fn string)

staticValue1 function #

func staticValue1(nn Node) Node

staticValue1 method #

func (ro *ReassignOracle) staticValue1(nn Node) Node

stmtFmt function #

func stmtFmt(n Node, s fmt.State)

visit method #

func (v *bottomUpVisitor) visit(n *Func) uint32

Generated with Arrow