]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: improve findTypeLoop
authorMatthew Dempsky <mdempsky@google.com>
Tue, 1 Dec 2020 04:34:25 +0000 (20:34 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 1 Dec 2020 05:14:26 +0000 (05:14 +0000)
commitdadfc80bc173ce4475bc76231de5259d797b0522
tree264f570b3b4cf1869720085d6087f61526b88c92
parent45f3b646d42d73a8a54c81ada0ef1ffc11dce592
[dev.regabi] cmd/compile: improve findTypeLoop

When checking if a defined type is part of a type loop, we can
short-circuit if it was defined in another package. We can assume any
package we import already successfully compiled, so any types it
contains cannot be part of a type loop.

This also allows us to simplify the logic for recursing into the type
used in the type declaration, because any defined type from this
package will have a properly setup node.

Change-Id: Ic024814d95533afd9e59f2103c8ddb22bd87e900
Reviewed-on: https://go-review.googlesource.com/c/go/+/274294
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/compile/internal/gc/align.go