From c74aa39f47840a36ddf10cfac96a2c49bd0786f1 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Tue, 13 Mar 2018 12:58:56 -0700 Subject: [PATCH] cmd/compile: eliminate mkinlcall's isddd parameter These are always set to n.Isddd(), which is readily available within mkinlcall. Change-Id: I3d7fbc9dc19a40d6b905691c666eee9bcd031a00 Reviewed-on: https://go-review.googlesource.com/100455 Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/compile/internal/gc/inl.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go index f6ba430045..3e5b576f82 100644 --- a/src/cmd/compile/internal/gc/inl.go +++ b/src/cmd/compile/internal/gc/inl.go @@ -603,12 +603,12 @@ func inlnode(n *Node) *Node { fmt.Printf("%v:call to func %+v\n", n.Line(), n.Left) } if n.Left.Func != nil && n.Left.Func.Inl.Len() != 0 && !isIntrinsicCall(n) { // normal case - n = mkinlcall(n, n.Left, n.Isddd()) + n = mkinlcall(n, n.Left) } else if n.Left.isMethodExpression() && asNode(n.Left.Sym.Def) != nil { - n = mkinlcall(n, asNode(n.Left.Sym.Def), n.Isddd()) + n = mkinlcall(n, asNode(n.Left.Sym.Def)) } else if n.Left.Op == OCLOSURE { if f := inlinableClosure(n.Left); f != nil { - n = mkinlcall(n, f, n.Isddd()) + n = mkinlcall(n, f) } } else if n.Left.Op == ONAME && n.Left.Name != nil && n.Left.Name.Defn != nil { if d := n.Left.Name.Defn; d.Op == OAS && d.Right.Op == OCLOSURE { @@ -634,7 +634,7 @@ func inlnode(n *Node) *Node { } break } - n = mkinlcall(n, f, n.Isddd()) + n = mkinlcall(n, f) } } } @@ -653,7 +653,7 @@ func inlnode(n *Node) *Node { Fatalf("no function definition for [%p] %+v\n", n.Left.Type, n.Left.Type) } - n = mkinlcall(n, asNode(n.Left.Type.FuncType().Nname), n.Isddd()) + n = mkinlcall(n, asNode(n.Left.Type.FuncType().Nname)) } lineno = lno @@ -754,7 +754,7 @@ func (v *reassignVisitor) visitList(l Nodes) *Node { // The result of mkinlcall MUST be assigned back to n, e.g. // n.Left = mkinlcall(n.Left, fn, isddd) -func mkinlcall(n *Node, fn *Node, isddd bool) *Node { +func mkinlcall(n *Node, fn *Node) *Node { save_safemode := safemode // imported functions may refer to unsafe as long as the @@ -764,7 +764,7 @@ func mkinlcall(n *Node, fn *Node, isddd bool) *Node { if pkg != localpkg && pkg != nil { safemode = false } - n = mkinlcall1(n, fn, isddd) + n = mkinlcall1(n, fn) safemode = save_safemode return n } @@ -790,7 +790,7 @@ var inlgen int // parameters. // The result of mkinlcall1 MUST be assigned back to n, e.g. // n.Left = mkinlcall1(n.Left, fn, isddd) -func mkinlcall1(n, fn *Node, isddd bool) *Node { +func mkinlcall1(n, fn *Node) *Node { if fn.Func.Inl.Len() == 0 { // No inlinable body. return n @@ -958,7 +958,7 @@ func mkinlcall1(n, fn *Node, isddd bool) *Node { // For ordinary parameters or variadic parameters in // dotted calls, just add the variable to the // assignment list, and we're done. - if !param.Isddd() || isddd { + if !param.Isddd() || n.Isddd() { as.List.Append(tinlvar(param, inlvars)) continue }