mirror of
https://github.com/golang/go
synced 2024-11-22 14:44:50 -07:00
[dev.regabi] cmd/compile: only save ONAMEs on Curfn.Dcl
There's not really any use to tracking function-scoped constants and types on Curfn.Dcl, and there's sloppy code that assumes all of the declarations are variables (e.g., cmpstackvarlt). Change-Id: I5d10dc681dac2c161c7b73ba808403052ca0608e Reviewed-on: https://go-review.googlesource.com/c/go/+/274436 Reviewed-by: Russ Cox <rsc@golang.org> Trust: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
a17c5e2fce
commit
6ca23a45fe
@ -84,7 +84,7 @@ func declare(n *ir.Name, ctxt ir.Class) {
|
||||
base.Pos = n.Pos()
|
||||
base.Fatalf("automatic outside function")
|
||||
}
|
||||
if Curfn != nil && ctxt != ir.PFUNC {
|
||||
if Curfn != nil && ctxt != ir.PFUNC && n.Op() == ir.ONAME {
|
||||
Curfn.Dcl = append(Curfn.Dcl, n)
|
||||
}
|
||||
if n.Op() == ir.OTYPE {
|
||||
|
@ -718,5 +718,5 @@ func f44(f func() [2]*int) interface{} { // ERROR "live at entry to f44: f"
|
||||
}
|
||||
ret := T{}
|
||||
ret.s[0] = f()
|
||||
return ret // ERROR "stack object .autotmp_5 T"
|
||||
return ret // ERROR "stack object .autotmp_[0-9]+ T"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user