From 137f0d2e06523f6daf808ea09e77e68d8944a85a Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Sun, 27 Dec 2020 10:48:10 -0800 Subject: [PATCH] [dev.regabi] cmd/compile: remove unnecessary Name.Sym call Since the introduction of ir.BasicLit, we no longer create Names without Syms. Passes toolstash -cmp. Change-Id: I82de3fd65455e3756ff56e52febb512c0a2128f2 Reviewed-on: https://go-review.googlesource.com/c/go/+/280512 Trust: Matthew Dempsky Run-TryBot: Matthew Dempsky TryBot-Result: Go Bot Reviewed-by: Cuong Manh Le --- src/cmd/compile/internal/typecheck/func.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cmd/compile/internal/typecheck/func.go b/src/cmd/compile/internal/typecheck/func.go index 50f514a6db..a9d92c668c 100644 --- a/src/cmd/compile/internal/typecheck/func.go +++ b/src/cmd/compile/internal/typecheck/func.go @@ -527,9 +527,7 @@ func tcCall(n *ir.CallExpr, top int) ir.Node { default: n.SetOp(ir.OCALLFUNC) if t.Kind() != types.TFUNC { - // TODO(mdempsky): Remove "o.Sym() != nil" once we stop - // using ir.Name for numeric literals. - if o := ir.Orig(l); o.Name() != nil && o.Sym() != nil && types.BuiltinPkg.Lookup(o.Sym().Name).Def != nil { + if o := ir.Orig(l); o.Name() != nil && types.BuiltinPkg.Lookup(o.Sym().Name).Def != nil { // be more specific when the non-function // name matches a predeclared function base.Errorf("cannot call non-function %L, declared at %s", -- 2.48.1