aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/main.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-06-23 21:33:24 -0700
committerMatthew Dempsky <mdempsky@google.com>2021-06-25 05:00:20 +0000
commitf4198f85d505c21eee3f2686466e72daa7413232 (patch)
tree3d9a09f51a2c04b2dcb24b717be7da3d7da75605 /src/cmd/compile/internal/gc/main.go
parent3f1a517a45d2e443a327e0b28df17698e299ea50 (diff)
downloadgo-f4198f85d505c21eee3f2686466e72daa7413232.tar.gz
go-f4198f85d505c21eee3f2686466e72daa7413232.zip
[dev.typeparams] cmd/compile: generate wrappers within unified IR
This CL extends unified IR to handle creating wrapper methods. There's relatively little about this code that's actually specific to unified IR, but rewriting this logic allows a few benefits: 1. It decouples unified IR from reflectdata.methodWrapper, so the latter code can evolve freely for -G=3's needs. This will also allow the new code to evolve to unified IR's wrapper needs, which I anticipate will operate slightly differently. 2. It provided an opportunity to revisit a lot of the code and simplify/update it to current style. E.g., in the process, I discovered #46903, which unified IR now gets correctly. (I have not yet attempted to fix reflectdata.methodWrapper.) 3. It gives a convenient way for unified IR to ensure all of the wrapper methods it needs are generated correctly. For now, the wrapper generation is specific to non-quirks mode. Change-Id: I5798de6b141f29e8eb6a5c563e7049627ff2868a Reviewed-on: https://go-review.googlesource.com/c/go/+/330569 Trust: Matthew Dempsky <mdempsky@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>
Diffstat (limited to 'src/cmd/compile/internal/gc/main.go')
-rw-r--r--src/cmd/compile/internal/gc/main.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go
index c0346c0206..c94f19fd47 100644
--- a/src/cmd/compile/internal/gc/main.go
+++ b/src/cmd/compile/internal/gc/main.go
@@ -186,6 +186,7 @@ func Main(archInit func(*ssagen.ArchInfo)) {
base.AutogeneratedPos = makePos(src.NewFileBase("<autogenerated>", "<autogenerated>"), 1, 0)
typecheck.InitUniverse()
+ typecheck.InitRuntime()
// Parse and typecheck input.
noder.LoadPackage(flag.Args())
@@ -194,7 +195,6 @@ func Main(archInit func(*ssagen.ArchInfo)) {
// Prepare for backend processing. This must happen before pkginit,
// because it generates itabs for initializing global variables.
- typecheck.InitRuntime()
ssagen.InitConfig()
// Build init task.