Change-Id: I7ca075e50d144aa449a20ebfbaf7337406e1e510
Reviewed-on: https://go-review.googlesource.com/c/go/+/204161
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
package gc
import (
+ "cmd/compile/internal/logopt"
"cmd/compile/internal/types"
"fmt"
"math"
// Update n.Esc based on escape analysis results.
if loc.escapes {
- if Debug['m'] != 0 && n.Op != ONAME {
- Warnl(n.Pos, "%S escapes to heap", n)
+ if n.Op != ONAME {
+ if Debug['m'] != 0 {
+ Warnl(n.Pos, "%S escapes to heap", n)
+ }
+ if logopt.Enabled() {
+ logopt.LogOpt(n.Pos, "escape", "escape", e.curfn.funcname())
+ }
}
n.Esc = EscHeap
addrescapes(n)