mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.regabi] cmd/compile: add Name.Canonical and move Byval
There's a bunch of code that wants to map closure variables back to their original name, so add a single Name.Canonical method that they can all use. Also, move the Byval flag from being stored on individual closure variables to being stored on the canonical variable. Passes toolstash -cmp. Change-Id: Ia3ef81af5a15783d09f04b4e274ce33df94518e6 Reviewed-on: https://go-review.googlesource.com/c/go/+/281541 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
e09783cbc0
commit
77365c5ed7
5 changed files with 37 additions and 32 deletions
|
|
@ -127,10 +127,7 @@ func Info(fnsym *obj.LSym, infosym *obj.LSym, curfn interface{}) ([]dwarf.Scope,
|
|||
}
|
||||
|
||||
func declPos(decl *ir.Name) src.XPos {
|
||||
if decl.IsClosureVar() {
|
||||
decl = decl.Defn.(*ir.Name)
|
||||
}
|
||||
return decl.Pos()
|
||||
return decl.Canonical().Pos()
|
||||
}
|
||||
|
||||
// createDwarfVars process fn, returning a list of DWARF variables and the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue