mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: use Type.OrigSym getter/setters [generated]
Automated CL to rewrite existing code to use OrigSym getters and
setters. Afterwards, we also unexported OrigSym, and then rename the
getter to OrigSym.
[git-generate]
cd src/cmd/compile/internal
: Workaround rf issue with types2 tests.
rm types2/*_test.go
rf '
ex ./noder ./typecheck {
import "cmd/compile/internal/types"
var s *types.Sym
var t *types.Type
t.OrigSym = s -> t.SetOrigSym(s)
t.OrigSym -> t.OrigSym_()
}
'
cd types
rf '
mv Type.OrigSym Type.origSym
mv Type.OrigSym_ Type.OrigSym
'
: Revert types2 hack.
cd ../types2
git checkout HEAD^ .
Change-Id: I8eb17098613b1575df56b8189b1615823071d3d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/345485
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
68ecdc2c70
commit
82efc05403
8 changed files with 21 additions and 21 deletions
|
|
@ -151,7 +151,7 @@ func (g *irgen) stencil() {
|
|||
targs := deref(meth.Type().Recv().Type).RParams()
|
||||
|
||||
t := meth.X.Type()
|
||||
baseSym := deref(t).OrigSym
|
||||
baseSym := deref(t).OrigSym()
|
||||
baseType := baseSym.Def.(*ir.Name).Type()
|
||||
var gf *ir.Name
|
||||
for _, m := range baseType.Methods().Slice() {
|
||||
|
|
@ -309,7 +309,7 @@ func (g *irgen) buildClosure(outer *ir.Func, x ir.Node) ir.Node {
|
|||
// actually generic, so no need to build a closure.
|
||||
return x
|
||||
}
|
||||
baseType := recv.OrigSym.Def.Type()
|
||||
baseType := recv.OrigSym().Def.Type()
|
||||
var gf *ir.Name
|
||||
for _, m := range baseType.Methods().Slice() {
|
||||
if se.Sel == m.Sym {
|
||||
|
|
@ -493,7 +493,7 @@ func (g *irgen) instantiateMethods() {
|
|||
typecheck.NeedRuntimeType(typ)
|
||||
// Lookup the method on the base generic type, since methods may
|
||||
// not be set on imported instantiated types.
|
||||
baseSym := typ.OrigSym
|
||||
baseSym := typ.OrigSym()
|
||||
baseType := baseSym.Def.(*ir.Name).Type()
|
||||
for j, _ := range typ.Methods().Slice() {
|
||||
if baseType.Methods().Slice()[j].Nointerface() {
|
||||
|
|
@ -1465,7 +1465,7 @@ func (g *irgen) getDictionarySym(gf *ir.Name, targs []*types.Type, isMeth bool)
|
|||
// instantiated type, so we need a
|
||||
// sub-dictionary.
|
||||
targs := recvType.RParams()
|
||||
genRecvType := recvType.OrigSym.Def.Type()
|
||||
genRecvType := recvType.OrigSym().Def.Type()
|
||||
nameNode = typecheck.Lookdot1(call.X, se.Sel, genRecvType, genRecvType.Methods(), 1).Nname.(*ir.Name)
|
||||
sym = g.getDictionarySym(nameNode, targs, true)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue