Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade the Go version to v1.18, and x/tools to v0.1.11. Support generics better. #325

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
branches: [master]

env:
GO_VERSION: "1.14"
GO_VERSION: "1.18"

jobs:
lint:
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Check goimports
if: ${{ always() }}
run: |
go install golang.org/x/tools/cmd/goimports
go install golang.org/x/tools/cmd/goimports@v0.1.10
if [[ $(goimports -l cmd internal pkg) ]]; then
echo 'Please run `goimports -w cmd internal pkg`.'
false
Expand All @@ -47,13 +47,13 @@ jobs:
- name: Check for license headers
if: ${{ always() }}
run: |
go get -u github.com/google/addlicense
go install github.com/google/addlicense@v1.0.0
addlicense -check cmd internal pkg

- name: Run staticcheck
if: ${{ always() }}
run: |
go install honnef.co/go/tools/cmd/staticcheck
go install honnef.co/go/tools/cmd/staticcheck@v0.3.1
staticcheck ./...

- name: Check YAML
Expand Down
12 changes: 10 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
module github.com/google/go-flow-levee

go 1.14
go 1.18

require (
github.com/google/go-cmp v0.5.2
golang.org/x/tools v0.0.0-20200416214402-fc959738d646
golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171
golang.org/x/tools v0.1.11-0.20220504225841-45c8a7131235
sigs.k8s.io/yaml v1.2.0
)

require (
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
gopkg.in/yaml.v2 v2.2.8 // indirect
)
26 changes: 8 additions & 18 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,14 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200416214402-fc959738d646 h1:7CEkhBsBejkW845gR1AmglqMfc1yGzn42FBmtM4jxyM=
golang.org/x/tools v0.0.0-20200416214402-fc959738d646/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171 h1:DZhP7zSquENyG3Yb6ZpGqNEtgE8dfXhcLcheIF9RQHY=
golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/tools v0.1.11-0.20220504225841-45c8a7131235 h1:crlaTzOCJe82TDDRppEHbWCLjV9WU+uEPhpF07euMnI=
golang.org/x/tools v0.1.11-0.20220504225841-45c8a7131235/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/debug/render/testdata/TestClosure.ssa
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ func TestClosure()
1(*ssa.Return ): return
func TestClosure$1(x int)
0: entry
0(*ssa.Alloc ): t0 = new [1]interface{} (varargs)
0(*ssa.Alloc ): t0 = new [1]any (varargs)
1(*ssa.IndexAddr ): t1 = &t0[0:int]
2(*ssa.MakeInterface ): t2 = make interface{} <- int (x)
2(*ssa.MakeInterface ): t2 = make any <- int (x)
3(*ssa.Store ): *t1 = t2
4(*ssa.Slice ): t3 = slice t0[:]
5(*ssa.Call ): t4 = fmt.Println(t3...)
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/debug/render/testdata/TestDisconnected.dot
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ digraph {
color=black;
label="for.done";
"t2 = \"error: \":string + \"unreachable code\":string\n(BinOp)" [shape=rectangle];
"t3 = fmt.Printf(t2, nil:[]interface{}...)\n(Call)" [shape=rectangle];
"t3 = fmt.Printf(t2, nil:[]any...)\n(Call)" [shape=rectangle];
"return\n(Return)" [shape=diamond];
}
subgraph cluster_3 {
Expand All @@ -32,9 +32,9 @@ digraph {
"1:int\n(Const)" -> "t1 = t0 + 1:int\n(BinOp)" [color=orange];
"\"error: \":string\n(Const)" -> "t2 = \"error: \":string + \"unreachable code\":string\n(BinOp)" [color=orange];
"\"unreachable code\":string\n(Const)" -> "t2 = \"error: \":string + \"unreachable code\":string\n(BinOp)" [color=orange];
"Printf\n(Function)" -> "t3 = fmt.Printf(t2, nil:[]interface{}...)\n(Call)" [color=orange];
"t2 = \"error: \":string + \"unreachable code\":string\n(BinOp)" -> "t3 = fmt.Printf(t2, nil:[]interface{}...)\n(Call)" [color=orange];
"nil:[]interface{}\n(Const)" -> "t3 = fmt.Printf(t2, nil:[]interface{}...)\n(Call)" [color=orange];
"Printf\n(Function)" -> "t3 = fmt.Printf(t2, nil:[]any...)\n(Call)" [color=orange];
"t2 = \"error: \":string + \"unreachable code\":string\n(BinOp)" -> "t3 = fmt.Printf(t2, nil:[]any...)\n(Call)" [color=orange];
"nil:[]any\n(Const)" -> "t3 = fmt.Printf(t2, nil:[]any...)\n(Call)" [color=orange];
"0:int\n(Const)" -> "t4 = phi [0: 0:int, 1: t1] #i\n(Phi)" [color=orange];
"t1 = t0 + 1:int\n(BinOp)" -> "t4 = phi [0: 0:int, 1: t1] #i\n(Phi)" [color=orange];
"1:int\n(Const)" -> "t5 = 1:int * 2:int\n(BinOp)" [color=orange];
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/debug/render/testdata/TestDisconnected.ssa
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ func TestDisconnected()
2(*ssa.Jump ): jump 3
3: for.done
0(*ssa.BinOp ): t2 = "error: ":string + "unreachable code":string
1(*ssa.Call ): t3 = fmt.Printf(t2, nil:[]interface{}...)
1(*ssa.Call ): t3 = fmt.Printf(t2, nil:[]any...)
2(*ssa.Return ): return
32 changes: 16 additions & 16 deletions internal/pkg/debug/render/testdata/TestMultiBlock.dot
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ digraph {
subgraph cluster_3 {
color=black;
label="if.else";
"t9 = new [1]interface{} (varargs)\n(Alloc)" [shape=rectangle];
"t9 = new [1]any (varargs)\n(Alloc)" [shape=rectangle];
"t10 = &t9[0:int]\n(IndexAddr)" [shape=rectangle];
"t11 = make interface{} <- string (\"somewhere\":string)\n(MakeInterface)" [shape=rectangle];
"t11 = make any <- string (\"somewhere\":string)\n(MakeInterface)" [shape=rectangle];
"*t10 = t11\n(Store)" [shape=diamond];
"t12 = slice t9[:]\n(Slice)" [shape=rectangle];
"t13 = fmt.Println(t12...)\n(Call)" [shape=rectangle];
Expand All @@ -43,12 +43,12 @@ digraph {
"t15 = *t14\n(UnOp)" [shape=rectangle];
"t16 = &t0.Y [#1]\n(FieldAddr)" [shape=rectangle];
"t17 = *t16\n(UnOp)" [shape=rectangle];
"t18 = new [2]interface{} (varargs)\n(Alloc)" [shape=rectangle];
"t18 = new [2]any (varargs)\n(Alloc)" [shape=rectangle];
"t19 = &t18[0:int]\n(IndexAddr)" [shape=rectangle];
"t20 = make interface{} <- int (t15)\n(MakeInterface)" [shape=rectangle];
"t20 = make any <- int (t15)\n(MakeInterface)" [shape=rectangle];
"*t19 = t20\n(Store)" [shape=diamond];
"t21 = &t18[1:int]\n(IndexAddr)" [shape=rectangle];
"t22 = make interface{} <- int (t17)\n(MakeInterface)" [shape=rectangle];
"t22 = make any <- int (t17)\n(MakeInterface)" [shape=rectangle];
"*t21 = t22\n(Store)" [shape=diamond];
"t23 = slice t18[:]\n(Slice)" [shape=rectangle];
"t24 = fmt.Printf(\"in top right quad...\":string, t23...)\n(Call)" [shape=rectangle];
Expand All @@ -70,29 +70,29 @@ digraph {
"t7 = *t6\n(UnOp)" -> "t8 = t7 > 0:int\n(BinOp)" [color=orange];
"0:int\n(Const)" -> "t8 = t7 > 0:int\n(BinOp)" [color=orange];
"t8 = t7 > 0:int\n(BinOp)" -> "if t8 goto 4 else 2\n(If)" [color=orange];
"t9 = new [1]interface{} (varargs)\n(Alloc)" -> "t10 = &t9[0:int]\n(IndexAddr)" [color=orange];
"t9 = new [1]any (varargs)\n(Alloc)" -> "t10 = &t9[0:int]\n(IndexAddr)" [color=orange];
"0:int\n(Const)" -> "t10 = &t9[0:int]\n(IndexAddr)" [color=orange];
"\"somewhere\":string\n(Const)" -> "t11 = make interface{} <- string (\"somewhere\":string)\n(MakeInterface)" [color=orange];
"\"somewhere\":string\n(Const)" -> "t11 = make any <- string (\"somewhere\":string)\n(MakeInterface)" [color=orange];
"t10 = &t9[0:int]\n(IndexAddr)" -> "*t10 = t11\n(Store)" [color=orange];
"t11 = make interface{} <- string (\"somewhere\":string)\n(MakeInterface)" -> "*t10 = t11\n(Store)" [color=orange];
"t9 = new [1]interface{} (varargs)\n(Alloc)" -> "t12 = slice t9[:]\n(Slice)" [color=orange];
"t11 = make any <- string (\"somewhere\":string)\n(MakeInterface)" -> "*t10 = t11\n(Store)" [color=orange];
"t9 = new [1]any (varargs)\n(Alloc)" -> "t12 = slice t9[:]\n(Slice)" [color=orange];
"Println\n(Function)" -> "t13 = fmt.Println(t12...)\n(Call)" [color=orange];
"t12 = slice t9[:]\n(Slice)" -> "t13 = fmt.Println(t12...)\n(Call)" [color=orange];
"t0 = local image.Point (p)\n(Alloc)" -> "t14 = &t0.X [#0]\n(FieldAddr)" [color=orange];
"t14 = &t0.X [#0]\n(FieldAddr)" -> "t15 = *t14\n(UnOp)" [color=orange];
"t0 = local image.Point (p)\n(Alloc)" -> "t16 = &t0.Y [#1]\n(FieldAddr)" [color=orange];
"t16 = &t0.Y [#1]\n(FieldAddr)" -> "t17 = *t16\n(UnOp)" [color=orange];
"t18 = new [2]interface{} (varargs)\n(Alloc)" -> "t19 = &t18[0:int]\n(IndexAddr)" [color=orange];
"t18 = new [2]any (varargs)\n(Alloc)" -> "t19 = &t18[0:int]\n(IndexAddr)" [color=orange];
"0:int\n(Const)" -> "t19 = &t18[0:int]\n(IndexAddr)" [color=orange];
"t15 = *t14\n(UnOp)" -> "t20 = make interface{} <- int (t15)\n(MakeInterface)" [color=orange];
"t15 = *t14\n(UnOp)" -> "t20 = make any <- int (t15)\n(MakeInterface)" [color=orange];
"t19 = &t18[0:int]\n(IndexAddr)" -> "*t19 = t20\n(Store)" [color=orange];
"t20 = make interface{} <- int (t15)\n(MakeInterface)" -> "*t19 = t20\n(Store)" [color=orange];
"t18 = new [2]interface{} (varargs)\n(Alloc)" -> "t21 = &t18[1:int]\n(IndexAddr)" [color=orange];
"t20 = make any <- int (t15)\n(MakeInterface)" -> "*t19 = t20\n(Store)" [color=orange];
"t18 = new [2]any (varargs)\n(Alloc)" -> "t21 = &t18[1:int]\n(IndexAddr)" [color=orange];
"1:int\n(Const)" -> "t21 = &t18[1:int]\n(IndexAddr)" [color=orange];
"t17 = *t16\n(UnOp)" -> "t22 = make interface{} <- int (t17)\n(MakeInterface)" [color=orange];
"t17 = *t16\n(UnOp)" -> "t22 = make any <- int (t17)\n(MakeInterface)" [color=orange];
"t21 = &t18[1:int]\n(IndexAddr)" -> "*t21 = t22\n(Store)" [color=orange];
"t22 = make interface{} <- int (t17)\n(MakeInterface)" -> "*t21 = t22\n(Store)" [color=orange];
"t18 = new [2]interface{} (varargs)\n(Alloc)" -> "t23 = slice t18[:]\n(Slice)" [color=orange];
"t22 = make any <- int (t17)\n(MakeInterface)" -> "*t21 = t22\n(Store)" [color=orange];
"t18 = new [2]any (varargs)\n(Alloc)" -> "t23 = slice t18[:]\n(Slice)" [color=orange];
"Printf\n(Function)" -> "t24 = fmt.Printf(\"in top right quad...\":string, t23...)\n(Call)" [color=orange];
"\"in top right quad...\":string\n(Const)" -> "t24 = fmt.Printf(\"in top right quad...\":string, t23...)\n(Call)" [color=orange];
"t23 = slice t18[:]\n(Slice)" -> "t24 = fmt.Printf(\"in top right quad...\":string, t23...)\n(Call)" [color=orange];
Expand Down
10 changes: 5 additions & 5 deletions internal/pkg/debug/render/testdata/TestMultiBlock.ssa
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ func TestMultiBlock()
1(*ssa.UnOp ): t15 = *t14
2(*ssa.FieldAddr ): t16 = &t0.Y [#1]
3(*ssa.UnOp ): t17 = *t16
4(*ssa.Alloc ): t18 = new [2]interface{} (varargs)
4(*ssa.Alloc ): t18 = new [2]any (varargs)
5(*ssa.IndexAddr ): t19 = &t18[0:int]
6(*ssa.MakeInterface ): t20 = make interface{} <- int (t15)
6(*ssa.MakeInterface ): t20 = make any <- int (t15)
7(*ssa.Store ): *t19 = t20
8(*ssa.IndexAddr ): t21 = &t18[1:int]
9(*ssa.MakeInterface ): t22 = make interface{} <- int (t17)
9(*ssa.MakeInterface ): t22 = make any <- int (t17)
10(*ssa.Store ): *t21 = t22
11(*ssa.Slice ): t23 = slice t18[:]
12(*ssa.Call ): t24 = fmt.Printf("in top right quad...":string, t23...)
13(*ssa.Jump ): jump 2
3: if.done
0(*ssa.Return ): return
4: if.else
0(*ssa.Alloc ): t9 = new [1]interface{} (varargs)
0(*ssa.Alloc ): t9 = new [1]any (varargs)
1(*ssa.IndexAddr ): t10 = &t9[0:int]
2(*ssa.MakeInterface ): t11 = make interface{} <- string ("somewhere":string)
2(*ssa.MakeInterface ): t11 = make any <- string ("somewhere":string)
3(*ssa.Store ): *t10 = t11
4(*ssa.Slice ): t12 = slice t9[:]
5(*ssa.Call ): t13 = fmt.Println(t12...)
Expand Down
28 changes: 14 additions & 14 deletions internal/pkg/debug/render/testdata/TestParams.dot
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@ digraph {
subgraph cluster_0 {
color=black;
label="entry";
"t0 = new [3]interface{} (varargs)\n(Alloc)" [shape=rectangle];
"t0 = new [3]any (varargs)\n(Alloc)" [shape=rectangle];
"t1 = &t0[0:int]\n(IndexAddr)" [shape=rectangle];
"t2 = make interface{} <- int (a)\n(MakeInterface)" [shape=rectangle];
"t2 = make any <- int (a)\n(MakeInterface)" [shape=rectangle];
"*t1 = t2\n(Store)" [shape=diamond];
"t3 = &t0[1:int]\n(IndexAddr)" [shape=rectangle];
"t4 = make interface{} <- int (b)\n(MakeInterface)" [shape=rectangle];
"t4 = make any <- int (b)\n(MakeInterface)" [shape=rectangle];
"*t3 = t4\n(Store)" [shape=diamond];
"t5 = &t0[2:int]\n(IndexAddr)" [shape=rectangle];
"t6 = make interface{} <- string (c)\n(MakeInterface)" [shape=rectangle];
"t6 = make any <- string (c)\n(MakeInterface)" [shape=rectangle];
"*t5 = t6\n(Store)" [shape=diamond];
"t7 = slice t0[:]\n(Slice)" [shape=rectangle];
"t8 = fmt.Println(t7...)\n(Call)" [shape=rectangle];
"return\n(Return)" [shape=diamond];
}
"t0 = new [3]interface{} (varargs)\n(Alloc)" -> "t1 = &t0[0:int]\n(IndexAddr)" [color=orange];
"t0 = new [3]any (varargs)\n(Alloc)" -> "t1 = &t0[0:int]\n(IndexAddr)" [color=orange];
"0:int\n(Const)" -> "t1 = &t0[0:int]\n(IndexAddr)" [color=orange];
"a\n(Parameter)" -> "t2 = make interface{} <- int (a)\n(MakeInterface)" [color=orange];
"a\n(Parameter)" -> "t2 = make any <- int (a)\n(MakeInterface)" [color=orange];
"t1 = &t0[0:int]\n(IndexAddr)" -> "*t1 = t2\n(Store)" [color=orange];
"t2 = make interface{} <- int (a)\n(MakeInterface)" -> "*t1 = t2\n(Store)" [color=orange];
"t0 = new [3]interface{} (varargs)\n(Alloc)" -> "t3 = &t0[1:int]\n(IndexAddr)" [color=orange];
"t2 = make any <- int (a)\n(MakeInterface)" -> "*t1 = t2\n(Store)" [color=orange];
"t0 = new [3]any (varargs)\n(Alloc)" -> "t3 = &t0[1:int]\n(IndexAddr)" [color=orange];
"1:int\n(Const)" -> "t3 = &t0[1:int]\n(IndexAddr)" [color=orange];
"b\n(Parameter)" -> "t4 = make interface{} <- int (b)\n(MakeInterface)" [color=orange];
"b\n(Parameter)" -> "t4 = make any <- int (b)\n(MakeInterface)" [color=orange];
"t3 = &t0[1:int]\n(IndexAddr)" -> "*t3 = t4\n(Store)" [color=orange];
"t4 = make interface{} <- int (b)\n(MakeInterface)" -> "*t3 = t4\n(Store)" [color=orange];
"t0 = new [3]interface{} (varargs)\n(Alloc)" -> "t5 = &t0[2:int]\n(IndexAddr)" [color=orange];
"t4 = make any <- int (b)\n(MakeInterface)" -> "*t3 = t4\n(Store)" [color=orange];
"t0 = new [3]any (varargs)\n(Alloc)" -> "t5 = &t0[2:int]\n(IndexAddr)" [color=orange];
"2:int\n(Const)" -> "t5 = &t0[2:int]\n(IndexAddr)" [color=orange];
"c\n(Parameter)" -> "t6 = make interface{} <- string (c)\n(MakeInterface)" [color=orange];
"c\n(Parameter)" -> "t6 = make any <- string (c)\n(MakeInterface)" [color=orange];
"t5 = &t0[2:int]\n(IndexAddr)" -> "*t5 = t6\n(Store)" [color=orange];
"t6 = make interface{} <- string (c)\n(MakeInterface)" -> "*t5 = t6\n(Store)" [color=orange];
"t0 = new [3]interface{} (varargs)\n(Alloc)" -> "t7 = slice t0[:]\n(Slice)" [color=orange];
"t6 = make any <- string (c)\n(MakeInterface)" -> "*t5 = t6\n(Store)" [color=orange];
"t0 = new [3]any (varargs)\n(Alloc)" -> "t7 = slice t0[:]\n(Slice)" [color=orange];
"Println\n(Function)" -> "t8 = fmt.Println(t7...)\n(Call)" [color=orange];
"t7 = slice t0[:]\n(Slice)" -> "t8 = fmt.Println(t7...)\n(Call)" [color=orange];
}
8 changes: 4 additions & 4 deletions internal/pkg/debug/render/testdata/TestParams.ssa
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
func TestParams(a int, b int, c string)
0: entry
0(*ssa.Alloc ): t0 = new [3]interface{} (varargs)
0(*ssa.Alloc ): t0 = new [3]any (varargs)
1(*ssa.IndexAddr ): t1 = &t0[0:int]
2(*ssa.MakeInterface ): t2 = make interface{} <- int (a)
2(*ssa.MakeInterface ): t2 = make any <- int (a)
3(*ssa.Store ): *t1 = t2
4(*ssa.IndexAddr ): t3 = &t0[1:int]
5(*ssa.MakeInterface ): t4 = make interface{} <- int (b)
5(*ssa.MakeInterface ): t4 = make any <- int (b)
6(*ssa.Store ): *t3 = t4
7(*ssa.IndexAddr ): t5 = &t0[2:int]
8(*ssa.MakeInterface ): t6 = make interface{} <- string (c)
8(*ssa.MakeInterface ): t6 = make any <- string (c)
9(*ssa.Store ): *t5 = t6
10(*ssa.Slice ): t7 = slice t0[:]
11(*ssa.Call ): t8 = fmt.Println(t7...)
Expand Down
12 changes: 6 additions & 6 deletions internal/pkg/debug/render/testdata/TestSingleBlock.dot
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ digraph {
"t7 = &t0.Y [#1]\n(FieldAddr)" [shape=rectangle];
"t8 = *t7\n(UnOp)" [shape=rectangle];
"t9 = t6 + t8\n(BinOp)" [shape=rectangle];
"t10 = new [1]interface{} (varargs)\n(Alloc)" [shape=rectangle];
"t10 = new [1]any (varargs)\n(Alloc)" [shape=rectangle];
"t11 = &t10[0:int]\n(IndexAddr)" [shape=rectangle];
"t12 = make interface{} <- int (t9)\n(MakeInterface)" [shape=rectangle];
"t12 = make any <- int (t9)\n(MakeInterface)" [shape=rectangle];
"*t11 = t12\n(Store)" [shape=diamond];
"t13 = slice t10[:]\n(Slice)" [shape=rectangle];
"t14 = fmt.Println(t13...)\n(Call)" [shape=rectangle];
Expand All @@ -42,12 +42,12 @@ digraph {
"t7 = &t0.Y [#1]\n(FieldAddr)" -> "t8 = *t7\n(UnOp)" [color=orange];
"t6 = *t5\n(UnOp)" -> "t9 = t6 + t8\n(BinOp)" [color=orange];
"t8 = *t7\n(UnOp)" -> "t9 = t6 + t8\n(BinOp)" [color=orange];
"t10 = new [1]interface{} (varargs)\n(Alloc)" -> "t11 = &t10[0:int]\n(IndexAddr)" [color=orange];
"t10 = new [1]any (varargs)\n(Alloc)" -> "t11 = &t10[0:int]\n(IndexAddr)" [color=orange];
"0:int\n(Const)" -> "t11 = &t10[0:int]\n(IndexAddr)" [color=orange];
"t9 = t6 + t8\n(BinOp)" -> "t12 = make interface{} <- int (t9)\n(MakeInterface)" [color=orange];
"t9 = t6 + t8\n(BinOp)" -> "t12 = make any <- int (t9)\n(MakeInterface)" [color=orange];
"t11 = &t10[0:int]\n(IndexAddr)" -> "*t11 = t12\n(Store)" [color=orange];
"t12 = make interface{} <- int (t9)\n(MakeInterface)" -> "*t11 = t12\n(Store)" [color=orange];
"t10 = new [1]interface{} (varargs)\n(Alloc)" -> "t13 = slice t10[:]\n(Slice)" [color=orange];
"t12 = make any <- int (t9)\n(MakeInterface)" -> "*t11 = t12\n(Store)" [color=orange];
"t10 = new [1]any (varargs)\n(Alloc)" -> "t13 = slice t10[:]\n(Slice)" [color=orange];
"Println\n(Function)" -> "t14 = fmt.Println(t13...)\n(Call)" [color=orange];
"t13 = slice t10[:]\n(Slice)" -> "t14 = fmt.Println(t13...)\n(Call)" [color=orange];
}
Loading