diff options
author | Austin Clements <austin@google.com> | 2021-03-27 10:14:30 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2021-03-29 18:46:28 +0000 |
commit | 0d1423583b9106d398740862bca4ad5661fd67ad (patch) | |
tree | e69d8ea616d5bd80656edb7c308066039d8376b6 /src/cmd/compile/internal/typecheck/syms.go | |
parent | 33b4ffc3573eb81854591d39f1029dabacbdec72 (diff) | |
download | go-0d1423583b9106d398740862bca4ad5661fd67ad.tar.gz go-0d1423583b9106d398740862bca4ad5661fd67ad.zip |
cmd/compile: set ir.Name.Func in more cases
ir.Name.Func is non-nil for *almost* all function names. This CL fixes
a few more major cases that leave it nil, though there are still a few
cases left: interface method values, and algorithms generated by
eqFor, hashfor, and hashmem.
We'll need this for mapping from ir.Names to function ABIs shortly.
The remaining cases would be nice to fix, but they're all guaranteed
to be ABIInternal, so we can at least work around them.
For #40724.
Change-Id: Ifcfa781c78899ccea0bf155d80f8cfc27f30351e
Reviewed-on: https://go-review.googlesource.com/c/go/+/305271
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/syms.go')
-rw-r--r-- | src/cmd/compile/internal/typecheck/syms.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/typecheck/syms.go b/src/cmd/compile/internal/typecheck/syms.go index 202a932e6c..f29af82db2 100644 --- a/src/cmd/compile/internal/typecheck/syms.go +++ b/src/cmd/compile/internal/typecheck/syms.go @@ -32,6 +32,7 @@ func SubstArgTypes(old *ir.Name, types_ ...*types.Type) *ir.Name { n := ir.NewNameAt(old.Pos(), old.Sym()) n.Class = old.Class n.SetType(types.SubstAny(old.Type(), &types_)) + n.Func = old.Func if len(types_) > 0 { base.Fatalf("SubstArgTypes: too many argument types") } |