mirror of
https://github.com/golang/go
synced 2024-10-14 11:53:56 +00:00
cmd/compile/internal: use reflectdata.TypeLinksym
As the document of Sym.Linksym said, we replace
reflectdata.TypeSym(t).Linksym() with reflectdata.TypeLinksym(t).
Change-Id: I578eb159e552e60cd05d2aa1560f91797a6629ef
GitHub-Last-Rev: d096cba8f0
GitHub-Pull-Request: golang/go#66088
Reviewed-on: https://go-review.googlesource.com/c/go/+/568715
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
c2734187cd
commit
566e08fc64
|
@ -723,7 +723,7 @@ func makeTypeAssertDescriptor(target *types.Type, canFail bool) *obj.LSym {
|
|||
typeAssertGen++
|
||||
c := rttype.NewCursor(lsym, 0, rttype.TypeAssert)
|
||||
c.Field("Cache").WritePtr(typecheck.LookupRuntimeVar("emptyTypeAssertCache"))
|
||||
c.Field("Inter").WritePtr(reflectdata.TypeSym(target).Linksym())
|
||||
c.Field("Inter").WritePtr(reflectdata.TypeLinksym(target))
|
||||
c.Field("CanFail").WriteBool(canFail)
|
||||
objw.Global(lsym, int32(rttype.TypeAssert.Size()), obj.LOCAL)
|
||||
lsym.Gotype = reflectdata.TypeLinksym(rttype.TypeAssert)
|
||||
|
|
|
@ -532,7 +532,7 @@ func walkSwitchType(sw *ir.SwitchStmt) {
|
|||
c.Field("NCases").WriteInt(int64(len(interfaceCases)))
|
||||
array, sizeDelta := c.Field("Cases").ModifyArray(len(interfaceCases))
|
||||
for i, c := range interfaceCases {
|
||||
array.Elem(i).WritePtr(reflectdata.TypeSym(c.typ.Type()).Linksym())
|
||||
array.Elem(i).WritePtr(reflectdata.TypeLinksym(c.typ.Type()))
|
||||
}
|
||||
objw.Global(lsym, int32(rttype.InterfaceSwitch.Size()+sizeDelta), obj.LOCAL)
|
||||
// The GC only needs to see the first pointer in the structure (all the others
|
||||
|
|
Loading…
Reference in a new issue