1
0
mirror of https://github.com/golang/go synced 2024-11-11 18:31:38 -07:00

[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 <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
Matthew Dempsky 2020-12-27 10:48:10 -08:00
parent 3383b5c74a
commit 137f0d2e06

View File

@ -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",