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))
|
||||
|
||||
Curfn = fn
|
||||
dowidth(Curfn.Type)
|
||||
dowidth(fn.Type)
|
||||
|
||||
if fn.Nbody.Len() == 0 {
|
||||
if pure_go || strings.HasPrefix(fn.Func.Nname.Sym.Name, "init.") {
|
||||
|
|
@ -335,25 +335,25 @@ func compile(fn *Node) {
|
|||
|
||||
saveerrors()
|
||||
|
||||
order(Curfn)
|
||||
order(fn)
|
||||
if nerrors != 0 {
|
||||
return
|
||||
}
|
||||
|
||||
hasdefer = false
|
||||
walk(Curfn)
|
||||
walk(fn)
|
||||
if nerrors != 0 {
|
||||
return
|
||||
}
|
||||
if instrumenting {
|
||||
instrument(Curfn)
|
||||
instrument(fn)
|
||||
}
|
||||
if nerrors != 0 {
|
||||
return
|
||||
}
|
||||
|
||||
// Build an SSA backend function.
|
||||
ssafn := buildssa(Curfn)
|
||||
ssafn := buildssa(fn)
|
||||
if nerrors != 0 {
|
||||
return
|
||||
}
|
||||
|
|
@ -363,9 +363,9 @@ func compile(fn *Node) {
|
|||
Clearp(pc)
|
||||
plist.Firstpc = pc
|
||||
|
||||
setlineno(Curfn)
|
||||
setlineno(fn)
|
||||
|
||||
nam := Curfn.Func.Nname
|
||||
nam := fn.Func.Nname
|
||||
if isblank(nam) {
|
||||
nam = nil
|
||||
}
|
||||
|
|
@ -402,7 +402,7 @@ func compile(fn *Node) {
|
|||
// See test/recover.go for test cases and src/reflect/value.go
|
||||
// for the actual functions being considered.
|
||||
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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue