]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/ir: drop Inl.Body
authorMatthew Dempsky <mdempsky@google.com>
Sat, 26 Aug 2023 23:37:24 +0000 (16:37 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 29 Aug 2023 20:28:07 +0000 (20:28 +0000)
commit08bf6d14053fe861811e244156d451098c34c13f
tree2c79d2a74b6635e20b078353e2636fb4967efc88
parentad74bc4a92d0c903308b2e40fa07446a735dbbd2
cmd/compile/internal/ir: drop Inl.Body

We don't actually depend on Inl.Body anywhere, except it implicitly
serves to indicate whether Inl.Dcl has been populated. So replace it
with a boolean so we don't need to keep a useless copy of every
inlinable function body in memory.

While here, also add some Fatalfs to make sure there are no unused
local variables. The unified frontend now omits unreachable code
during export data writing, so there shouldn't be unused local
variables.

Also, since unified IR uses the same code/data to construct the
original function as inlined and/or imported functions, the Dcl list
should always be the same, which addresses the real root issue (i.e.,
that export/import could skew the Dcl lists).

Change-Id: I6e3435f3a0352f6efbae787344006efac1891e84
Reviewed-on: https://go-review.googlesource.com/c/go/+/523315
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/noder/linker.go
src/cmd/compile/internal/noder/reader.go