diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2020-12-27 10:48:10 -0800 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2020-12-28 08:06:35 +0000 |
| commit | 137f0d2e06523f6daf808ea09e77e68d8944a85a (patch) | |
| tree | bf4be49b8ac4a8482b609628687ed2e9d815de80 /src/cmd/compile | |
| parent | 3383b5c74a4543d7232468201778a8db03cf133d (diff) | |
| download | go-137f0d2e06523f6daf808ea09e77e68d8944a85a.tar.xz | |
[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>
Diffstat (limited to 'src/cmd/compile')
| -rw-r--r-- | src/cmd/compile/internal/typecheck/func.go | 4 |
1 files changed, 1 insertions, 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", |
