]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] cmd/compile: suppress liveness diagnostics of wrappers
authorMatthew Dempsky <mdempsky@google.com>
Thu, 24 Jun 2021 19:57:20 +0000 (12:57 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 24 Jun 2021 20:28:44 +0000 (20:28 +0000)
Similar to the previous CL to suppress escape analysis diagnostics for
method wrappers, suppress liveness analysis diagnostics too. It's
hardly useful to know that all of a wrapper method's arguments are
live at entry.

Change-Id: I0d1e44552c6334ee3b454adc107430232abcb56a
Reviewed-on: https://go-review.googlesource.com/c/go/+/330749
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/liveness/plive.go
test/live.go
test/live_regabi.go

index f5c2ef7709e515c376cc181c8e338bd51a1b33d8..2705eac4f7b9b8f4316b2e2e44efe9d589e08ef0 100644 (file)
@@ -1082,6 +1082,10 @@ func (lv *liveness) showlive(v *ssa.Value, live bitvec.BitVec) {
        if base.Flag.Live == 0 || ir.FuncName(lv.fn) == "init" || strings.HasPrefix(ir.FuncName(lv.fn), ".") {
                return
        }
+       if lv.fn.Wrapper() || lv.fn.Dupok() {
+               // Skip reporting liveness information for compiler-generated wrappers.
+               return
+       }
        if !(v == nil || v.Op.IsCall()) {
                // Historically we only printed this information at
                // calls. Keep doing so.
index 5b14932cae91bf2add82bdad54c98a6711aa0dfd..856e56f3d290975d1241295e7a114808fe5d7539 100644 (file)
@@ -688,7 +688,7 @@ type T struct{}
 
 func (*T) Foo(ptr *int) {}
 
-type R struct{ *T } // ERRORAUTO "live at entry to \(\*R\)\.Foo: \.this ptr" "live at entry to R\.Foo: \.this ptr"
+type R struct{ *T }
 
 // issue 18860: output arguments must be live all the time if there is a defer.
 // In particular, at printint r must be live.
index c35a27e4e08cbf60ad68bdef1e25ad8b1cfa0639..d362ee287d01cf388816eb31e93303ac14dc4011 100644 (file)
@@ -683,7 +683,7 @@ type T struct{}
 
 func (*T) Foo(ptr *int) {}
 
-type R struct{ *T } // ERRORAUTO "live at entry to \(\*R\)\.Foo: \.this ptr" "live at entry to R\.Foo: \.this ptr"
+type R struct{ *T }
 
 // issue 18860: output arguments must be live all the time if there is a defer.
 // In particular, at printint r must be live.