mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
ccae744f80
commit
57107f300a
1 changed files with 8 additions and 8 deletions
|
|
@ -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) {
|
||||||
|
|
||||||
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) {
|
||||||
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) {
|
||||||
// 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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue