mirror of
https://github.com/golang/go
synced 2024-11-14 05:50:27 -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:
parent
3383b5c74a
commit
137f0d2e06
@ -527,9 +527,7 @@ func tcCall(n *ir.CallExpr, top int) ir.Node {
|
|||||||
default:
|
default:
|
||||||
n.SetOp(ir.OCALLFUNC)
|
n.SetOp(ir.OCALLFUNC)
|
||||||
if t.Kind() != types.TFUNC {
|
if t.Kind() != types.TFUNC {
|
||||||
// TODO(mdempsky): Remove "o.Sym() != nil" once we stop
|
if o := ir.Orig(l); o.Name() != nil && types.BuiltinPkg.Lookup(o.Sym().Name).Def != nil {
|
||||||
// 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 {
|
|
||||||
// be more specific when the non-function
|
// be more specific when the non-function
|
||||||
// name matches a predeclared function
|
// name matches a predeclared function
|
||||||
base.Errorf("cannot call non-function %L, declared at %s",
|
base.Errorf("cannot call non-function %L, declared at %s",
|
||||||
|
Loading…
Reference in New Issue
Block a user