Commit 3afd2d7f authored by isharipo's avatar isharipo Committed by Josh Bleecher Snyder

cmd/compile/internal/gc: properly initialize ssa.Func Type field

The ssa.Func has Type field that is described as
function signature type.

It never gets any value and remains nil.
This leads to "<T>" signature printed representation.

Given this function declaration:
	func foo(x int, f func() string) (int, error)

GOSSAFUNC printed it as below:
	compiling foo
	foo <T>

After this change:
	compiling foo
	foo func(int, func() string) (int, error)

Change-Id: Iec5eec8aac5c76ff184659e30f41b2f5fe86d329
Reviewed-on: https://go-review.googlesource.com/102375
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
parent ea668e18
......@@ -110,6 +110,7 @@ func buildssa(fn *Node, worker int) *ssa.Func {
s.f = ssa.NewFunc(&fe)
s.config = ssaConfig
s.f.Type = fn.Type
s.f.Config = ssaConfig
s.f.Cache = &ssaCaches[worker]
s.f.Cache.Reset()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment