diff options
author | Dave Cheney <dave@cheney.net> | 2016-09-15 15:45:10 +1000 |
---|---|---|
committer | Dave Cheney <dave@cheney.net> | 2016-09-15 13:57:42 +0000 |
commit | d7012ca282092e876c3f12b758e12d6eabc8cc3c (patch) | |
tree | eb73f3d1dbd8ae319a8505e36221120f1da1529c /src/cmd/compile/internal/gc/util.go | |
parent | 896ac677b5e3e80278cc1ce179d8a077ac3a6d2f (diff) | |
download | go-d7012ca282092e876c3f12b758e12d6eabc8cc3c.tar.gz go-d7012ca282092e876c3f12b758e12d6eabc8cc3c.zip |
cmd/compile/internal/gc: unexport more helper functions
After the removal of the old backend many types are no longer referenced
outside internal/gc. Make these functions private so that tools like
honnef.co/go/unused can spot when they become dead code. In doing so
this CL identified several previously public helpers which are no longer
used, so removes them.
This should be the last of the public functions.
Change-Id: I7e9c4e72f86f391b428b9dddb6f0d516529706c3
Reviewed-on: https://go-review.googlesource.com/29134
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/gc/util.go')
-rw-r--r-- | src/cmd/compile/internal/gc/util.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/gc/util.go b/src/cmd/compile/internal/gc/util.go index 18e990a91a..3786769a24 100644 --- a/src/cmd/compile/internal/gc/util.go +++ b/src/cmd/compile/internal/gc/util.go @@ -16,7 +16,7 @@ func (n *Node) Line() string { var atExitFuncs []func() -func AtExit(f func()) { +func atExit(f func()) { atExitFuncs = append(atExitFuncs, f) } @@ -44,7 +44,7 @@ func startProfile() { if err := pprof.StartCPUProfile(f); err != nil { Fatalf("%v", err) } - AtExit(pprof.StopCPUProfile) + atExit(pprof.StopCPUProfile) } if memprofile != "" { if memprofilerate != 0 { @@ -54,7 +54,7 @@ func startProfile() { if err != nil { Fatalf("%v", err) } - AtExit(func() { + atExit(func() { runtime.GC() // profile all outstanding allocations if err := pprof.WriteHeapProfile(f); err != nil { Fatalf("%v", err) |