diff options
author | Matthew Dempsky <mdempsky@google.com> | 2020-09-14 12:56:37 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2020-09-14 23:42:44 +0000 |
commit | f4936d09fd5a1fff890d63ee2ab9543243dc4da6 (patch) | |
tree | b1099e69d2ac27b34a6ab87bc56d8b66ffcfc984 /test/inline.go | |
parent | 237410547bb81ae3c58e9c5bf0cf59edc989e243 (diff) | |
download | go-f4936d09fd5a1fff890d63ee2ab9543243dc4da6.tar.gz go-f4936d09fd5a1fff890d63ee2ab9543243dc4da6.zip |
cmd/compile: call fninit earlier
This allows the global initializers function to go through normal
mid-end optimizations (e.g., inlining, escape analysis) like any other
function.
Updates #33485.
Change-Id: I9bcfe98b8628d1aca09b4c238d8d3b74c69010a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/254839
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'test/inline.go')
-rw-r--r-- | test/inline.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/inline.go b/test/inline.go index 0b3ad55d46..1c5c1bc8d3 100644 --- a/test/inline.go +++ b/test/inline.go @@ -50,7 +50,7 @@ func j(x int) int { // ERROR "can inline j" } } -var somethingWrong error = errors.New("something went wrong") +var somethingWrong error = errors.New("something went wrong") // ERROR "can inline init" "inlining call to errors.New" "errors.errorString.* escapes to heap" // local closures can be inlined func l(x, y int) (int, int, error) { |