diff options
author | Robert Griesemer <gri@golang.org> | 2016-12-08 15:19:47 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2016-12-09 00:35:07 +0000 |
commit | eaca0e0529b780f4c862a97aa47008aa1b403adf (patch) | |
tree | fffd2a59efa97fc2099b6ae6451386c4c983c847 /src/cmd/compile/internal/ssa/func_test.go | |
parent | c10499b539b964d647a9153cbf44e9c39661c397 (diff) | |
download | go-eaca0e0529b780f4c862a97aa47008aa1b403adf.tar.gz go-eaca0e0529b780f4c862a97aa47008aa1b403adf.zip |
[dev.inline] cmd/internal/src: introduce NoPos and use it instead Pos{}
Using a variable instead of a composite literal makes
the code independent of implementation changes of Pos.
Per David Lazar's suggestion.
Change-Id: I336967ac12a027c51a728a58ac6207cb5119af4a
Reviewed-on: https://go-review.googlesource.com/34148
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/func_test.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/func_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/ssa/func_test.go b/src/cmd/compile/internal/ssa/func_test.go index 81f1c33cde..2609551f04 100644 --- a/src/cmd/compile/internal/ssa/func_test.go +++ b/src/cmd/compile/internal/ssa/func_test.go @@ -155,7 +155,7 @@ func Fun(c *Config, entry string, blocs ...bloc) fun { blocks[bloc.name] = b for _, valu := range bloc.valus { // args are filled in the second pass. - values[valu.name] = b.NewValue0IA(src.Pos{}, valu.op, valu.t, valu.auxint, valu.aux) + values[valu.name] = b.NewValue0IA(src.NoPos, valu.op, valu.t, valu.auxint, valu.aux) } } // Connect the blocks together and specify control values. @@ -429,12 +429,12 @@ func TestConstCache(t *testing.T) { Bloc("entry", Valu("mem", OpInitMem, TypeMem, 0, nil), Exit("mem"))) - v1 := f.f.ConstBool(src.Pos{}, TypeBool, false) - v2 := f.f.ConstBool(src.Pos{}, TypeBool, true) + v1 := f.f.ConstBool(src.NoPos, TypeBool, false) + v2 := f.f.ConstBool(src.NoPos, TypeBool, true) f.f.freeValue(v1) f.f.freeValue(v2) - v3 := f.f.ConstBool(src.Pos{}, TypeBool, false) - v4 := f.f.ConstBool(src.Pos{}, TypeBool, true) + v3 := f.f.ConstBool(src.NoPos, TypeBool, false) + v4 := f.f.ConstBool(src.NoPos, TypeBool, true) if v3.AuxInt != 0 { t.Errorf("expected %s to have auxint of 0\n", v3.LongString()) } |