Closed
Description
Right now GOSSAFUNC
is a magical environment variable that allows to peek under the hood of SSA generation. It is an indispensable tool, and we need to think about converting it from magical hidden environment variable into command line option supplied to go tool compile
.
I propose this option: -ssafunc=<function>
My plan is read this option to the global variable and use that in place of GOSSAFUNC.
And in inlining phase I want to record to which functions calls were inlined from *n if ssafunc==n.funcname()
. It is to display the sources of all inlined functions in ssa.html.
Also the comment by @rsc in src/cmd/go/internal/work/exec.go
motivated me:
// TODO(rsc): Convince compiler team not to add more magic environment variables,
// or perhaps restrict the environment variables passed to subprocesses.
magic := []string{
"GOCLOBBERDEADHASH",
"GOSSAFUNC",
"GO_SSA_PHI_LOC_CUTOFF",
"GOSSAHASH",
}
CC: @josharian @randall77