mirror of
https://github.com/golang/go.git
synced 2025-10-30 00:00:56 +00:00
cmd/compile: change ir.NewCompLitExpr from Ntype to *types.Type
All callers were already using TypeNode to get an Ntype anyway, so just push the TypeNode constructor down into NewCompLitExpr. Prep refactoring for next CL to remove the Ntype field. Change-Id: I671935afca707aaab11d1c46e39902bd37a485ba Reviewed-on: https://go-review.googlesource.com/c/go/+/403840 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
a6a49d128b
commit
3ffc230a9f
8 changed files with 14 additions and 15 deletions
|
|
@ -480,7 +480,7 @@ func walkAddString(n *ir.AddStringExpr, init *ir.Nodes) ir.Node {
|
|||
|
||||
t := types.NewSlice(types.Types[types.TSTRING])
|
||||
// args[1:] to skip buf arg
|
||||
slice := ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, ir.TypeNode(t), args[1:])
|
||||
slice := ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, t, args[1:])
|
||||
slice.Prealloc = n.Prealloc
|
||||
args = []ir.Node{buf, slice}
|
||||
slice.SetEsc(ir.EscNone)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue