cmd/compile: move Frontend field from ssa.Config to ssa.Func

Suggested by mdempsky in CL 38232.
This allows us to use the Frontend field
to associate frontend state and information
with a function.
See the following CL in the series for examples.

This is a giant CL, but it is almost entirely routine refactoring.

The ssa test API is starting to feel a bit unwieldy.
I will clean it up separately, once the dust has settled.

Passes toolstash -cmp.

Updates #15756

Change-Id: I71c573bd96ff7251935fce1391b06b1f133c3caf
Reviewed-on: https://go-review.googlesource.com/38327
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Josh Bleecher Snyder 2017-03-16 22:42:10 -07:00
parent 193510f2f6
commit 2cdb7f118a
51 changed files with 922 additions and 2228 deletions

View file

@ -307,7 +307,7 @@ func (ft *factsTable) update(parent *Block, v, w *Value, d domain, r relation) {
ft.limitStack = append(ft.limitStack, limitFact{v.ID, old})
ft.limits[v.ID] = lim
if v.Block.Func.pass.debug > 2 {
v.Block.Func.Config.Warnl(parent.Pos, "parent=%s, new limits %s %s %s", parent, v, w, lim.String())
v.Block.Func.Warnl(parent.Pos, "parent=%s, new limits %s %s %s", parent, v, w, lim.String())
}
}
}
@ -657,7 +657,7 @@ func simplifyBlock(ft *factsTable, b *Block) branch {
v.reset(OpConst32)
}
if b.Func.pass.debug > 0 {
b.Func.Config.Warnl(v.Pos, "Proved slicemask not needed")
b.Func.Warnl(v.Pos, "Proved slicemask not needed")
}
v.AuxInt = -1
}
@ -672,9 +672,9 @@ func simplifyBlock(ft *factsTable, b *Block) branch {
if m == lt|gt {
if b.Func.pass.debug > 0 {
if b.Func.pass.debug > 1 {
b.Func.Config.Warnl(b.Pos, "Proved boolean %s (%s)", b.Control.Op, b.Control)
b.Func.Warnl(b.Pos, "Proved boolean %s (%s)", b.Control.Op, b.Control)
} else {
b.Func.Config.Warnl(b.Pos, "Proved boolean %s", b.Control.Op)
b.Func.Warnl(b.Pos, "Proved boolean %s", b.Control.Op)
}
}
return positive
@ -682,9 +682,9 @@ func simplifyBlock(ft *factsTable, b *Block) branch {
if m == eq {
if b.Func.pass.debug > 0 {
if b.Func.pass.debug > 1 {
b.Func.Config.Warnl(b.Pos, "Disproved boolean %s (%s)", b.Control.Op, b.Control)
b.Func.Warnl(b.Pos, "Disproved boolean %s (%s)", b.Control.Op, b.Control)
} else {
b.Func.Config.Warnl(b.Pos, "Disproved boolean %s", b.Control.Op)
b.Func.Warnl(b.Pos, "Disproved boolean %s", b.Control.Op)
}
}
return negative
@ -713,9 +713,9 @@ func simplifyBlock(ft *factsTable, b *Block) branch {
if m != 0 && tr.r&m == m {
if b.Func.pass.debug > 0 {
if b.Func.pass.debug > 1 {
b.Func.Config.Warnl(b.Pos, "Proved %s (%s)", c.Op, c)
b.Func.Warnl(b.Pos, "Proved %s (%s)", c.Op, c)
} else {
b.Func.Config.Warnl(b.Pos, "Proved %s", c.Op)
b.Func.Warnl(b.Pos, "Proved %s", c.Op)
}
}
return positive
@ -723,9 +723,9 @@ func simplifyBlock(ft *factsTable, b *Block) branch {
if m != 0 && ((lt|eq|gt)^tr.r)&m == m {
if b.Func.pass.debug > 0 {
if b.Func.pass.debug > 1 {
b.Func.Config.Warnl(b.Pos, "Disproved %s (%s)", c.Op, c)
b.Func.Warnl(b.Pos, "Disproved %s (%s)", c.Op, c)
} else {
b.Func.Config.Warnl(b.Pos, "Disproved %s", c.Op)
b.Func.Warnl(b.Pos, "Disproved %s", c.Op)
}
}
return negative
@ -742,9 +742,9 @@ func simplifyBlock(ft *factsTable, b *Block) branch {
if m != 0 && tr.r&m == m {
if b.Func.pass.debug > 0 {
if b.Func.pass.debug > 1 {
b.Func.Config.Warnl(b.Pos, "Proved non-negative bounds %s (%s)", c.Op, c)
b.Func.Warnl(b.Pos, "Proved non-negative bounds %s (%s)", c.Op, c)
} else {
b.Func.Config.Warnl(b.Pos, "Proved non-negative bounds %s", c.Op)
b.Func.Warnl(b.Pos, "Proved non-negative bounds %s", c.Op)
}
}
return positive