]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.regabi] cmd/compile: remove unnecessary Name.Sym call
authorMatthew Dempsky <mdempsky@google.com>
Sun, 27 Dec 2020 18:48:10 +0000 (10:48 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 28 Dec 2020 08:06:35 +0000 (08:06 +0000)
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>
src/cmd/compile/internal/typecheck/func.go

index 50f514a6db0a64c84c19c2943fc444cfebb524fb..a9d92c668cd7890ddabafbd9a45e15b584d6e1f5 100644 (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",