go/src/cmd/compile/internal/walk/complit.go

// walkCompLit walks a composite literal node:
// OARRAYLIT, OSLICELIT, OMAPLIT, OSTRUCTLIT (all CompLitExpr), or OPTRLIT (AddrExpr).
func walkCompLit(n ir.Node, init *ir.Nodes) ir.Node {}

type initContext

const inInitFunction

const inNonInitFunction

func (c initContext) String() string {}

// readonlystaticname returns a name backed by a read-only static data symbol.
func readonlystaticname(t *types.Type) *ir.Name {}

func isSimpleName(nn ir.Node) bool {}

type initGenType

const initDynamic

const initConst

// getdyn calculates the initGenType for n.
// If top is false, getdyn is recursing.
func getdyn(n ir.Node, top bool) initGenType {}

// isStaticCompositeLiteral reports whether n is a compile-time constant.
func isStaticCompositeLiteral(n ir.Node) bool {}

type initKind

const initKindStatic

const initKindDynamic

const initKindLocalCode

// fixedlit handles struct, array, and slice literals.
// TODO: expand documentation.
func fixedlit(ctxt initContext, kind initKind, n *ir.CompLitExpr, var_ ir.Node, init *ir.Nodes) {}

func isSmallSliceLit(n *ir.CompLitExpr) bool {}

func slicelit(ctxt initContext, n *ir.CompLitExpr, var_ ir.Node, init *ir.Nodes) {}

func maplit(n *ir.CompLitExpr, m ir.Node, init *ir.Nodes) {}

func anylit(n ir.Node, var_ ir.Node, init *ir.Nodes) {}

// oaslit handles special composite literal assignments.
// It returns true if n's effects have been added to init,
// in which case n should be dropped from the program by the caller.
func oaslit(n *ir.AssignStmt, init *ir.Nodes) bool {}

func genAsStatic(as *ir.AssignStmt) {}