Commit 1874d4a8 authored by Matthew Dempsky's avatar Matthew Dempsky

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 9cb2ee0f
...@@ -467,12 +467,6 @@ func gendebug(fnsym *obj.LSym, decls []*Node) { ...@@ -467,12 +467,6 @@ func gendebug(fnsym *obj.LSym, decls []*Node) {
fnsym.Autom = append(fnsym.Autom, a) 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 // fieldtrack adds R_USEFIELD relocations to fnsym to record any
......
...@@ -595,13 +595,7 @@ func gendwarf(ctxt *Link, text []*LSym) []*LSym { ...@@ -595,13 +595,7 @@ func gendwarf(ctxt *Link, text []*LSym) []*LSym {
}) })
} }
// We want to sort variables by offset, breaking ties // Stable sort so that ties are broken with declaration order.
// 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]
}
sort.Stable(dwarf.VarsByOffset(vars)) sort.Stable(dwarf.VarsByOffset(vars))
dwarf.PutFunc(dctxt, dsym, s.Name, s.Version == 0, s, s.Size, vars) dwarf.PutFunc(dctxt, dsym, s.Name, s.Version == 0, s, s.Size, vars)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment