Skip to content

Commit 2b1d76b

Browse files
committed
all: upgrade to latest x/tools version
Upgrading to newest x/tools was performed with these steps: ``` % go get golang.org/x/[email protected] % go get golang.org/x/tools/internal/[email protected] % go mod download github.com/yuin/goldmark ``` With this update `interface{}` is now rendered with the new builtin type `any`, which interfers with the golden test data in the debug/render package. The golden files have been simply updated with the following command: ``` % sed -i 's/interface{}/any/g' internal/pkg/debug/render/testdata/* ``` The following test fails after this upgrade: ``` % go1.18.1 test github.com/google/go-flow-levee/internal/pkg/earpointer --- FAIL: TestMethodInvoke (0.00s) analysis_test.go:1212: got: {**T2:f.arg0}: [T1->g.t0], {*T1:f.arg0,*T2:f.t0,g.t0}: [], {*T1:f.x,*T2:f.x,g.x}: [], {*T2:f.arg0}: --> **T2:f.arg0, {*g.x2}: [T1->g.t0], {g.x2}: --> *g.x2 want: {**T2:f.arg0}: [T1->*T1:f.arg0], {*T1:f.arg0,*T2:f.t0,g.t0}: [], {*T1:f.x,*T2:f.x,g.x}: [], {*T2:f.arg0}: --> **T2:f.arg0, {*g.x2}: [T1->*T1:f.arg0], {g.x2}: --> *g.x2 FAIL FAIL github.com/google/go-flow-levee/internal/pkg/earpointer 0.054s FAIL ``` The following test panics with go1.18.1 and with this upgrade it fails: ``` % go1.18.1 test github.com/google/go-flow-levee/internal/pkg/levee --- FAIL: TestLeveeEAR (5.97s) analysistest.go:455: levee_analysistest/example/tests/position/tests.go:36:11: diagnostic "a source has reached a sink\n source: /home/chressie/src/github.com/google/go-flow-levee/internal/pkg/levee/testdata/src/levee_analysistest/example/tests/position/tests.go:35:7" does not match pattern "a source has reached a sink\n source: .*tests.go:34:2" analysistest.go:455: levee_analysistest/example/tests/position/tests.go:42:11: diagnostic "a source has reached a sink\n source: /home/chressie/src/github.com/google/go-flow-levee/internal/pkg/levee/testdata/src/levee_analysistest/example/tests/position/tests.go:42:12" does not match pattern "a source has reached a sink\n source: .*tests.go:42:24" analysistest.go:519: levee_analysistest/example/tests/position/tests.go:36: no diagnostic was reported matching "a source has reached a sink\n source: .*tests.go:34:2" analysistest.go:519: levee_analysistest/example/tests/position/tests.go:42: no diagnostic was reported matching "a source has reached a sink\n source: .*tests.go:42:24" --- FAIL: TestLevee (0.54s) analysistest.go:455: levee_analysistest/example/tests/position/tests.go:36:11: diagnostic "a source has reached a sink\n source: /home/chressie/src/github.com/google/go-flow-levee/internal/pkg/levee/testdata/src/levee_analysistest/example/tests/position/tests.go:35:7" does not match pattern "a source has reached a sink\n source: .*tests.go:34:2" analysistest.go:455: levee_analysistest/example/tests/position/tests.go:42:11: diagnostic "a source has reached a sink\n source: /home/chressie/src/github.com/google/go-flow-levee/internal/pkg/levee/testdata/src/levee_analysistest/example/tests/position/tests.go:42:12" does not match pattern "a source has reached a sink\n source: .*tests.go:42:24" analysistest.go:519: levee_analysistest/example/tests/position/tests.go:36: no diagnostic was reported matching "a source has reached a sink\n source: .*tests.go:34:2" analysistest.go:519: levee_analysistest/example/tests/position/tests.go:42: no diagnostic was reported matching "a source has reached a sink\n source: .*tests.go:42:24" analysistest.go:519: levee_analysistest/example/tests/stdlib/interface_funcs.go:45: no diagnostic was reported matching `a source has reached a sink` FAIL FAIL github.com/google/go-flow-levee/internal/pkg/levee 6.870s FAIL ```
1 parent c0094bf commit 2b1d76b

11 files changed

+75
-55
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ go 1.14
44

55
require (
66
github.com/google/go-cmp v0.5.2
7-
golang.org/x/tools v0.0.0-20200416214402-fc959738d646
7+
golang.org/x/tools v0.1.11-0.20220504225841-45c8a7131235
88
sigs.k8s.io/yaml v1.2.0
99
)

go.sum

+20
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,41 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
33
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
44
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
55
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
6+
github.com/yuin/goldmark v1.4.1 h1:/vn0k+RBvwlxEmP5E7SZMqNxPhfMVFEJiykr15/0XKM=
7+
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
68
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
79
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
10+
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
811
golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
912
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
13+
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
14+
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
1015
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
1116
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
1217
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
18+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
19+
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
1320
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
1421
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
22+
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
1523
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
1624
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
25+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
26+
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
27+
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
28+
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
29+
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
30+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
1731
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
32+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
33+
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
34+
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
35+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
1836
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
1937
golang.org/x/tools v0.0.0-20200416214402-fc959738d646 h1:7CEkhBsBejkW845gR1AmglqMfc1yGzn42FBmtM4jxyM=
2038
golang.org/x/tools v0.0.0-20200416214402-fc959738d646/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
39+
golang.org/x/tools v0.1.11-0.20220504225841-45c8a7131235 h1:crlaTzOCJe82TDDRppEHbWCLjV9WU+uEPhpF07euMnI=
40+
golang.org/x/tools v0.1.11-0.20220504225841-45c8a7131235/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4=
2141
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
2242
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
2343
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=

internal/pkg/debug/render/testdata/TestClosure.ssa

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ func TestClosure()
44
1(*ssa.Return ): return
55
func TestClosure$1(x int)
66
0: entry
7-
0(*ssa.Alloc ): t0 = new [1]interface{} (varargs)
7+
0(*ssa.Alloc ): t0 = new [1]any (varargs)
88
1(*ssa.IndexAddr ): t1 = &t0[0:int]
9-
2(*ssa.MakeInterface ): t2 = make interface{} <- int (x)
9+
2(*ssa.MakeInterface ): t2 = make any <- int (x)
1010
3(*ssa.Store ): *t1 = t2
1111
4(*ssa.Slice ): t3 = slice t0[:]
1212
5(*ssa.Call ): t4 = fmt.Println(t3...)

internal/pkg/debug/render/testdata/TestDisconnected.dot

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ digraph {
1515
color=black;
1616
label="for.done";
1717
"t2 = \"error: \":string + \"unreachable code\":string\n(BinOp)" [shape=rectangle];
18-
"t3 = fmt.Printf(t2, nil:[]interface{}...)\n(Call)" [shape=rectangle];
18+
"t3 = fmt.Printf(t2, nil:[]any...)\n(Call)" [shape=rectangle];
1919
"return\n(Return)" [shape=diamond];
2020
}
2121
subgraph cluster_3 {
@@ -32,9 +32,9 @@ digraph {
3232
"1:int\n(Const)" -> "t1 = t0 + 1:int\n(BinOp)" [color=orange];
3333
"\"error: \":string\n(Const)" -> "t2 = \"error: \":string + \"unreachable code\":string\n(BinOp)" [color=orange];
3434
"\"unreachable code\":string\n(Const)" -> "t2 = \"error: \":string + \"unreachable code\":string\n(BinOp)" [color=orange];
35-
"Printf\n(Function)" -> "t3 = fmt.Printf(t2, nil:[]interface{}...)\n(Call)" [color=orange];
36-
"t2 = \"error: \":string + \"unreachable code\":string\n(BinOp)" -> "t3 = fmt.Printf(t2, nil:[]interface{}...)\n(Call)" [color=orange];
37-
"nil:[]interface{}\n(Const)" -> "t3 = fmt.Printf(t2, nil:[]interface{}...)\n(Call)" [color=orange];
35+
"Printf\n(Function)" -> "t3 = fmt.Printf(t2, nil:[]any...)\n(Call)" [color=orange];
36+
"t2 = \"error: \":string + \"unreachable code\":string\n(BinOp)" -> "t3 = fmt.Printf(t2, nil:[]any...)\n(Call)" [color=orange];
37+
"nil:[]any\n(Const)" -> "t3 = fmt.Printf(t2, nil:[]any...)\n(Call)" [color=orange];
3838
"0:int\n(Const)" -> "t4 = phi [0: 0:int, 1: t1] #i\n(Phi)" [color=orange];
3939
"t1 = t0 + 1:int\n(BinOp)" -> "t4 = phi [0: 0:int, 1: t1] #i\n(Phi)" [color=orange];
4040
"1:int\n(Const)" -> "t5 = 1:int * 2:int\n(BinOp)" [color=orange];

internal/pkg/debug/render/testdata/TestDisconnected.ssa

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ func TestDisconnected()
1212
2(*ssa.Jump ): jump 3
1313
3: for.done
1414
0(*ssa.BinOp ): t2 = "error: ":string + "unreachable code":string
15-
1(*ssa.Call ): t3 = fmt.Printf(t2, nil:[]interface{}...)
15+
1(*ssa.Call ): t3 = fmt.Printf(t2, nil:[]any...)
1616
2(*ssa.Return ): return

internal/pkg/debug/render/testdata/TestMultiBlock.dot

+16-16
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ digraph {
2828
subgraph cluster_3 {
2929
color=black;
3030
label="if.else";
31-
"t9 = new [1]interface{} (varargs)\n(Alloc)" [shape=rectangle];
31+
"t9 = new [1]any (varargs)\n(Alloc)" [shape=rectangle];
3232
"t10 = &t9[0:int]\n(IndexAddr)" [shape=rectangle];
33-
"t11 = make interface{} <- string (\"somewhere\":string)\n(MakeInterface)" [shape=rectangle];
33+
"t11 = make any <- string (\"somewhere\":string)\n(MakeInterface)" [shape=rectangle];
3434
"*t10 = t11\n(Store)" [shape=diamond];
3535
"t12 = slice t9[:]\n(Slice)" [shape=rectangle];
3636
"t13 = fmt.Println(t12...)\n(Call)" [shape=rectangle];
@@ -43,12 +43,12 @@ digraph {
4343
"t15 = *t14\n(UnOp)" [shape=rectangle];
4444
"t16 = &t0.Y [#1]\n(FieldAddr)" [shape=rectangle];
4545
"t17 = *t16\n(UnOp)" [shape=rectangle];
46-
"t18 = new [2]interface{} (varargs)\n(Alloc)" [shape=rectangle];
46+
"t18 = new [2]any (varargs)\n(Alloc)" [shape=rectangle];
4747
"t19 = &t18[0:int]\n(IndexAddr)" [shape=rectangle];
48-
"t20 = make interface{} <- int (t15)\n(MakeInterface)" [shape=rectangle];
48+
"t20 = make any <- int (t15)\n(MakeInterface)" [shape=rectangle];
4949
"*t19 = t20\n(Store)" [shape=diamond];
5050
"t21 = &t18[1:int]\n(IndexAddr)" [shape=rectangle];
51-
"t22 = make interface{} <- int (t17)\n(MakeInterface)" [shape=rectangle];
51+
"t22 = make any <- int (t17)\n(MakeInterface)" [shape=rectangle];
5252
"*t21 = t22\n(Store)" [shape=diamond];
5353
"t23 = slice t18[:]\n(Slice)" [shape=rectangle];
5454
"t24 = fmt.Printf(\"in top right quad...\":string, t23...)\n(Call)" [shape=rectangle];
@@ -70,29 +70,29 @@ digraph {
7070
"t7 = *t6\n(UnOp)" -> "t8 = t7 > 0:int\n(BinOp)" [color=orange];
7171
"0:int\n(Const)" -> "t8 = t7 > 0:int\n(BinOp)" [color=orange];
7272
"t8 = t7 > 0:int\n(BinOp)" -> "if t8 goto 4 else 2\n(If)" [color=orange];
73-
"t9 = new [1]interface{} (varargs)\n(Alloc)" -> "t10 = &t9[0:int]\n(IndexAddr)" [color=orange];
73+
"t9 = new [1]any (varargs)\n(Alloc)" -> "t10 = &t9[0:int]\n(IndexAddr)" [color=orange];
7474
"0:int\n(Const)" -> "t10 = &t9[0:int]\n(IndexAddr)" [color=orange];
75-
"\"somewhere\":string\n(Const)" -> "t11 = make interface{} <- string (\"somewhere\":string)\n(MakeInterface)" [color=orange];
75+
"\"somewhere\":string\n(Const)" -> "t11 = make any <- string (\"somewhere\":string)\n(MakeInterface)" [color=orange];
7676
"t10 = &t9[0:int]\n(IndexAddr)" -> "*t10 = t11\n(Store)" [color=orange];
77-
"t11 = make interface{} <- string (\"somewhere\":string)\n(MakeInterface)" -> "*t10 = t11\n(Store)" [color=orange];
78-
"t9 = new [1]interface{} (varargs)\n(Alloc)" -> "t12 = slice t9[:]\n(Slice)" [color=orange];
77+
"t11 = make any <- string (\"somewhere\":string)\n(MakeInterface)" -> "*t10 = t11\n(Store)" [color=orange];
78+
"t9 = new [1]any (varargs)\n(Alloc)" -> "t12 = slice t9[:]\n(Slice)" [color=orange];
7979
"Println\n(Function)" -> "t13 = fmt.Println(t12...)\n(Call)" [color=orange];
8080
"t12 = slice t9[:]\n(Slice)" -> "t13 = fmt.Println(t12...)\n(Call)" [color=orange];
8181
"t0 = local image.Point (p)\n(Alloc)" -> "t14 = &t0.X [#0]\n(FieldAddr)" [color=orange];
8282
"t14 = &t0.X [#0]\n(FieldAddr)" -> "t15 = *t14\n(UnOp)" [color=orange];
8383
"t0 = local image.Point (p)\n(Alloc)" -> "t16 = &t0.Y [#1]\n(FieldAddr)" [color=orange];
8484
"t16 = &t0.Y [#1]\n(FieldAddr)" -> "t17 = *t16\n(UnOp)" [color=orange];
85-
"t18 = new [2]interface{} (varargs)\n(Alloc)" -> "t19 = &t18[0:int]\n(IndexAddr)" [color=orange];
85+
"t18 = new [2]any (varargs)\n(Alloc)" -> "t19 = &t18[0:int]\n(IndexAddr)" [color=orange];
8686
"0:int\n(Const)" -> "t19 = &t18[0:int]\n(IndexAddr)" [color=orange];
87-
"t15 = *t14\n(UnOp)" -> "t20 = make interface{} <- int (t15)\n(MakeInterface)" [color=orange];
87+
"t15 = *t14\n(UnOp)" -> "t20 = make any <- int (t15)\n(MakeInterface)" [color=orange];
8888
"t19 = &t18[0:int]\n(IndexAddr)" -> "*t19 = t20\n(Store)" [color=orange];
89-
"t20 = make interface{} <- int (t15)\n(MakeInterface)" -> "*t19 = t20\n(Store)" [color=orange];
90-
"t18 = new [2]interface{} (varargs)\n(Alloc)" -> "t21 = &t18[1:int]\n(IndexAddr)" [color=orange];
89+
"t20 = make any <- int (t15)\n(MakeInterface)" -> "*t19 = t20\n(Store)" [color=orange];
90+
"t18 = new [2]any (varargs)\n(Alloc)" -> "t21 = &t18[1:int]\n(IndexAddr)" [color=orange];
9191
"1:int\n(Const)" -> "t21 = &t18[1:int]\n(IndexAddr)" [color=orange];
92-
"t17 = *t16\n(UnOp)" -> "t22 = make interface{} <- int (t17)\n(MakeInterface)" [color=orange];
92+
"t17 = *t16\n(UnOp)" -> "t22 = make any <- int (t17)\n(MakeInterface)" [color=orange];
9393
"t21 = &t18[1:int]\n(IndexAddr)" -> "*t21 = t22\n(Store)" [color=orange];
94-
"t22 = make interface{} <- int (t17)\n(MakeInterface)" -> "*t21 = t22\n(Store)" [color=orange];
95-
"t18 = new [2]interface{} (varargs)\n(Alloc)" -> "t23 = slice t18[:]\n(Slice)" [color=orange];
94+
"t22 = make any <- int (t17)\n(MakeInterface)" -> "*t21 = t22\n(Store)" [color=orange];
95+
"t18 = new [2]any (varargs)\n(Alloc)" -> "t23 = slice t18[:]\n(Slice)" [color=orange];
9696
"Printf\n(Function)" -> "t24 = fmt.Printf(\"in top right quad...\":string, t23...)\n(Call)" [color=orange];
9797
"\"in top right quad...\":string\n(Const)" -> "t24 = fmt.Printf(\"in top right quad...\":string, t23...)\n(Call)" [color=orange];
9898
"t23 = slice t18[:]\n(Slice)" -> "t24 = fmt.Printf(\"in top right quad...\":string, t23...)\n(Call)" [color=orange];

internal/pkg/debug/render/testdata/TestMultiBlock.ssa

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@ func TestMultiBlock()
1919
1(*ssa.UnOp ): t15 = *t14
2020
2(*ssa.FieldAddr ): t16 = &t0.Y [#1]
2121
3(*ssa.UnOp ): t17 = *t16
22-
4(*ssa.Alloc ): t18 = new [2]interface{} (varargs)
22+
4(*ssa.Alloc ): t18 = new [2]any (varargs)
2323
5(*ssa.IndexAddr ): t19 = &t18[0:int]
24-
6(*ssa.MakeInterface ): t20 = make interface{} <- int (t15)
24+
6(*ssa.MakeInterface ): t20 = make any <- int (t15)
2525
7(*ssa.Store ): *t19 = t20
2626
8(*ssa.IndexAddr ): t21 = &t18[1:int]
27-
9(*ssa.MakeInterface ): t22 = make interface{} <- int (t17)
27+
9(*ssa.MakeInterface ): t22 = make any <- int (t17)
2828
10(*ssa.Store ): *t21 = t22
2929
11(*ssa.Slice ): t23 = slice t18[:]
3030
12(*ssa.Call ): t24 = fmt.Printf("in top right quad...":string, t23...)
3131
13(*ssa.Jump ): jump 2
3232
3: if.done
3333
0(*ssa.Return ): return
3434
4: if.else
35-
0(*ssa.Alloc ): t9 = new [1]interface{} (varargs)
35+
0(*ssa.Alloc ): t9 = new [1]any (varargs)
3636
1(*ssa.IndexAddr ): t10 = &t9[0:int]
37-
2(*ssa.MakeInterface ): t11 = make interface{} <- string ("somewhere":string)
37+
2(*ssa.MakeInterface ): t11 = make any <- string ("somewhere":string)
3838
3(*ssa.Store ): *t10 = t11
3939
4(*ssa.Slice ): t12 = slice t9[:]
4040
5(*ssa.Call ): t13 = fmt.Println(t12...)

internal/pkg/debug/render/testdata/TestParams.dot

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,36 @@ digraph {
22
subgraph cluster_0 {
33
color=black;
44
label="entry";
5-
"t0 = new [3]interface{} (varargs)\n(Alloc)" [shape=rectangle];
5+
"t0 = new [3]any (varargs)\n(Alloc)" [shape=rectangle];
66
"t1 = &t0[0:int]\n(IndexAddr)" [shape=rectangle];
7-
"t2 = make interface{} <- int (a)\n(MakeInterface)" [shape=rectangle];
7+
"t2 = make any <- int (a)\n(MakeInterface)" [shape=rectangle];
88
"*t1 = t2\n(Store)" [shape=diamond];
99
"t3 = &t0[1:int]\n(IndexAddr)" [shape=rectangle];
10-
"t4 = make interface{} <- int (b)\n(MakeInterface)" [shape=rectangle];
10+
"t4 = make any <- int (b)\n(MakeInterface)" [shape=rectangle];
1111
"*t3 = t4\n(Store)" [shape=diamond];
1212
"t5 = &t0[2:int]\n(IndexAddr)" [shape=rectangle];
13-
"t6 = make interface{} <- string (c)\n(MakeInterface)" [shape=rectangle];
13+
"t6 = make any <- string (c)\n(MakeInterface)" [shape=rectangle];
1414
"*t5 = t6\n(Store)" [shape=diamond];
1515
"t7 = slice t0[:]\n(Slice)" [shape=rectangle];
1616
"t8 = fmt.Println(t7...)\n(Call)" [shape=rectangle];
1717
"return\n(Return)" [shape=diamond];
1818
}
19-
"t0 = new [3]interface{} (varargs)\n(Alloc)" -> "t1 = &t0[0:int]\n(IndexAddr)" [color=orange];
19+
"t0 = new [3]any (varargs)\n(Alloc)" -> "t1 = &t0[0:int]\n(IndexAddr)" [color=orange];
2020
"0:int\n(Const)" -> "t1 = &t0[0:int]\n(IndexAddr)" [color=orange];
21-
"a\n(Parameter)" -> "t2 = make interface{} <- int (a)\n(MakeInterface)" [color=orange];
21+
"a\n(Parameter)" -> "t2 = make any <- int (a)\n(MakeInterface)" [color=orange];
2222
"t1 = &t0[0:int]\n(IndexAddr)" -> "*t1 = t2\n(Store)" [color=orange];
23-
"t2 = make interface{} <- int (a)\n(MakeInterface)" -> "*t1 = t2\n(Store)" [color=orange];
24-
"t0 = new [3]interface{} (varargs)\n(Alloc)" -> "t3 = &t0[1:int]\n(IndexAddr)" [color=orange];
23+
"t2 = make any <- int (a)\n(MakeInterface)" -> "*t1 = t2\n(Store)" [color=orange];
24+
"t0 = new [3]any (varargs)\n(Alloc)" -> "t3 = &t0[1:int]\n(IndexAddr)" [color=orange];
2525
"1:int\n(Const)" -> "t3 = &t0[1:int]\n(IndexAddr)" [color=orange];
26-
"b\n(Parameter)" -> "t4 = make interface{} <- int (b)\n(MakeInterface)" [color=orange];
26+
"b\n(Parameter)" -> "t4 = make any <- int (b)\n(MakeInterface)" [color=orange];
2727
"t3 = &t0[1:int]\n(IndexAddr)" -> "*t3 = t4\n(Store)" [color=orange];
28-
"t4 = make interface{} <- int (b)\n(MakeInterface)" -> "*t3 = t4\n(Store)" [color=orange];
29-
"t0 = new [3]interface{} (varargs)\n(Alloc)" -> "t5 = &t0[2:int]\n(IndexAddr)" [color=orange];
28+
"t4 = make any <- int (b)\n(MakeInterface)" -> "*t3 = t4\n(Store)" [color=orange];
29+
"t0 = new [3]any (varargs)\n(Alloc)" -> "t5 = &t0[2:int]\n(IndexAddr)" [color=orange];
3030
"2:int\n(Const)" -> "t5 = &t0[2:int]\n(IndexAddr)" [color=orange];
31-
"c\n(Parameter)" -> "t6 = make interface{} <- string (c)\n(MakeInterface)" [color=orange];
31+
"c\n(Parameter)" -> "t6 = make any <- string (c)\n(MakeInterface)" [color=orange];
3232
"t5 = &t0[2:int]\n(IndexAddr)" -> "*t5 = t6\n(Store)" [color=orange];
33-
"t6 = make interface{} <- string (c)\n(MakeInterface)" -> "*t5 = t6\n(Store)" [color=orange];
34-
"t0 = new [3]interface{} (varargs)\n(Alloc)" -> "t7 = slice t0[:]\n(Slice)" [color=orange];
33+
"t6 = make any <- string (c)\n(MakeInterface)" -> "*t5 = t6\n(Store)" [color=orange];
34+
"t0 = new [3]any (varargs)\n(Alloc)" -> "t7 = slice t0[:]\n(Slice)" [color=orange];
3535
"Println\n(Function)" -> "t8 = fmt.Println(t7...)\n(Call)" [color=orange];
3636
"t7 = slice t0[:]\n(Slice)" -> "t8 = fmt.Println(t7...)\n(Call)" [color=orange];
3737
}

internal/pkg/debug/render/testdata/TestParams.ssa

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
func TestParams(a int, b int, c string)
22
0: entry
3-
0(*ssa.Alloc ): t0 = new [3]interface{} (varargs)
3+
0(*ssa.Alloc ): t0 = new [3]any (varargs)
44
1(*ssa.IndexAddr ): t1 = &t0[0:int]
5-
2(*ssa.MakeInterface ): t2 = make interface{} <- int (a)
5+
2(*ssa.MakeInterface ): t2 = make any <- int (a)
66
3(*ssa.Store ): *t1 = t2
77
4(*ssa.IndexAddr ): t3 = &t0[1:int]
8-
5(*ssa.MakeInterface ): t4 = make interface{} <- int (b)
8+
5(*ssa.MakeInterface ): t4 = make any <- int (b)
99
6(*ssa.Store ): *t3 = t4
1010
7(*ssa.IndexAddr ): t5 = &t0[2:int]
11-
8(*ssa.MakeInterface ): t6 = make interface{} <- string (c)
11+
8(*ssa.MakeInterface ): t6 = make any <- string (c)
1212
9(*ssa.Store ): *t5 = t6
1313
10(*ssa.Slice ): t7 = slice t0[:]
1414
11(*ssa.Call ): t8 = fmt.Println(t7...)

internal/pkg/debug/render/testdata/TestSingleBlock.dot

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ digraph {
1616
"t7 = &t0.Y [#1]\n(FieldAddr)" [shape=rectangle];
1717
"t8 = *t7\n(UnOp)" [shape=rectangle];
1818
"t9 = t6 + t8\n(BinOp)" [shape=rectangle];
19-
"t10 = new [1]interface{} (varargs)\n(Alloc)" [shape=rectangle];
19+
"t10 = new [1]any (varargs)\n(Alloc)" [shape=rectangle];
2020
"t11 = &t10[0:int]\n(IndexAddr)" [shape=rectangle];
21-
"t12 = make interface{} <- int (t9)\n(MakeInterface)" [shape=rectangle];
21+
"t12 = make any <- int (t9)\n(MakeInterface)" [shape=rectangle];
2222
"*t11 = t12\n(Store)" [shape=diamond];
2323
"t13 = slice t10[:]\n(Slice)" [shape=rectangle];
2424
"t14 = fmt.Println(t13...)\n(Call)" [shape=rectangle];
@@ -42,12 +42,12 @@ digraph {
4242
"t7 = &t0.Y [#1]\n(FieldAddr)" -> "t8 = *t7\n(UnOp)" [color=orange];
4343
"t6 = *t5\n(UnOp)" -> "t9 = t6 + t8\n(BinOp)" [color=orange];
4444
"t8 = *t7\n(UnOp)" -> "t9 = t6 + t8\n(BinOp)" [color=orange];
45-
"t10 = new [1]interface{} (varargs)\n(Alloc)" -> "t11 = &t10[0:int]\n(IndexAddr)" [color=orange];
45+
"t10 = new [1]any (varargs)\n(Alloc)" -> "t11 = &t10[0:int]\n(IndexAddr)" [color=orange];
4646
"0:int\n(Const)" -> "t11 = &t10[0:int]\n(IndexAddr)" [color=orange];
47-
"t9 = t6 + t8\n(BinOp)" -> "t12 = make interface{} <- int (t9)\n(MakeInterface)" [color=orange];
47+
"t9 = t6 + t8\n(BinOp)" -> "t12 = make any <- int (t9)\n(MakeInterface)" [color=orange];
4848
"t11 = &t10[0:int]\n(IndexAddr)" -> "*t11 = t12\n(Store)" [color=orange];
49-
"t12 = make interface{} <- int (t9)\n(MakeInterface)" -> "*t11 = t12\n(Store)" [color=orange];
50-
"t10 = new [1]interface{} (varargs)\n(Alloc)" -> "t13 = slice t10[:]\n(Slice)" [color=orange];
49+
"t12 = make any <- int (t9)\n(MakeInterface)" -> "*t11 = t12\n(Store)" [color=orange];
50+
"t10 = new [1]any (varargs)\n(Alloc)" -> "t13 = slice t10[:]\n(Slice)" [color=orange];
5151
"Println\n(Function)" -> "t14 = fmt.Println(t13...)\n(Call)" [color=orange];
5252
"t13 = slice t10[:]\n(Slice)" -> "t14 = fmt.Println(t13...)\n(Call)" [color=orange];
5353
}

internal/pkg/debug/render/testdata/TestSingleBlock.ssa

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ func TestSingleBlock()
1414
11(*ssa.FieldAddr ): t7 = &t0.Y [#1]
1515
12(*ssa.UnOp ): t8 = *t7
1616
13(*ssa.BinOp ): t9 = t6 + t8
17-
14(*ssa.Alloc ): t10 = new [1]interface{} (varargs)
17+
14(*ssa.Alloc ): t10 = new [1]any (varargs)
1818
15(*ssa.IndexAddr ): t11 = &t10[0:int]
19-
16(*ssa.MakeInterface ): t12 = make interface{} <- int (t9)
19+
16(*ssa.MakeInterface ): t12 = make any <- int (t9)
2020
17(*ssa.Store ): *t11 = t12
2121
18(*ssa.Slice ): t13 = slice t10[:]
2222
19(*ssa.Call ): t14 = fmt.Println(t13...)

0 commit comments

Comments
 (0)