summaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/coverage/cover.go
Commit message (Collapse)AuthorAgeFilesLines
* cmd/compile/internal/ir: explicit Pos for New{Bool,Int,String}Matthew Dempsky2023-03-041-7/+7
| | | | | | | | | | | | | Stop depending on base.Pos for these. Change-Id: I58dea44f8141eb37b59a6e9f7db0c6baa516ad93 Reviewed-on: https://go-review.googlesource.com/c/go/+/472296 Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
* cmd/compile: special case coverage vars in pkg init orderThan McIntosh2022-10-181-39/+59
| | | | | | | | | | | | | | | | | When computing package initialization order, special case the counter variables inserted by "cmd/cover" for coverage instrumentation, since their presence can perturb the order in which variables are initialized in ways that are user-visible and incorrect with respect to the original (uninstrumented) program. Fixes #56293. Change-Id: Ieec9239ded4f8e2503ff9bbe0fe171afb771b335 Reviewed-on: https://go-review.googlesource.com/c/go/+/443715 Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
* cmd/compile: add coverage fixup modeThan McIntosh2022-09-271-0/+189
Adds a -coveragecfg=<configfile> command line option to the compiler to help support a cooperative "tool and compiler" mode for coverage instrumentation. In this mode the cmd/cover tool generates most of the counter instrumentation via source-to-source rewriting, but the compiler fixes up the result if passed the "-coveragecfg" option. The fixups include: - reclassifying counter variables (special storage class) - marking meta-data variables are read-only - adding in an init call to do registation Updates #51430. Change-Id: Iead72b85209725ee044542374465f118a3ee72e0 Reviewed-on: https://go-review.googlesource.com/c/go/+/395895 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>