The Alloc instruction reserves space for a variable of the given type, zero-initializes it, and yields its address.

Alloc values are always addresses, and have pointer types, so the type of the allocated variable is actually Type().Underlying().(*types.Pointer).Elem().

If Heap is false, Alloc allocates space in the function's activation record (frame); we refer to an Alloc(Heap=false) as a "local" alloc. Each local Alloc returns the same address each time it is executed within the same activation; the space is re-initialized to zero.

If Heap is true, Alloc allocates space in the heap; we refer to an Alloc(Heap=true) as a "new" alloc. Each new Alloc returns a different address each time it is executed.

When Alloc is applied to a channel, map or slice type, it returns the address of an uninitialized (nil) reference of that kind; store the result of MakeSlice, MakeMap or MakeChan in that location to instantiate these types.

Pos() returns the ast.CompositeLit.Lbrace for a composite literal, or the ast.CallExpr.Rparen for a call to new() or for a call that allocates a varargs slice.

Example printed form:

t0 = local int
t1 = new int