diff options
author | Matthew Dempsky <mdempsky@google.com> | 2021-06-04 13:14:32 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2021-06-05 23:29:09 +0000 |
commit | a5be3eaee2cc0b8e5da216bdf545b9ca44789892 (patch) | |
tree | 6c22f8db592b5fe5bf27e405485a7263ef82c3d0 /src/cmd/compile/internal/gc/obj.go | |
parent | 4c072c94dc2ffedd29d51d04aba2e1a6f2afd93f (diff) | |
download | go-a5be3eaee2cc0b8e5da216bdf545b9ca44789892.tar.gz go-a5be3eaee2cc0b8e5da216bdf545b9ca44789892.zip |
[dev.typeparams] cmd/compile: refactor export writing
This CL reorganizes export writing in preparation for unified IR:
1. It moves dumpexport into noder as noder.WriteExports so that it can
be extended to include unified IR's export data.
2. Adds an "extensions" flag to typecheck.WriteExports to control
whether the compiler-only extension data (e.g., function bodies and
linker symbol info) is included in the exports.
3. It moves the gc.exporter type into typecheck and renames it to
"crawler". The type originated as the implementation of
the (pre-iexport) binary exporter, but since the removal of bexport
it's been relegated to simply crawling the exported functions/bodies
graph to identify which inline bodies need to be included.
4. It changes inline.Inline_Flood into the method crawler.markInlBody.
Inline_Flood doesn't actually have anything to do with the rest of
inlining; its current name and location are just historical quirks.
Passes toolstash -cmp.
Change-Id: I6445e2de9d3ce500a3aded5a8e20b09f46d23dbc
Reviewed-on: https://go-review.googlesource.com/c/go/+/325212
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/gc/obj.go')
-rw-r--r-- | src/cmd/compile/internal/gc/obj.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/gc/obj.go b/src/cmd/compile/internal/gc/obj.go index 0b10cb8a9e..a52696fbb6 100644 --- a/src/cmd/compile/internal/gc/obj.go +++ b/src/cmd/compile/internal/gc/obj.go @@ -7,6 +7,7 @@ package gc import ( "cmd/compile/internal/base" "cmd/compile/internal/ir" + "cmd/compile/internal/noder" "cmd/compile/internal/objw" "cmd/compile/internal/reflectdata" "cmd/compile/internal/staticdata" @@ -103,7 +104,7 @@ func finishArchiveEntry(bout *bio.Writer, start int64, name string) { func dumpCompilerObj(bout *bio.Writer) { printObjHeader(bout) - dumpexport(bout) + noder.WriteExports(bout) } func dumpdata() { |