]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/walk: remove litas
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 4 May 2022 19:40:51 +0000 (02:40 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 5 May 2022 01:32:18 +0000 (01:32 +0000)
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>
src/cmd/compile/internal/walk/complit.go

index e46f828d65e266e366e941c56e4df7c38cbdfdf0..3999f697d29c19196e2edf3644087d46aa9bee0a 100644 (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