]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: extract inline related fields into separate Inline type
authorMatthew Dempsky <mdempsky@google.com>
Wed, 4 Apr 2018 22:53:27 +0000 (15:53 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 5 Apr 2018 05:12:36 +0000 (05:12 +0000)
commit562a199961c28741a93cf7a0365c0646da3ddb9f
tree580711cb4c4a2740538aeaf84ccc2781b403b686
parentf2b5f750df8cf84b4f6653a7b4c9dab0e177584c
cmd/compile: extract inline related fields into separate Inline type

Inl, Inldcl, and InlCost are only applicable to functions with bodies
that can be inlined, so pull them out into a separate Inline type to
make understanding them easier.

A side benefit is that we can check if a function can be inlined by
just checking if n.Func.Inl is non-nil, which simplifies handling of
empty function bodies.

While here, remove some unnecessary Curfn twiddling, and make imported
functions use Inl.Dcl instead of Func.Dcl for consistency for local
functions.

Passes toolstash-check.

Change-Id: Ifd4a80349d85d9e8e4484952b38ec4a63182e81f
Reviewed-on: https://go-review.googlesource.com/104756
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/bexport.go
src/cmd/compile/internal/gc/bimport.go
src/cmd/compile/internal/gc/inl.go
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/gc/pgen.go
src/cmd/compile/internal/gc/sizeof_test.go
src/cmd/compile/internal/gc/syntax.go