Skip to content

Commit

Permalink
[dev.debug] cmd/compile: rename some locals in genssa
Browse files Browse the repository at this point in the history
When we start tracking the mapping from Value to Prog, valueProgs will
be confusing. Disambiguate.

Change-Id: Ib3b302fedb7eb0ff1bde789d70a11656d82f0897
Reviewed-on: https://go-review.googlesource.com/50876
Reviewed-by: Josh Bleecher Snyder <[email protected]>
  • Loading branch information
heschi committed Jul 25, 2017
1 parent 045f605 commit c1c08a1
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/cmd/compile/internal/gc/ssa.go
Original file line number Diff line number Diff line change
Expand Up @@ -4382,14 +4382,14 @@ func genssa(f *ssa.Func, pp *Progs) {
// Remember where each block starts.
s.bstart = make([]*obj.Prog, f.NumBlocks())
s.pp = pp
var valueProgs map[*obj.Prog]*ssa.Value
var blockProgs map[*obj.Prog]*ssa.Block
var progToValue map[*obj.Prog]*ssa.Value
var progToBlock map[*obj.Prog]*ssa.Block
var logProgs = e.log
if logProgs {
valueProgs = make(map[*obj.Prog]*ssa.Value, f.NumValues())
blockProgs = make(map[*obj.Prog]*ssa.Block, f.NumBlocks())
progToValue = make(map[*obj.Prog]*ssa.Value, f.NumValues())
progToBlock = make(map[*obj.Prog]*ssa.Block, f.NumBlocks())
f.Logf("genssa %s\n", f.Name)
blockProgs[s.pp.next] = f.Blocks[0]
progToBlock[s.pp.next] = f.Blocks[0]
}

if thearch.Use387 {
Expand Down Expand Up @@ -4446,7 +4446,7 @@ func genssa(f *ssa.Func, pp *Progs) {

if logProgs {
for ; x != s.pp.next; x = x.Link {
valueProgs[x] = v
progToValue[x] = v
}
}
}
Expand All @@ -4464,7 +4464,7 @@ func genssa(f *ssa.Func, pp *Progs) {
thearch.SSAGenBlock(&s, b, next)
if logProgs {
for ; x != s.pp.next; x = x.Link {
blockProgs[x] = b
progToBlock[x] = b
}
}
}
Expand All @@ -4477,9 +4477,9 @@ func genssa(f *ssa.Func, pp *Progs) {
if logProgs {
for p := pp.Text; p != nil; p = p.Link {
var s string
if v, ok := valueProgs[p]; ok {
if v, ok := progToValue[p]; ok {
s = v.String()
} else if b, ok := blockProgs[p]; ok {
} else if b, ok := progToBlock[p]; ok {
s = b.String()
} else {
s = " " // most value and branch strings are 2-3 characters long
Expand All @@ -4497,9 +4497,9 @@ func genssa(f *ssa.Func, pp *Progs) {
buf.WriteString("<dl class=\"ssa-gen\">")
for p := pp.Text; p != nil; p = p.Link {
buf.WriteString("<dt class=\"ssa-prog-src\">")
if v, ok := valueProgs[p]; ok {
if v, ok := progToValue[p]; ok {
buf.WriteString(v.HTML())
} else if b, ok := blockProgs[p]; ok {
} else if b, ok := progToBlock[p]; ok {
buf.WriteString(b.HTML())
}
buf.WriteString("</dt>")
Expand Down

0 comments on commit c1c08a1

Please sign in to comment.