]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/gc: emit branches in -g mode
authorRuss Cox <rsc@golang.org>
Thu, 7 May 2015 14:34:12 +0000 (10:34 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 11 May 2015 14:55:36 +0000 (14:55 +0000)
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/9827
Reviewed-by: Rick Hudson <rlh@golang.org>
src/cmd/internal/gc/gsubr.go

index 53b3f6c41de6db2bb0a7af5d2262d1475c89ffb2..9b75bb6109bb999211766692451e7fbc2dcea249 100644 (file)
@@ -90,6 +90,10 @@ func Gbranch(as int, t *Type, likely int) *obj.Prog {
                p.From.Offset = int64(obj.Bool2int(likely > 0))
        }
 
+       if Debug['g'] != 0 {
+               fmt.Printf("%v\n", p)
+       }
+
        return p
 }