]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/ssa/nilcheck.go
all: merge dev.inline into master
[gostls13.git] / src / cmd / compile / internal / ssa / nilcheck.go
index 0a34cd1ae642305e44a516e646413e0cf74ba20e..ac30b705e4e2830418e30f1e1145d8d40daf034c 100644 (file)
@@ -101,8 +101,8 @@ func nilcheckelim(f *Func) {
                                                // This is a redundant implicit nil check.
                                                // Logging in the style of the former compiler -- and omit line 1,
                                                // which is usually in generated code.
-                                               if f.Config.Debug_checknil() && v.Line > 1 {
-                                                       f.Config.Warnl(v.Line, "removed nil check")
+                                               if f.Config.Debug_checknil() && v.Pos.Line() > 1 {
+                                                       f.Config.Warnl(v.Pos, "removed nil check")
                                                }
                                                v.reset(OpUnknown)
                                                // TODO: f.freeValue(v)
@@ -161,8 +161,8 @@ func nilcheckelim2(f *Func) {
                for i := len(b.Values) - 1; i >= 0; i-- {
                        v := b.Values[i]
                        if opcodeTable[v.Op].nilCheck && unnecessary.contains(v.Args[0].ID) {
-                               if f.Config.Debug_checknil() && int(v.Line) > 1 {
-                                       f.Config.Warnl(v.Line, "removed nil check")
+                               if f.Config.Debug_checknil() && v.Pos.Line() > 1 {
+                                       f.Config.Warnl(v.Pos, "removed nil check")
                                }
                                v.reset(OpUnknown)
                                continue