mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] cmd/compile/internal/gc: provide types2 selection info to noder
Change-Id: I231e3a1c9f663e2a63c0ad73d571c7a00005f50b Reviewed-on: https://go-review.googlesource.com/c/go/+/278092 Trust: Robert Griesemer <gri@golang.org> Trust: Dan Scales <danscales@google.com> Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Dan Scales <danscales@google.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
c8e73489c3
commit
5aff757efc
1 changed files with 9 additions and 3 deletions
|
|
@ -117,6 +117,7 @@ func parseFiles(filenames []string) (lines uint) {
|
||||||
Types: make(map[syntax.Expr]types2.TypeAndValue),
|
Types: make(map[syntax.Expr]types2.TypeAndValue),
|
||||||
Defs: make(map[*syntax.Name]types2.Object),
|
Defs: make(map[*syntax.Name]types2.Object),
|
||||||
Uses: make(map[*syntax.Name]types2.Object),
|
Uses: make(map[*syntax.Name]types2.Object),
|
||||||
|
Selections: make(map[*syntax.SelectorExpr]*types2.Selection),
|
||||||
// expand as needed
|
// expand as needed
|
||||||
}
|
}
|
||||||
conf.Check(base.Ctxt.Pkgpath, files, &info)
|
conf.Check(base.Ctxt.Pkgpath, files, &info)
|
||||||
|
|
@ -283,6 +284,11 @@ func (p *noder) use(x *syntax.Name) types2.Object {
|
||||||
return p.typeInfo.Uses[x]
|
return p.typeInfo.Uses[x]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sel returns the selection information for the given selector expression.
|
||||||
|
func (p *noder) sel(x *syntax.SelectorExpr) *types2.Selection {
|
||||||
|
return p.typeInfo.Selections[x]
|
||||||
|
}
|
||||||
|
|
||||||
func (p *noder) funcBody(fn *ir.Func, block *syntax.BlockStmt) {
|
func (p *noder) funcBody(fn *ir.Func, block *syntax.BlockStmt) {
|
||||||
oldScope := p.scope
|
oldScope := p.scope
|
||||||
p.scope = 0
|
p.scope = 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue