[dev.link] cmd/link: change some decodetype functions to operate on bytes

Change some decodetype functions to operate on bytes nstead of
Symbol. This is in preparation of implementing live method
tracking in index-based deadcode pass, and reducing/eliminating
sym.Symbol in general.

Change-Id: Ia9809ad7b182884225e1bda577e8dbec0cd216c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/199077
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Cherry Zhang 2019-10-03 18:25:21 -04:00
parent 65a649c565
commit c455e8878f
5 changed files with 39 additions and 39 deletions

View file

@ -1085,13 +1085,13 @@ func (p *GCProg) AddSym(s *sym.Symbol) {
}
ptrsize := int64(p.ctxt.Arch.PtrSize)
nptr := decodetypePtrdata(p.ctxt.Arch, typ) / ptrsize
nptr := decodetypePtrdata(p.ctxt.Arch, typ.P) / ptrsize
if debugGCProg {
fmt.Fprintf(os.Stderr, "gcprog sym: %s at %d (ptr=%d+%d)\n", s.Name, s.Value, s.Value/ptrsize, nptr)
}
if decodetypeUsegcprog(p.ctxt.Arch, typ) == 0 {
if decodetypeUsegcprog(p.ctxt.Arch, typ.P) == 0 {
// Copy pointers from mask into program.
mask := decodetypeGcmask(p.ctxt, typ)
for i := int64(0); i < nptr; i++ {