aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/typecheck/iimport.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-08-24 00:32:30 -0700
committerMatthew Dempsky <mdempsky@google.com>2021-08-24 18:02:21 +0000
commit4a9f0cec2918c855a23d5581c0b1da95eb11dd17 (patch)
tree752cee76dbf555f816cd4088a3bf41790620aa9b /src/cmd/compile/internal/typecheck/iimport.go
parentdaa55b21d1e7707ed251336c851841bb0eca3021 (diff)
downloadgo-4a9f0cec2918c855a23d5581c0b1da95eb11dd17.tar.gz
go-4a9f0cec2918c855a23d5581c0b1da95eb11dd17.zip
cmd/compile: change irgen to generate exprs/stmts after decls processed
This CL changes irgen to wait until all top-level declarations have been processed before constructing any expressions or statements that reference them. This is the same approach that typecheck used. Mechanically, it splits varDecl and funcDecl (the two top-level declarations that can generate/contain code) into a part that runs immediately for constructing the ir.ONAME, and then a separate task that runs later to handle the code. It also adds an exprStmtOK flag to indicate when it's actually safe to start constructing (non-trivial) expressions and statements. Fixes #47928. Change-Id: I51942af6823aa561d341e2ffc1142948da025fa2 Reviewed-on: https://go-review.googlesource.com/c/go/+/344649 Trust: Matthew Dempsky <mdempsky@google.com> Trust: Dan Scales <danscales@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Dan Scales <danscales@google.com>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/iimport.go')
0 files changed, 0 insertions, 0 deletions