aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/main.go
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2020-08-31 14:29:58 -0400
committerDavid Chase <drchase@google.com>2020-10-01 20:52:34 +0000
commitf4cbf3477f1456b4d28a7b74b31820ee60b7e6d1 (patch)
tree1a78d5de195f50c6df96615e6d42d7159de215ba /src/cmd/compile/internal/gc/main.go
parentc78c79f152dff010820a22e9a79cfffe48322914 (diff)
downloadgo-f4cbf3477f1456b4d28a7b74b31820ee60b7e6d1.tar.gz
go-f4cbf3477f1456b4d28a7b74b31820ee60b7e6d1.zip
cmd/compile: allow directory specification for GOSSAFUNC output
This was useful for debugging failures occurring during make.bash. The added flush also ensures that any hints in the GOSSAFUNC output are flushed before fatal exit. The environment variable GOSSADIR specifies where the SSA html debugging files should be placed. To avoid collisions, each one is written into the [package].[functionOrMethod].html, where [package] is the filepath separator separated package name, function is the function name, and method is either (*Type).Method, or Type.Method, as appropriate. Directories are created as necessary to make this work. Change-Id: I420927426b618b633bb1ffc51cf0f223b8f6d49c Reviewed-on: https://go-review.googlesource.com/c/go/+/252338 Trust: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/gc/main.go')
-rw-r--r--src/cmd/compile/internal/gc/main.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go
index 7ad3bfe0c8..e4e4ce72fd 100644
--- a/src/cmd/compile/internal/gc/main.go
+++ b/src/cmd/compile/internal/gc/main.go
@@ -516,6 +516,7 @@ func Main(archInit func(*Arch)) {
}
ssaDump = os.Getenv("GOSSAFUNC")
+ ssaDir = os.Getenv("GOSSADIR")
if ssaDump != "" {
if strings.HasSuffix(ssaDump, "+") {
ssaDump = ssaDump[:len(ssaDump)-1]