go/src/cmd/compile/internal/ir/node.go

type Node

// 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 {}

func IsSynthetic(n Node) bool {}

// 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 {}

// 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 {}

type InitNode

func TakeInit(n Node) Nodes {}

type Op

const OXXX

const ONAME

const ONONAME

const OTYPE

const OLITERAL

const ONIL

const OADD

const OSUB

const OOR

const OXOR

const OADDSTR

const OADDR

const OANDAND

const OAPPEND

const OBYTES2STR

const OBYTES2STRTMP

const ORUNES2STR

const OSTR2BYTES

const OSTR2BYTESTMP

const OSTR2RUNES

const OSLICE2ARR

const OSLICE2ARRPTR

const OAS

const OAS2

const OAS2DOTTYPE

const OAS2FUNC

const OAS2MAPR

const OAS2RECV

const OASOP

const OCALL

const OCALLFUNC

const OCALLMETH

const OCALLINTER

const OCAP

const OCLEAR

const OCLOSE

const OCLOSURE

const OCOMPLIT

const OMAPLIT

const OSTRUCTLIT

const OARRAYLIT

const OSLICELIT

const OPTRLIT

const OCONV

const OCONVIFACE

const OCONVNOP

const OCOPY

const ODCL

const ODCLFUNC

const ODELETE

const ODOT

const ODOTPTR

const ODOTMETH

const ODOTINTER

const OXDOT

const ODOTTYPE

const ODOTTYPE2

const OEQ

const ONE

const OLT

const OLE

const OGE

const OGT

const ODEREF

const OINDEX

const OINDEXMAP

const OKEY

const OSTRUCTKEY

const OLEN

const OMAKE

const OMAKECHAN

const OMAKEMAP

const OMAKESLICE

const OMAKESLICECOPY

const OMUL

const ODIV

const OMOD

const OLSH

const ORSH

const OAND

const OANDNOT

const ONEW

const ONOT

const OBITNOT

const OPLUS

const ONEG

const OOROR

const OPANIC

const OPRINT

const OPRINTLN

const OPAREN

const OSEND

const OSLICE

const OSLICEARR

const OSLICESTR

const OSLICE3

const OSLICE3ARR

const OSLICEHEADER

const OSTRINGHEADER

const ORECOVER

const ORECOVERFP

const ORECV

const ORUNESTR

const OSELRECV2

const OMIN

const OMAX

const OREAL

const OIMAG

const OCOMPLEX

const OUNSAFEADD

const OUNSAFESLICE

const OUNSAFESLICEDATA

const OUNSAFESTRING

const OUNSAFESTRINGDATA

const OMETHEXPR

const OMETHVALUE

const OBLOCK

const OBREAK

const OCASE

const OCONTINUE

const ODEFER

const OFALL

const OFOR

const OGOTO

const OIF

const OLABEL

const OGO

const ORANGE

const ORETURN

const OSELECT

const OSWITCH

const OTYPESW

const OINLCALL

const OMAKEFACE

const OITAB

const OIDATA

const OSPTR

const OCFUNC

const OCHECKNIL

const ORESULT

const OINLMARK

const OLINKSYMOFFSET

const OJUMPTABLE

const OINTERFACESWITCH

const ODYNAMICDOTTYPE

const ODYNAMICDOTTYPE2

const ODYNAMICTYPE

const OTAILCALL

const OGETG

const OGETCALLERSP

const OEND

// IsCmp reports whether op is a comparison operation (==, !=, <, <=,
// >, or >=).
func (op Op) IsCmp() bool {}

type Nodes

// ToNodes returns s as a slice of Nodes.
func ToNodes[T Node](s []T) Nodes {}

// Append appends entries to Nodes.
func (n *Nodes) Append(a ...Node) {}

// Prepend prepends entries to Nodes.
// If a slice is passed in, this will take ownership of it.
func (n *Nodes) Prepend(a ...Node) {}

// Take clears n, returning its former contents.
func (n *Nodes) Take() []Node {}

// Copy returns a copy of the content of the slice.
func (n Nodes) Copy() Nodes {}

type NameQueue

// Empty reports whether q contains no Names.
func (q *NameQueue) Empty() bool {}

// PushRight appends n to the right of the queue.
func (q *NameQueue) PushRight(n *Name) {}

// PopLeft pops a Name from the left of the queue. It panics if q is
// empty.
func (q *NameQueue) PopLeft() *Name {}

type NameSet

// Has reports whether s contains n.
func (s NameSet) Has(n *Name) bool {}

// Add adds n to s.
func (s *NameSet) Add(n *Name) {}

type PragmaFlag

const Nointerface

const Noescape

const Norace

const Nosplit

const Noinline

const NoCheckPtr

const CgoUnsafeArgs

const UintptrKeepAlive

const UintptrEscapes

const Systemstack

const Nowritebarrier

const Nowritebarrierrec

const Yeswritebarrierrec

const GoBuildPragma

const RegisterParams

var BlankNode

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

// IsNil reports whether n represents the universal untyped zero value "nil".
func IsNil(n Node) bool {}

func IsBlank(n Node) bool {}

// IsMethod reports whether n is a method.
// n must be a function or a method.
func IsMethod(n Node) bool {}

// 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 {}

func SetPos(n Node) src.XPos {}

// 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 {}

// what's the outer value that a write to n affects?
// outer value means containing struct or array.
func OuterValue(n Node) Node {}

const EscUnknown

const EscNone

const EscHeap

const EscNever