1
0
mirror of https://github.com/golang/go synced 2024-09-29 12:14:28 -06:00

cmd/compile/internal/walk: remove litas

Since when its only usage is in maplit, and its body is simple enough to
be inlined directly at the caller side.

Change-Id: Id6b8a9d230d0e1e7f8da8d33bbc0073d3e816fb5
Reviewed-on: https://go-review.googlesource.com/c/go/+/403998
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
Cuong Manh Le 2022-05-05 02:40:51 +07:00
parent aeb933d3ff
commit b922055572

View File

@ -72,10 +72,6 @@ func isSimpleName(nn ir.Node) bool {
return n.OnStack()
}
func litas(l ir.Node, r ir.Node, init *ir.Nodes) {
appendWalkStmt(init, ir.NewAssignStmt(base.Pos, l, r))
}
// initGenType is a bitmap indicating the types of generation that will occur for a static value.
type initGenType uint8
@ -420,7 +416,7 @@ func maplit(n *ir.CompLitExpr, m ir.Node, init *ir.Nodes) {
a := ir.NewCallExpr(base.Pos, ir.OMAKE, nil, nil)
a.SetEsc(n.Esc())
a.Args = []ir.Node{ir.TypeNode(n.Type()), ir.NewInt(n.Len + int64(len(n.List)))}
litas(m, a, init)
appendWalkStmt(init, ir.NewAssignStmt(base.Pos, m, a))
entries := n.List