mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: convert Node.Embedded into a flag
Change-Id: I30c59ba84dcacc3de39c42f94484b47bb7c36eba Reviewed-on: https://go-review.googlesource.com/41792 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
7a92395ddd
commit
af7da9a53b
3 changed files with 12 additions and 6 deletions
|
|
@ -570,7 +570,7 @@ func structfield(n *Node) *types.Field {
|
|||
if n.Left != nil {
|
||||
n.Left.Type = n.Type
|
||||
}
|
||||
if n.Embedded != 0 {
|
||||
if n.Embedded() {
|
||||
checkembeddedtype(n.Type)
|
||||
}
|
||||
}
|
||||
|
|
@ -593,7 +593,11 @@ func structfield(n *Node) *types.Field {
|
|||
|
||||
if n.Left != nil && n.Left.Op == ONAME {
|
||||
f.Nname = asTypesNode(n.Left)
|
||||
f.Embedded = n.Embedded
|
||||
if n.Embedded() {
|
||||
f.Embedded = 1
|
||||
} else {
|
||||
f.Embedded = 0
|
||||
}
|
||||
f.Sym = asNode(f.Nname).Sym
|
||||
}
|
||||
|
||||
|
|
@ -779,7 +783,7 @@ func embedded(s *types.Sym, pkg *types.Pkg) *Node {
|
|||
n = newname(s.Pkg.Lookup(name))
|
||||
}
|
||||
n = nod(ODCLFIELD, n, oldname(s))
|
||||
n.Embedded = 1
|
||||
n.SetEmbedded(true)
|
||||
return n
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue