[dev.typeparams] cmd/compile: disambiguate OXDOT in noder using types2 Selection info

By using the types2 Selection information, we can create ODOT, ODOTPTR,
OCALLPART, ODOTMETH, ODOTINTER, and OMETHEXPR nodes directly in noder,
so we don't have to do that functionality in typecheck.go. Intermediate
nodes are created as needed for embedded fields. Don't have to typecheck
the results of g.selectorExpr(), because we set the types of all the
needed nodes.

There is one bug remaining in 'go test reflect' that will be fixed when dev.regabi is merged.

Change-Id: I4599d43197783e318610deb2f208137f9344ab63
Reviewed-on: https://go-review.googlesource.com/c/go/+/285373
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Dan Scales 2021-01-19 13:54:33 -08:00
parent f8654579cd
commit 12cd9cf7e0
5 changed files with 136 additions and 42 deletions

View file

@ -5,6 +5,7 @@
package noder
import (
"fmt"
"os"
"cmd/compile/internal/base"
@ -162,6 +163,14 @@ Outer:
for _, declList := range declLists {
g.target.Decls = append(g.target.Decls, g.decls(declList)...)
}
if base.Flag.W > 1 {
for _, n := range g.target.Decls {
s := fmt.Sprintf("\nafter noder2 %v", n)
ir.Dump(s, n)
}
}
typecheck.DeclareUniverse()
for _, p := range noders {