]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove special treatment for cover vars in initorder
authorThan McIntosh <thanm@google.com>
Tue, 30 May 2023 14:49:11 +0000 (10:49 -0400)
committerThan McIntosh <thanm@google.com>
Tue, 30 May 2023 19:03:02 +0000 (19:03 +0000)
This patch reverts a portion of the changes in CL 443715, specifically
the code in initorder that treats coverage counter variables as special
with respect to init order. The special casing is no longer needed
now after a change to the way coverage instrumention is done (the go and
cover cmds now make sure that coverage variables appear first in
the compilation order).

Updates #56293.

Change-Id: Idf803ff4c1a095e88d455a6adcd63991687eb288
Reviewed-on: https://go-review.googlesource.com/c/go/+/499216
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/pkginit/initorder.go

index db24264989c42084e5bb733d20278bf9fa6616d4..9416470ca1e1ddd2d70e0f47f8204abdb1e784cc 100644 (file)
@@ -321,15 +321,6 @@ func (d *initDeps) foundDep(n *ir.Name) {
                return
        }
 
-       // Treat coverage counter variables effectively as invisible with
-       // respect to init order. If we don't do this, then the
-       // instrumentation vars can perturb the order of initialization
-       // away from the order of the original uninstrumented program.
-       // See issue #56293 for more details.
-       if n.CoverageCounter() || n.CoverageAuxVar() {
-               return
-       }
-
        if d.seen.Has(n) {
                return
        }