mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
193510f2f6
commit
2cdb7f118a
51 changed files with 922 additions and 2228 deletions
|
|
@ -12,7 +12,7 @@ import (
|
|||
|
||||
func TestDeadLoop(t *testing.T) {
|
||||
c := testConfig(t)
|
||||
fun := Fun(c, "entry",
|
||||
fun := Fun(c, DummyFrontend{t}, "entry",
|
||||
Bloc("entry",
|
||||
Valu("mem", OpInitMem, TypeMem, 0, nil),
|
||||
Goto("exit")),
|
||||
|
|
@ -42,7 +42,7 @@ func TestDeadLoop(t *testing.T) {
|
|||
|
||||
func TestDeadValue(t *testing.T) {
|
||||
c := testConfig(t)
|
||||
fun := Fun(c, "entry",
|
||||
fun := Fun(c, DummyFrontend{t}, "entry",
|
||||
Bloc("entry",
|
||||
Valu("mem", OpInitMem, TypeMem, 0, nil),
|
||||
Valu("deadval", OpConst64, TypeInt64, 37, nil),
|
||||
|
|
@ -65,7 +65,7 @@ func TestDeadValue(t *testing.T) {
|
|||
|
||||
func TestNeverTaken(t *testing.T) {
|
||||
c := testConfig(t)
|
||||
fun := Fun(c, "entry",
|
||||
fun := Fun(c, DummyFrontend{t}, "entry",
|
||||
Bloc("entry",
|
||||
Valu("cond", OpConstBool, TypeBool, 0, nil),
|
||||
Valu("mem", OpInitMem, TypeMem, 0, nil),
|
||||
|
|
@ -100,7 +100,7 @@ func TestNeverTaken(t *testing.T) {
|
|||
|
||||
func TestNestedDeadBlocks(t *testing.T) {
|
||||
c := testConfig(t)
|
||||
fun := Fun(c, "entry",
|
||||
fun := Fun(c, DummyFrontend{t}, "entry",
|
||||
Bloc("entry",
|
||||
Valu("mem", OpInitMem, TypeMem, 0, nil),
|
||||
Valu("cond", OpConstBool, TypeBool, 0, nil),
|
||||
|
|
@ -152,7 +152,7 @@ func BenchmarkDeadCode(b *testing.B) {
|
|||
}
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
fun := Fun(c, "entry", blocks...)
|
||||
fun := Fun(c, DummyFrontend{b}, "entry", blocks...)
|
||||
Deadcode(fun.f)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue