mirror of
https://github.com/golang/go
synced 2024-09-30 15:28:33 -06:00
cmd/compile: repair GOSSAFUNC functionality
GOSSAFUNC=foo had previously only done printing for the single function foo, and didn't quite clean up after itself properly. Changes ensures that Config.HTML != nil iff GOSSAFUNC==name-of-current-function. Change-Id: I255e2902dfc64f715d93225f0d29d9525c06f764 Reviewed-on: https://go-review.googlesource.com/29250 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
ad7732a9ac
commit
3eb16c059d
@ -26,6 +26,7 @@ func initssa() *ssa.Config {
|
||||
ssaConfig.Set387(Thearch.Use387)
|
||||
}
|
||||
}
|
||||
ssaConfig.HTML = nil
|
||||
return ssaConfig
|
||||
}
|
||||
|
||||
@ -71,11 +72,6 @@ func buildssa(fn *Node) *ssa.Func {
|
||||
s.config.HTML = ssa.NewHTMLWriter("ssa.html", s.config, name)
|
||||
// TODO: generate and print a mapping from nodes to values and blocks
|
||||
}
|
||||
defer func() {
|
||||
if !printssa {
|
||||
s.config.HTML.Close()
|
||||
}
|
||||
}()
|
||||
|
||||
// Allocate starting block
|
||||
s.f.Entry = s.f.NewBlock(ssa.BlockPlain)
|
||||
@ -4298,6 +4294,7 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) {
|
||||
removevardef(ptxt)
|
||||
|
||||
f.Config.HTML.Close()
|
||||
f.Config.HTML = nil
|
||||
}
|
||||
|
||||
type FloatingEQNEJump struct {
|
||||
|
Loading…
Reference in New Issue
Block a user