]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/ir: remove Func.ReflectMethod
authorMatthew Dempsky <mdempsky@google.com>
Thu, 14 Sep 2023 10:03:52 +0000 (03:03 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 14 Sep 2023 13:23:21 +0000 (13:23 +0000)
This flag doesn't serve any purpose anymore. The only place that it's
currently set happens after it's checked.

Change-Id: Idb6455416f68e502e0b0b1d80e2d6bb5956ee45b
Reviewed-on: https://go-review.googlesource.com/c/go/+/528435
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/compile/internal/ir/abi.go
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/walk/expr.go

index 041448fb29639028f5fa492a53d17dfbb452a4a4..ebe0fbfb2a731998df0bb34abf2f2185376a372c 100644 (file)
@@ -50,9 +50,6 @@ func setupTextLSym(f *Func, flag int) {
        if f.Pragma&Nosplit != 0 {
                flag |= obj.NOSPLIT
        }
-       if f.ReflectMethod() {
-               flag |= obj.REFLECTMETHOD
-       }
        if f.IsPackageInit() {
                flag |= obj.PKGINIT
        }
index ea575a420643a548ff43c8d80df6dc648fb21ef2..5a71a73c154b1ef79962105adf14f688b89f8eb5 100644 (file)
@@ -217,11 +217,10 @@ type Mark struct {
 type ScopeID int32
 
 const (
-       funcDupok         = 1 << iota // duplicate definitions ok
-       funcWrapper                   // hide frame from users (elide in tracebacks, don't count as a frame for recover())
-       funcABIWrapper                // is an ABI wrapper (also set flagWrapper)
-       funcNeedctxt                  // function uses context register (has closure variables)
-       funcReflectMethod             // function calls reflect.Type.Method or MethodByName
+       funcDupok      = 1 << iota // duplicate definitions ok
+       funcWrapper                // hide frame from users (elide in tracebacks, don't count as a frame for recover())
+       funcABIWrapper             // is an ABI wrapper (also set flagWrapper)
+       funcNeedctxt               // function uses context register (has closure variables)
        // true if closure inside a function; false if a simple function or a
        // closure in a global variable initialization
        funcIsHiddenClosure
@@ -244,7 +243,6 @@ func (f *Func) Dupok() bool                    { return f.flags&funcDupok != 0 }
 func (f *Func) Wrapper() bool                  { return f.flags&funcWrapper != 0 }
 func (f *Func) ABIWrapper() bool               { return f.flags&funcABIWrapper != 0 }
 func (f *Func) Needctxt() bool                 { return f.flags&funcNeedctxt != 0 }
-func (f *Func) ReflectMethod() bool            { return f.flags&funcReflectMethod != 0 }
 func (f *Func) IsHiddenClosure() bool          { return f.flags&funcIsHiddenClosure != 0 }
 func (f *Func) IsDeadcodeClosure() bool        { return f.flags&funcIsDeadcodeClosure != 0 }
 func (f *Func) HasDefer() bool                 { return f.flags&funcHasDefer != 0 }
@@ -259,7 +257,6 @@ func (f *Func) SetDupok(b bool)                    { f.flags.set(funcDupok, b) }
 func (f *Func) SetWrapper(b bool)                  { f.flags.set(funcWrapper, b) }
 func (f *Func) SetABIWrapper(b bool)               { f.flags.set(funcABIWrapper, b) }
 func (f *Func) SetNeedctxt(b bool)                 { f.flags.set(funcNeedctxt, b) }
-func (f *Func) SetReflectMethod(b bool)            { f.flags.set(funcReflectMethod, b) }
 func (f *Func) SetIsHiddenClosure(b bool)          { f.flags.set(funcIsHiddenClosure, b) }
 func (f *Func) SetIsDeadcodeClosure(b bool)        { f.flags.set(funcIsDeadcodeClosure, b) }
 func (f *Func) SetHasDefer(b bool)                 { f.flags.set(funcHasDefer, b) }
index b4e42470b9da3eabd8c2c094871faf9cb4fe38cd..9047211879d5323e8ef1799a7f989c42acbccf71 100644 (file)
@@ -1033,8 +1033,6 @@ func usemethod(n *ir.CallExpr) {
                r.Type = objabi.R_USENAMEDMETHOD
                r.Sym = staticdata.StringSymNoCommon(name)
        } else {
-               ir.CurFunc.SetReflectMethod(true)
-               // The LSym is initialized at this point. We need to set the attribute on the LSym.
                ir.CurFunc.LSym.Set(obj.AttrReflectMethod, true)
        }
 }