mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: add global autogeneratedPos
We use an "autogenerated" position in several places. Rather than recreate it each time, make one early on and reuse it. This removes the creation of new positions during the backend, which was not concurrency-safe. Updates #15756 Change-Id: Ic116b2e60f0e99de1a2ea87fe763831b50b645f8 Reviewed-on: https://go-review.googlesource.com/38915 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
b28f2f7399
commit
3431d9113c
5 changed files with 8 additions and 6 deletions
|
|
@ -351,6 +351,8 @@ func Main(archInit func(*Arch)) {
|
|||
dclcontext = PEXTERN
|
||||
nerrors = 0
|
||||
|
||||
autogeneratedPos = makePos(src.NewFileBase("<autogenerated>", "<autogenerated>"), 1, 0)
|
||||
|
||||
timings.Start("fe", "loadsys")
|
||||
loadsys()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue