]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix comment that -N does not disable escape analysis
authorCherry Zhang <cherryyz@google.com>
Fri, 17 Nov 2017 15:03:55 +0000 (10:03 -0500)
committerCherry Zhang <cherryyz@google.com>
Tue, 21 Nov 2017 18:09:37 +0000 (18:09 +0000)
-N does not disable escape analysis. Remove the outdated comment.

Change-Id: I96978b3afd51324b7b4f8035cf4417fb2eac4ebc
Reviewed-on: https://go-review.googlesource.com/79015
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/esc.go

index d46a42239e57f484826868fede82a4904a44fdf5..7ef07961deadb07a1fef497d81096d8917e6259e 100644 (file)
@@ -173,12 +173,6 @@ func (v *bottomUpVisitor) visitcode(n *Node, min uint32) uint32 {
 // then the value can stay on the stack. If the value new(T) does
 // not escape, then new(T) can be rewritten into a stack allocation.
 // The same is true of slice literals.
-//
-// If optimizations are disabled (-N), this code is not used.
-// Instead, the compiler assumes that any value whose address
-// is taken without being immediately dereferenced
-// needs to be moved to the heap, and new(T) and slice
-// literals are always real allocations.
 
 func escapes(all []*Node) {
        visitBottomUp(all, escAnalyze)