Commit 351897d9 authored by Russ Cox's avatar Russ Cox

cmd/internal/gc: emit branches in -g mode

The -g mode is a debugging mode that prints instructions
as they are constructed. Gbranch was just missing the print.

Change-Id: I3fb45fd9bd3996ed96df5be903b9fd6bd97148b0
Reviewed-on: https://go-review.googlesource.com/9827Reviewed-by: default avatarRick Hudson <rlh@golang.org>
parent 1635ab7d
...@@ -90,6 +90,10 @@ func Gbranch(as int, t *Type, likely int) *obj.Prog { ...@@ -90,6 +90,10 @@ func Gbranch(as int, t *Type, likely int) *obj.Prog {
p.From.Offset = int64(obj.Bool2int(likely > 0)) p.From.Offset = int64(obj.Bool2int(likely > 0))
} }
if Debug['g'] != 0 {
fmt.Printf("%v\n", p)
}
return p return p
} }
......
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