A simple Golang SSA viewer tool that can be used for code analysis or to create a linter.
ssa.html generate code modify from src/cmd/compile/internal/ssa/html.go
because golang.org/x/tools/go/ssa
and src/cmd/compile/internal/ssa
are both SSA implementations in Go, but they are very different from each other.
go get github.com/kkHAIKE/ssaviewer
- cd into your package folder
ssaviewer
show all ssa.Functionssaviewer function_name
generate the ssa.html
- AST location binding
- GOSSAFUNC