pragma := fun.Pragma
f.Func.Pragma = fun.Pragma
- f.SetNoescape(pragma&Noescape != 0)
if pragma&Systemstack != 0 && pragma&Nosplit != 0 {
yyerrorl(f.Pos, "go:nosplit and go:systemstack cannot be combined")
}
p.funcBody(f, fun.Body)
if fun.Body != nil {
- if f.Noescape() {
+ if f.Func.Pragma&Noescape != 0 {
yyerrorl(f.Pos, "can only use //go:noescape with external func implementations")
}
} else {
}
case OCLOSURE:
- if n.Noescape() && n.Func.Closure.Func.Cvars.Len() > 0 {
+ if n.Transient() && n.Func.Closure.Func.Cvars.Len() > 0 {
prealloc[n] = o.newTemp(closureType(n), false)
}
n.Right = o.expr(n.Right, nil)
o.exprList(n.List)
o.exprList(n.Rlist)
- if n.Noescape() {
+ if n.Transient() {
var t *types.Type
switch n.Op {
case OSLICELIT:
}
case ODDDARG:
- if n.Noescape() {
+ if n.Transient() {
// The ddd argument does not live beyond the call it is created for.
// Allocate a temporary that will be cleaned up when this statement
// completes. We could be more aggressive and try to arrange for it
_, nodeDiag // already printed error about this
_, nodeColas // OAS resulting from :=
_, nodeNonNil // guaranteed to be non-nil
- _, nodeNoescape // func arguments do not escape; TODO(rsc): move Noescape to Func struct (see CL 7360)
+ _, nodeTransient // storage can be reused immediately after this statement
_, nodeBounded // bounds check unnecessary
_, nodeAddable // addressable
_, nodeHasCall // expression contains a function call
func (n *Node) Diag() bool { return n.flags&nodeDiag != 0 }
func (n *Node) Colas() bool { return n.flags&nodeColas != 0 }
func (n *Node) NonNil() bool { return n.flags&nodeNonNil != 0 }
-func (n *Node) Noescape() bool { return n.flags&nodeNoescape != 0 }
+func (n *Node) Transient() bool { return n.flags&nodeTransient != 0 }
func (n *Node) Bounded() bool { return n.flags&nodeBounded != 0 }
func (n *Node) Addable() bool { return n.flags&nodeAddable != 0 }
func (n *Node) HasCall() bool { return n.flags&nodeHasCall != 0 }
func (n *Node) SetDiag(b bool) { n.flags.set(nodeDiag, b) }
func (n *Node) SetColas(b bool) { n.flags.set(nodeColas, b) }
func (n *Node) SetNonNil(b bool) { n.flags.set(nodeNonNil, b) }
-func (n *Node) SetNoescape(b bool) { n.flags.set(nodeNoescape, b) }
+func (n *Node) SetTransient(b bool) { n.flags.set(nodeTransient, b) }
func (n *Node) SetBounded(b bool) { n.flags.set(nodeBounded, b) }
func (n *Node) SetAddable(b bool) { n.flags.set(nodeAddable, b) }
func (n *Node) SetHasCall(b bool) { n.flags.set(nodeHasCall, b) }