Skip to content

Commit

Permalink
cmd/compile/internal/walk: remove litas
Browse files Browse the repository at this point in the history
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 <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Run-TryBot: Cuong Manh Le <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
  • Loading branch information
cuonglm committed May 5, 2022
1 parent aeb933d commit b922055
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/cmd/compile/internal/walk/complit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b922055

Please sign in to comment.