1
0
mirror of https://github.com/golang/go synced 2024-11-23 20:10:08 -07:00

cmd/internal/obj, cmd/compile: rip off some toolstash bandaids

Change-Id: I402383e893223facae451adbd640113126d5edd9
Reviewed-on: https://go-review.googlesource.com/37873
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Matthew Dempsky 2017-03-03 16:55:05 -08:00
parent 9cb2ee0ff2
commit 1874d4a883
2 changed files with 1 additions and 13 deletions

View File

@ -467,12 +467,6 @@ func gendebug(fnsym *obj.LSym, decls []*Node) {
fnsym.Autom = append(fnsym.Autom, a)
}
// Reverse to make toolstash happy.
// TODO(mdempsky): Remove.
for i, j := 0, len(fnsym.Autom)-1; i < j; i, j = i+1, j-1 {
fnsym.Autom[i], fnsym.Autom[j] = fnsym.Autom[j], fnsym.Autom[i]
}
}
// fieldtrack adds R_USEFIELD relocations to fnsym to record any

View File

@ -595,13 +595,7 @@ func gendwarf(ctxt *Link, text []*LSym) []*LSym {
})
}
// We want to sort variables by offset, breaking ties
// with declaration order. Autom holds variables in
// reverse declaration order, so we reverse the
// assembled slice and then apply a stable sort.
for i, j := 0, len(vars)-1; i < j; i, j = i+1, j-1 {
vars[i], vars[j] = vars[j], vars[i]
}
// Stable sort so that ties are broken with declaration order.
sort.Stable(dwarf.VarsByOffset(vars))
dwarf.PutFunc(dctxt, dsym, s.Name, s.Version == 0, s, s.Size, vars)