From 2cdb7f118ab86adb6fef5485d96831df3446b747 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 16 Mar 2017 22:42:10 -0700 Subject: cmd/compile: move Frontend field from ssa.Config to ssa.Func Suggested by mdempsky in CL 38232. This allows us to use the Frontend field to associate frontend state and information with a function. See the following CL in the series for examples. This is a giant CL, but it is almost entirely routine refactoring. The ssa test API is starting to feel a bit unwieldy. I will clean it up separately, once the dust has settled. Passes toolstash -cmp. Updates #15756 Change-Id: I71c573bd96ff7251935fce1391b06b1f133c3caf Reviewed-on: https://go-review.googlesource.com/38327 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/ssa/loopbce.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/cmd/compile/internal/ssa/loopbce.go') diff --git a/src/cmd/compile/internal/ssa/loopbce.go b/src/cmd/compile/internal/ssa/loopbce.go index 0f356913ca..a96d98717d 100644 --- a/src/cmd/compile/internal/ssa/loopbce.go +++ b/src/cmd/compile/internal/ssa/loopbce.go @@ -139,9 +139,9 @@ nextb: if f.pass.debug > 1 { if min.Op == OpConst64 { - b.Func.Config.Warnl(b.Pos, "Induction variable with minimum %d and increment %d", min.AuxInt, inc.AuxInt) + b.Func.Warnl(b.Pos, "Induction variable with minimum %d and increment %d", min.AuxInt, inc.AuxInt) } else { - b.Func.Config.Warnl(b.Pos, "Induction variable with non-const minimum and increment %d", inc.AuxInt) + b.Func.Warnl(b.Pos, "Induction variable with non-const minimum and increment %d", inc.AuxInt) } } @@ -205,7 +205,7 @@ func removeBoundsChecks(f *Func, m map[*Value]indVar) { if iv, has := m[ind]; has && sdom.isAncestorEq(iv.entry, b) && isNonNegative(iv.min) { if v.Args[1] == iv.max { if f.pass.debug > 0 { - f.Config.Warnl(b.Pos, "Found redundant %s", v.Op) + f.Warnl(b.Pos, "Found redundant %s", v.Op) } goto simplify } @@ -232,7 +232,7 @@ func removeBoundsChecks(f *Func, m map[*Value]indVar) { if iv, has := m[ind]; has && sdom.isAncestorEq(iv.entry, b) && isNonNegative(iv.min) { if v.Args[1].Op == OpSliceCap && iv.max.Op == OpSliceLen && v.Args[1].Args[0] == iv.max.Args[0] { if f.pass.debug > 0 { - f.Config.Warnl(b.Pos, "Found redundant %s (len promoted to cap)", v.Op) + f.Warnl(b.Pos, "Found redundant %s (len promoted to cap)", v.Op) } goto simplify } @@ -263,7 +263,7 @@ func removeBoundsChecks(f *Func, m map[*Value]indVar) { if max := iv.max.AuxInt + add; 0 <= max && max <= limit { // handle overflow if f.pass.debug > 0 { - f.Config.Warnl(b.Pos, "Found redundant (%s ind %d), ind < %d", v.Op, v.Args[1].AuxInt, iv.max.AuxInt+add) + f.Warnl(b.Pos, "Found redundant (%s ind %d), ind < %d", v.Op, v.Args[1].AuxInt, iv.max.AuxInt+add) } goto simplify } -- cgit v1.3