mirror of
https://github.com/golang/go
synced 2024-11-22 20:04:47 -07:00
[dev.regabi] cmd/compile: refactor redundant type conversion [generated]
Passes toolstash -cmp. [git-generate] cd src/cmd/compile rf ' ex . '"$(printf '%s\n' ./internal/* | paste -sd' ')"' { type T interface{} var t T strict t t.(T) -> t } ' cd internal/ir go generate Change-Id: I492d50390e724a7216c3cd8b49d4aaf7d0c335da Reviewed-on: https://go-review.googlesource.com/c/go/+/280716 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
7958a23ea3
commit
1544a03198
@ -866,7 +866,7 @@ func mkinlcall(n *ir.CallExpr, fn *ir.Func, maxCost int32, inlMap map[*ir.Func]b
|
||||
vas.Y = typecheck.NodNil()
|
||||
vas.Y.SetType(param.Type)
|
||||
} else {
|
||||
lit := ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, ir.TypeNode(param.Type).(ir.Ntype), nil)
|
||||
lit := ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, ir.TypeNode(param.Type), nil)
|
||||
lit.List.Set(varargs)
|
||||
vas.Y = lit
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ func MakeDotArgs(typ *types.Type, args []ir.Node) ir.Node {
|
||||
n = NodNil()
|
||||
n.SetType(typ)
|
||||
} else {
|
||||
lit := ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, ir.TypeNode(typ).(ir.Ntype), nil)
|
||||
lit := ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, ir.TypeNode(typ), nil)
|
||||
lit.List.Append(args...)
|
||||
lit.SetImplicit(true)
|
||||
n = lit
|
||||
|
@ -1686,7 +1686,7 @@ func stringtoruneslit(n *ir.ConvExpr) ir.Node {
|
||||
i++
|
||||
}
|
||||
|
||||
nn := ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, ir.TypeNode(n.Type()).(ir.Ntype), nil)
|
||||
nn := ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, ir.TypeNode(n.Type()), nil)
|
||||
nn.List.Set(l)
|
||||
return Expr(nn)
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ func walkClosure(clo *ir.ClosureExpr, init *ir.Nodes) ir.Node {
|
||||
|
||||
typ := typecheck.ClosureType(clo)
|
||||
|
||||
clos := ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, ir.TypeNode(typ).(ir.Ntype), nil)
|
||||
clos := ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, ir.TypeNode(typ), nil)
|
||||
clos.SetEsc(clo.Esc())
|
||||
clos.List.Set(append([]ir.Node{ir.NewUnaryExpr(base.Pos, ir.OCFUNC, fn.Nname)}, closureArgs(clo)...))
|
||||
|
||||
@ -194,7 +194,7 @@ func walkCallPart(n *ir.SelectorExpr, init *ir.Nodes) ir.Node {
|
||||
|
||||
typ := typecheck.PartialCallType(n)
|
||||
|
||||
clos := ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, ir.TypeNode(typ).(ir.Ntype), nil)
|
||||
clos := ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, ir.TypeNode(typ), nil)
|
||||
clos.SetEsc(n.Esc())
|
||||
clos.List = []ir.Node{ir.NewUnaryExpr(base.Pos, ir.OCFUNC, typecheck.MethodValueWrapper(n).Nname), n.X}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user