]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: refactor DWARF scope marking
authorMatthew Dempsky <mdempsky@google.com>
Sun, 10 Jan 2021 07:12:56 +0000 (23:12 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 12 Jan 2021 02:16:30 +0000 (02:16 +0000)
commit106aa941dfda45d4aa5235b12317124aaf8941a0
tree9977c0ca22451038ccfa37c449ca43e46ad12415
parent6a56c6c870a2ac8bae9e570641521ba5aa83ba51
[dev.typeparams] cmd/compile: refactor DWARF scope marking

This CL extracts and simplifies noder's DWARF scope tracking code to
make it easier for reuse by irgen.

The previous code tried to be really clever about avoid recording
multiple scope boundaries at the same position (as happens at the end
of "if" and "for" statements). I had a really hard time remember how
this code worked exactly, so I've reimplemented a simpler algorithm
that just tracks all scope marks, and then compacts them at the end
before saving them to the ir.Func.

Passes toolstash -cmp.

Change-Id: Ibeb37997b77dc5179360d7db557c82ae1682e127
Reviewed-on: https://go-review.googlesource.com/c/go/+/282918
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Robert Griesemer <gri@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/dwarfgen/marker.go [new file with mode: 0644]
src/cmd/compile/internal/noder/noder.go