Commit 57107f30 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: use local fn variable in compile

fn == Curfn in this context. Prefer the local variable.

Passes toolstash -cmp. Updates #15756.

Change-Id: I75b589c682d0c1b524cac2bbf2bba368a6027b06
Reviewed-on: https://go-review.googlesource.com/38151
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent ccae744f
...@@ -321,7 +321,7 @@ func compile(fn *Node) { ...@@ -321,7 +321,7 @@ func compile(fn *Node) {
}(setlineno(fn)) }(setlineno(fn))
Curfn = fn Curfn = fn
dowidth(Curfn.Type) dowidth(fn.Type)
if fn.Nbody.Len() == 0 { if fn.Nbody.Len() == 0 {
if pure_go || strings.HasPrefix(fn.Func.Nname.Sym.Name, "init.") { if pure_go || strings.HasPrefix(fn.Func.Nname.Sym.Name, "init.") {
...@@ -335,25 +335,25 @@ func compile(fn *Node) { ...@@ -335,25 +335,25 @@ func compile(fn *Node) {
saveerrors() saveerrors()
order(Curfn) order(fn)
if nerrors != 0 { if nerrors != 0 {
return return
} }
hasdefer = false hasdefer = false
walk(Curfn) walk(fn)
if nerrors != 0 { if nerrors != 0 {
return return
} }
if instrumenting { if instrumenting {
instrument(Curfn) instrument(fn)
} }
if nerrors != 0 { if nerrors != 0 {
return return
} }
// Build an SSA backend function. // Build an SSA backend function.
ssafn := buildssa(Curfn) ssafn := buildssa(fn)
if nerrors != 0 { if nerrors != 0 {
return return
} }
...@@ -363,9 +363,9 @@ func compile(fn *Node) { ...@@ -363,9 +363,9 @@ func compile(fn *Node) {
Clearp(pc) Clearp(pc)
plist.Firstpc = pc plist.Firstpc = pc
setlineno(Curfn) setlineno(fn)
nam := Curfn.Func.Nname nam := fn.Func.Nname
if isblank(nam) { if isblank(nam) {
nam = nil nam = nil
} }
...@@ -402,7 +402,7 @@ func compile(fn *Node) { ...@@ -402,7 +402,7 @@ func compile(fn *Node) {
// See test/recover.go for test cases and src/reflect/value.go // See test/recover.go for test cases and src/reflect/value.go
// for the actual functions being considered. // for the actual functions being considered.
if myimportpath == "reflect" { if myimportpath == "reflect" {
if Curfn.Func.Nname.Sym.Name == "callReflect" || Curfn.Func.Nname.Sym.Name == "callMethod" { if fn.Func.Nname.Sym.Name == "callReflect" || fn.Func.Nname.Sym.Name == "callMethod" {
ptxt.From3.Offset |= obj.WRAPPER ptxt.From3.Offset |= obj.WRAPPER
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment