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

Skip analyzers when seeing generics #324

Open
wants to merge 2 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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ go 1.14

require (
github.com/google/go-cmp v0.5.2
golang.org/x/tools v0.0.0-20200416214402-fc959738d646
golang.org/x/tools v0.1.11-0.20220504225841-45c8a7131235
sigs.k8s.io/yaml v1.2.0
)
20 changes: 20 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,41 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
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=
github.com/yuin/goldmark v1.4.1 h1:/vn0k+RBvwlxEmP5E7SZMqNxPhfMVFEJiykr15/0XKM=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
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/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
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/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/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
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/sync v0.0.0-20210220032951-036812b2e83c/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/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
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/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
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/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-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
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];
}
4 changes: 2 additions & 2 deletions internal/pkg/debug/render/testdata/TestSingleBlock.ssa
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ func TestSingleBlock()
11(*ssa.FieldAddr ): t7 = &t0.Y [#1]
12(*ssa.UnOp ): t8 = *t7
13(*ssa.BinOp ): t9 = t6 + t8
14(*ssa.Alloc ): t10 = new [1]interface{} (varargs)
14(*ssa.Alloc ): t10 = new [1]any (varargs)
15(*ssa.IndexAddr ): t11 = &t10[0:int]
16(*ssa.MakeInterface ): t12 = make interface{} <- int (t9)
16(*ssa.MakeInterface ): t12 = make any <- int (t9)
17(*ssa.Store ): *t11 = t12
18(*ssa.Slice ): t13 = slice t10[:]
19(*ssa.Call ): t14 = fmt.Println(t13...)
Expand Down
Loading