aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/func.go
diff options
context:
space:
mode:
authorYury Smolsky <yury@smolsky.by>2018-10-16 13:03:35 +0300
committerYury Smolsky <yury@smolsky.by>2018-11-21 10:22:43 +0000
commit3068fcfa0d6535d081a6fe3fb3dc8dd30bff370f (patch)
tree549af44a03cc69889468079bd7a0058231c01fae /src/cmd/compile/internal/ssa/func.go
parentc6e698d5dd0d3a309c2d93368dcc451820deb66d (diff)
downloadgo-3068fcfa0d6535d081a6fe3fb3dc8dd30bff370f.tar.gz
go-3068fcfa0d6535d081a6fe3fb3dc8dd30bff370f.zip
cmd/compile: add control flow graphs to ssa.html
This CL adds CFGs to ssa.html. It execs dot to generate SVG, which then gets inlined into the html. Some standard naming and javascript hacks enable integration with the rest of ssa.html. Clicking on blocks highlights the relevant part of the CFG, and vice versa. Sample output and screenshots can be seen in #28177. CFGs can be turned on with the suffix mask: :* - dump CFG for every phase :lower - just the lower phase :lower-layout - lower through layout :w,x-y - phases w and x through y Calling dot after every pass is noticeably slow, instead use the range of phases. Dead blocks are not displayed on CFG. User can zoom and pan individual CFG when the automatic adjustment has failed. Dot-related errors are reported without bringing down the process. Fixes #28177 Change-Id: Id52c42d86c4559ca737288aa10561b67a119c63d Reviewed-on: https://go-review.googlesource.com/c/142517 Run-TryBot: Yury Smolsky <yury@smolsky.by> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/func.go')
-rw-r--r--src/cmd/compile/internal/ssa/func.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/func.go b/src/cmd/compile/internal/ssa/func.go
index d73d39ce28..7e7e2042d9 100644
--- a/src/cmd/compile/internal/ssa/func.go
+++ b/src/cmd/compile/internal/ssa/func.go
@@ -43,6 +43,7 @@ type Func struct {
PrintOrHtmlSSA bool // true if GOSSAFUNC matches, true even if fe.Log() (spew phase results to stdout) is false.
scheduled bool // Values in Blocks are in final order
+ laidout bool // Blocks are ordered
NoSplit bool // true if function is marked as nosplit. Used by schedule check pass.
// when register allocation is done, maps value ids to locations