Commit 35e25ef6 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/internal/obj/x86: minor code cleanup

Update #16415

Change-Id: I83e0966931ada2f1ed02304685bb45effdd71268
Reviewed-on: https://go-review.googlesource.com/26665
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent e85265e8
...@@ -833,31 +833,26 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) { ...@@ -833,31 +833,26 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) {
p2.Pcond = p p2.Pcond = p
} }
var a int
var pcsize int
for ; p != nil; p = p.Link { for ; p != nil; p = p.Link {
pcsize = int(p.Mode) / 8 pcsize := int(p.Mode) / 8
a = int(p.From.Name) switch p.From.Name {
if a == obj.NAME_AUTO { case obj.NAME_AUTO:
p.From.Offset += int64(deltasp) - int64(bpsize) p.From.Offset += int64(deltasp) - int64(bpsize)
} case obj.NAME_PARAM:
if a == obj.NAME_PARAM {
p.From.Offset += int64(deltasp) + int64(pcsize) p.From.Offset += int64(deltasp) + int64(pcsize)
} }
if p.From3 != nil { if p.From3 != nil {
a = int(p.From3.Name) switch p.From3.Name {
if a == obj.NAME_AUTO { case obj.NAME_AUTO:
p.From3.Offset += int64(deltasp) - int64(bpsize) p.From3.Offset += int64(deltasp) - int64(bpsize)
} case obj.NAME_PARAM:
if a == obj.NAME_PARAM {
p.From3.Offset += int64(deltasp) + int64(pcsize) p.From3.Offset += int64(deltasp) + int64(pcsize)
} }
} }
a = int(p.To.Name) switch p.To.Name {
if a == obj.NAME_AUTO { case obj.NAME_AUTO:
p.To.Offset += int64(deltasp) - int64(bpsize) p.To.Offset += int64(deltasp) - int64(bpsize)
} case obj.NAME_PARAM:
if a == obj.NAME_PARAM {
p.To.Offset += int64(deltasp) + int64(pcsize) p.To.Offset += int64(deltasp) + int64(pcsize)
} }
...@@ -896,7 +891,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) { ...@@ -896,7 +891,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) {
continue continue
case obj.ARET: case obj.ARET:
break // do nothing
} }
if autoffset != deltasp { if autoffset != deltasp {
......
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