]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] cmd/compile: add -d=unified flag to enable unified IR
authorMatthew Dempsky <mdempsky@google.com>
Fri, 11 Jun 2021 10:54:25 +0000 (03:54 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 15 Jun 2021 22:29:54 +0000 (22:29 +0000)
This CL adds a new -d=unified debug flag, which controls whether
unified IR mode is used.

Change-Id: Iaa5f3cc0a24b9881aeec5317cd6b462b4a7b6fc9
Reviewed-on: https://go-review.googlesource.com/c/go/+/327054
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/base/debug.go
src/cmd/compile/internal/noder/noder.go
src/cmd/compile/internal/reflectdata/reflect.go

index 71712ab1a56fd281f52d3befede9b833caa70fbd..824a8baa832f5a011f86d48b85e596db8d5c0392 100644 (file)
@@ -46,6 +46,7 @@ type DebugFlags struct {
        SoftFloat            int    `help:"force compiler to emit soft-float code"`
        TypeAssert           int    `help:"print information about type assertion inlining"`
        TypecheckInl         int    `help:"eager typechecking of inline function bodies"`
+       Unified              int    `help:"enable unified IR construction"`
        WB                   int    `help:"print information about write barriers"`
        ABIWrap              int    `help:"print information about ABI wrapper generation"`
 
index d417edcbd526cc47e8156b326e8c75bd34d523f7..c7970396f8de53ac659e81dc503eb7aa50536cfd 100644 (file)
@@ -76,6 +76,11 @@ func LoadPackage(filenames []string) {
        }
        base.Timer.AddEvent(int64(lines), "lines")
 
+       if base.Debug.Unified != 0 {
+               useUnifiedIR(noders)
+               return
+       }
+
        if base.Flag.G != 0 {
                // Use types2 to type-check and possibly generate IR.
                check2(noders)
index f16034ea708cc1f2f3683595f8e1605527907d5f..5516f707fa93e735bfe0141e0aac86145f67812d 100644 (file)
@@ -1780,6 +1780,10 @@ func methodWrapper(rcvr *types.Type, method *types.Field, forItab bool) *obj.LSy
                // TODO: check that we do the right thing when rcvr.IsInterface().
                generic = true
        }
+       if base.Debug.Unified != 0 {
+               // TODO(mdempsky): Support dictionaries for unified IR.
+               generic = false
+       }
        newnam := ir.MethodSym(rcvr, method.Sym)
        lsym := newnam.Linksym()
        if newnam.Siggen() {