diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2020-12-23 02:16:17 -0800 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2020-12-23 11:59:23 +0000 |
| commit | addade2cce83fb0019ad8394311c51466d4042cf (patch) | |
| tree | 1eaa446b3032b608295e079efbc7d53b1f5beb75 /src/cmd/compile/internal/reflectdata/alg.go | |
| parent | 18ebfb49e9114b98e5a66acae073f5514e383aba (diff) | |
| download | go-addade2cce83fb0019ad8394311c51466d4042cf.tar.xz | |
[dev.regabi] cmd/compile: prefer types constructors over typecheck
Similar to the earlier mkbuiltin cleanup, there's a bunch of code that
calls typecheck.NewFuncType or typecheck.NewStructType, which can now
just call types.NewSignature and types.NewStruct, respectively.
Passes toolstash -cmp.
Change-Id: Ie6e09f1a7efef84b9a2bb5daa7087a6879979668
Reviewed-on: https://go-review.googlesource.com/c/go/+/279955
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/internal/reflectdata/alg.go')
| -rw-r--r-- | src/cmd/compile/internal/reflectdata/alg.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cmd/compile/internal/reflectdata/alg.go b/src/cmd/compile/internal/reflectdata/alg.go index 8391486e50..1f943f5795 100644 --- a/src/cmd/compile/internal/reflectdata/alg.go +++ b/src/cmd/compile/internal/reflectdata/alg.go @@ -289,11 +289,11 @@ func hashfor(t *types.Type) ir.Node { n := typecheck.NewName(sym) ir.MarkFunc(n) - n.SetType(typecheck.NewFuncType(nil, []*ir.Field{ - ir.NewField(base.Pos, nil, nil, types.NewPtr(t)), - ir.NewField(base.Pos, nil, nil, types.Types[types.TUINTPTR]), - }, []*ir.Field{ - ir.NewField(base.Pos, nil, nil, types.Types[types.TUINTPTR]), + n.SetType(types.NewSignature(types.NoPkg, nil, []*types.Field{ + types.NewField(base.Pos, nil, types.NewPtr(t)), + types.NewField(base.Pos, nil, types.Types[types.TUINTPTR]), + }, []*types.Field{ + types.NewField(base.Pos, nil, types.Types[types.TUINTPTR]), })) return n } @@ -777,12 +777,12 @@ func hashmem(t *types.Type) ir.Node { n := typecheck.NewName(sym) ir.MarkFunc(n) - n.SetType(typecheck.NewFuncType(nil, []*ir.Field{ - ir.NewField(base.Pos, nil, nil, types.NewPtr(t)), - ir.NewField(base.Pos, nil, nil, types.Types[types.TUINTPTR]), - ir.NewField(base.Pos, nil, nil, types.Types[types.TUINTPTR]), - }, []*ir.Field{ - ir.NewField(base.Pos, nil, nil, types.Types[types.TUINTPTR]), + n.SetType(types.NewSignature(types.NoPkg, nil, []*types.Field{ + types.NewField(base.Pos, nil, types.NewPtr(t)), + types.NewField(base.Pos, nil, types.Types[types.TUINTPTR]), + types.NewField(base.Pos, nil, types.Types[types.TUINTPTR]), + }, []*types.Field{ + types.NewField(base.Pos, nil, types.Types[types.TUINTPTR]), })) return n } |
