diff options
author | Josh Bleecher Snyder <josharian@gmail.com> | 2017-03-16 22:42:10 -0700 |
---|---|---|
committer | Josh Bleecher Snyder <josharian@gmail.com> | 2017-03-17 23:18:57 +0000 |
commit | 2cdb7f118ab86adb6fef5485d96831df3446b747 (patch) | |
tree | 646fbcb5434a3efd5ded903b36cef37c0c4ac3ad /src/cmd/compile/internal/ssa/dom_test.go | |
parent | 193510f2f6a0d01bb03595ba12dd2b05109980e3 (diff) | |
download | go-2cdb7f118ab86adb6fef5485d96831df3446b747.tar.gz go-2cdb7f118ab86adb6fef5485d96831df3446b747.zip |
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>
Diffstat (limited to 'src/cmd/compile/internal/ssa/dom_test.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/dom_test.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cmd/compile/internal/ssa/dom_test.go b/src/cmd/compile/internal/ssa/dom_test.go index 6ecbe923d4..787c429e41 100644 --- a/src/cmd/compile/internal/ssa/dom_test.go +++ b/src/cmd/compile/internal/ssa/dom_test.go @@ -160,8 +160,8 @@ func genMaxPredValue(size int) []bloc { var domBenchRes []*Block func benchmarkDominators(b *testing.B, size int, bg blockGen) { - c := NewConfig("amd64", DummyFrontend{b}, nil, true) - fun := Fun(c, "entry", bg(size)...) + c := NewConfig("amd64", nil, true) + fun := Fun(c, DummyFrontend{b}, "entry", bg(size)...) CheckFunc(fun.f) b.SetBytes(int64(size)) @@ -221,7 +221,7 @@ func verifyDominators(t *testing.T, fut fun, domFn domFunc, doms map[string]stri func TestDominatorsSingleBlock(t *testing.T) { c := testConfig(t) - fun := Fun(c, "entry", + fun := Fun(c, DummyFrontend{t}, "entry", Bloc("entry", Valu("mem", OpInitMem, TypeMem, 0, nil), Exit("mem"))) @@ -236,7 +236,7 @@ func TestDominatorsSingleBlock(t *testing.T) { func TestDominatorsSimple(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("a")), @@ -264,7 +264,7 @@ func TestDominatorsSimple(t *testing.T) { func TestDominatorsMultPredFwd(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("p", OpConstBool, TypeBool, 1, nil), @@ -292,7 +292,7 @@ func TestDominatorsMultPredFwd(t *testing.T) { func TestDominatorsDeadCode(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("p", OpConstBool, TypeBool, 0, nil), @@ -315,7 +315,7 @@ func TestDominatorsDeadCode(t *testing.T) { func TestDominatorsMultPredRev(t *testing.T) { c := testConfig(t) - fun := Fun(c, "entry", + fun := Fun(c, DummyFrontend{t}, "entry", Bloc("entry", Goto("first")), Bloc("first", @@ -346,7 +346,7 @@ func TestDominatorsMultPredRev(t *testing.T) { func TestDominatorsMultPred(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("p", OpConstBool, TypeBool, 1, nil), @@ -375,7 +375,7 @@ func TestDominatorsMultPred(t *testing.T) { func TestInfiniteLoop(t *testing.T) { c := testConfig(t) // note lack of an exit block - fun := Fun(c, "entry", + fun := Fun(c, DummyFrontend{t}, "entry", Bloc("entry", Valu("mem", OpInitMem, TypeMem, 0, nil), Valu("p", OpConstBool, TypeBool, 1, nil), @@ -411,7 +411,7 @@ func TestDomTricky(t *testing.T) { b := 1 & i >> 1 c := 1 & i >> 2 - fun := Fun(testConfig(t), "1", + fun := Fun(testConfig(t), DummyFrontend{t}, "1", Bloc("1", Valu("mem", OpInitMem, TypeMem, 0, nil), Valu("p", OpConstBool, TypeBool, 1, nil), @@ -455,7 +455,7 @@ func generateDominatorMap(fut fun) map[string]string { func TestDominatorsPostTricky(t *testing.T) { c := testConfig(t) - fun := Fun(c, "b1", + fun := Fun(c, DummyFrontend{t}, "b1", Bloc("b1", Valu("mem", OpInitMem, TypeMem, 0, nil), Valu("p", OpConstBool, TypeBool, 1, nil), |