]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: update documentation for ONAME node with nil Func
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 16 Feb 2023 14:30:36 +0000 (21:30 +0700)
committerGopher Robot <gobot@golang.org>
Tue, 28 Feb 2023 18:50:39 +0000 (18:50 +0000)
After CL 436435 chain, the only case left where we create an ONAME node
with nil Func is interface method from imported package.

Change-Id: I9d9144916d01712283f2b116973f88965715fea3
Reviewed-on: https://go-review.googlesource.com/c/go/+/468816
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>

src/cmd/compile/internal/ir/expr.go
src/cmd/compile/internal/ir/name.go
src/cmd/compile/internal/ssagen/ssa.go

index 95c142b93d439ae6cc65251588811aea8d6be323..5d82788008ef1f788b465905dd294490f66f383d 100644 (file)
@@ -563,8 +563,7 @@ func (n *SelectorExpr) FuncName() *Name {
        if n.Selection.Nname != nil {
                // TODO(austin): Nname is nil for interface method
                // expressions (I.M), so we can't attach a Func to
-               // those here. reflectdata.methodWrapper generates the
-               // Func.
+               // those here.
                fn.Func = n.Selection.Nname.(*Name).Func
        }
        return fn
index 43aa582e3d18eb9bc121178064440cf3674b2263..c6eff27272d08f0416d9b34f88eb3e99fc8d318e 100644 (file)
@@ -40,7 +40,7 @@ type Name struct {
        flags     bitset16
        DictIndex uint16 // index of the dictionary entry describing the type of this variable declaration plus 1
        sym       *types.Sym
-       Func      *Func // TODO(austin): nil for I.M, eqFor, hashfor, and hashmem
+       Func      *Func // TODO(austin): nil for I.M
        Offset_   int64
        val       constant.Value
        Opt       interface{} // for use by escape analysis
index 3a4c24084e2c0e6659cc02dc803844205df8e3e5..004806b029aaec2c392983476eb7114f502afe24 100644 (file)
@@ -7950,10 +7950,9 @@ func clobberBase(n ir.Node) ir.Node {
 // callTargetLSym returns the correct LSym to call 'callee' using its ABI.
 func callTargetLSym(callee *ir.Name) *obj.LSym {
        if callee.Func == nil {
-               // TODO(austin): This happens in a few cases of
-               // compiler-generated functions. These are all
-               // ABIInternal. It would be better if callee.Func was
-               // never nil and we didn't need this case.
+               // TODO(austin): This happens in case of interface method I.M from imported package.
+               // It's ABIInternal, and would be better if callee.Func was never nil and we didn't
+               // need this case.
                return callee.Linksym()
        }