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

@ -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)