Skip to content

Commit

Permalink
cmd/compile/internal/obj: remove superfluous addvarint parameter and …
Browse files Browse the repository at this point in the history
…assignment

Change-Id: I395625dca9b719290c52d2c46f60b53e8fb3abc4
Reviewed-on: https://go-review.googlesource.com/34139
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  • Loading branch information
griesemer committed Dec 9, 2016
1 parent 4c4201f commit 00efa44
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/cmd/internal/obj/pcln.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ package obj

import "log"

func addvarint(ctxt *Link, d *Pcdata, val uint32) {
var v uint32
for v = val; v >= 0x80; v >>= 7 {
func addvarint(d *Pcdata, v uint32) {
for ; v >= 0x80; v >>= 7 {
d.P = append(d.P, uint8(v|0x80))
}
d.P = append(d.P, uint8(v))
Expand Down Expand Up @@ -98,7 +97,7 @@ func funcpctab(ctxt *Link, dst *Pcdata, func_ *LSym, desc string, valfunc func(*
}

if started != 0 {
addvarint(ctxt, dst, uint32((p.Pc-pc)/int64(ctxt.Arch.MinLC)))
addvarint(dst, uint32((p.Pc-pc)/int64(ctxt.Arch.MinLC)))
pc = p.Pc
}

Expand All @@ -108,7 +107,7 @@ func funcpctab(ctxt *Link, dst *Pcdata, func_ *LSym, desc string, valfunc func(*
} else {
delta <<= 1
}
addvarint(ctxt, dst, delta)
addvarint(dst, delta)
oldval = val
started = 1
val = valfunc(ctxt, func_, val, p, 1, arg)
Expand All @@ -118,8 +117,8 @@ func funcpctab(ctxt *Link, dst *Pcdata, func_ *LSym, desc string, valfunc func(*
if ctxt.Debugpcln != 0 {
ctxt.Logf("%6x done\n", uint64(func_.Text.Pc+func_.Size))
}
addvarint(ctxt, dst, uint32((func_.Size-pc)/int64(ctxt.Arch.MinLC)))
addvarint(ctxt, dst, 0) // terminator
addvarint(dst, uint32((func_.Size-pc)/int64(ctxt.Arch.MinLC)))
addvarint(dst, 0) // terminator
}

if ctxt.Debugpcln != 0 {
Expand Down

0 comments on commit 00efa44

Please sign in to comment.