From 46ffbec1d6715f62c724a7180aec12ffd8acf57f Mon Sep 17 00:00:00 2001 From: Dan Scales Date: Wed, 7 Apr 2021 07:58:10 -0700 Subject: cmd/compile: break out transformations of tcCompLit into transformCompLit Create transformCompLit, which does the transformations done by tcCompLit without the typechecking. This removes the final use of the old typechecker in the noder2 pass. Other changes: - Used the transformCompLit in stringstorunelit(), which creates an OCOMPLIT that needs transformation as well. - Fixed one place in transformIndex where we were still using typecheck.AssignConv, when we should be using its equivalent noder.assignconvfn. The go/test tests always run with -G=3, and I also tested that the "go test" tests continue to run correctly with -G=3. Change-Id: I4a976534ab7311cf2a5f43841026dbf7401e62b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/308529 Trust: Dan Scales Run-TryBot: Dan Scales Reviewed-by: Robert Griesemer --- src/cmd/compile/internal/noder/expr.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/cmd/compile/internal/noder/expr.go') diff --git a/src/cmd/compile/internal/noder/expr.go b/src/cmd/compile/internal/noder/expr.go index eee39ecadb..fc97df7197 100644 --- a/src/cmd/compile/internal/noder/expr.go +++ b/src/cmd/compile/internal/noder/expr.go @@ -346,8 +346,9 @@ func (g *irgen) compLit(typ types2.Type, lit *syntax.CompositeLit) ir.Node { } } - // TODO(mdempsky): Remove dependency on typecheck.Expr. - return typecheck.Expr(ir.NewCompLitExpr(g.pos(lit), ir.OCOMPLIT, ir.TypeNode(g.typ(typ)), exprs)) + n := ir.NewCompLitExpr(g.pos(lit), ir.OCOMPLIT, nil, exprs) + typed(g.typ(typ), n) + return transformCompLit(n) } func (g *irgen) funcLit(typ2 types2.Type, expr *syntax.FuncLit) ir.Node { -- cgit v1.3