mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.regabi] cmd/compile: add ir.NewDeclNameAt
This allows directly creating an ONONAME, which is a primordial Name before having its Op initialized. Then after an Op is assigned, we never allow it to be reassigned. Passes buildall w/ toolstash -cmp. Change-Id: Ibc2f413dc68c0af6a96abfe653c25ce31b184287 Reviewed-on: https://go-review.googlesource.com/c/go/+/274620 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
c10b0ad628
commit
c769d393de
8 changed files with 28 additions and 47 deletions
|
|
@ -371,7 +371,8 @@ func staticname(t *types.Type) ir.Node {
|
|||
// Don't use lookupN; it interns the resulting string, but these are all unique.
|
||||
n := NewName(lookup(fmt.Sprintf("%s%d", obj.StaticNamePref, statuniqgen)))
|
||||
statuniqgen++
|
||||
addvar(n, t, ir.PEXTERN)
|
||||
declare(n, ir.PEXTERN)
|
||||
n.SetType(t)
|
||||
n.Sym().Linksym().Set(obj.AttrLocal, true)
|
||||
return n
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue