mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] cmd/compile: directly set some simple expression types
This CL updates irgen to directly set the type for a bunch of basic expressions that are easy to handle already. Trickier rewrites are still handled with typecheck.Expr, but responsibility of calling that is pushed down to the conversion of individual operations. Change-Id: I774ac6ab4c72ad854860ab5c741867dd42a066b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/285058 Trust: Matthew Dempsky <mdempsky@google.com> Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
455c29af83
commit
2427f6e6c0
5 changed files with 90 additions and 39 deletions
|
|
@ -103,6 +103,10 @@ func (g *irgen) generate(noders []*noder) {
|
|||
types.LocalPkg.Name = g.self.Name()
|
||||
typecheck.TypecheckAllowed = true
|
||||
|
||||
// Prevent size calculations until we set the underlying type
|
||||
// for all package-block defined types.
|
||||
types.DeferCheckSize()
|
||||
|
||||
// At this point, types2 has already handled name resolution and
|
||||
// type checking. We just need to map from its object and type
|
||||
// representations to those currently used by the rest of the
|
||||
|
|
@ -152,6 +156,7 @@ Outer:
|
|||
}
|
||||
}
|
||||
}
|
||||
types.ResumeCheckSize()
|
||||
|
||||
// 3. Process all remaining declarations.
|
||||
for _, declList := range declLists {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue