]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove Node.Nointerface field
authorMatthew Dempsky <mdempsky@google.com>
Thu, 31 Mar 2016 18:42:35 +0000 (11:42 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 31 Mar 2016 20:31:22 +0000 (20:31 +0000)
We already keep the entire pragma bitset in n.Func.Pragma, so there's
no need to track Nointerface separately.

Passes toolstash -cmp.

Change-Id: Ic027ece477fcf63b0c1df128a08b89ef0f34fd58
Reviewed-on: https://go-review.googlesource.com/21381
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/parser.go
src/cmd/compile/internal/gc/syntax.go
src/cmd/compile/internal/gc/typecheck.go

index 746af32b958c7e8bd9901c561701128a25c1d74d..b71cf8fef424668693666c6dd4148c6179cc6a2e 100644 (file)
@@ -1861,7 +1861,7 @@ func (p *parser) xfndcl() *Node {
        }
 
        p.want(LFUNC)
-       f := p.fndcl(p.pragma&Nointerface != 0)
+       f := p.fndcl()
        body := p.fnbody()
 
        if f == nil {
@@ -1886,7 +1886,7 @@ func (p *parser) xfndcl() *Node {
 // Function     = Signature FunctionBody .
 // MethodDecl   = "func" Receiver MethodName ( Function | Signature ) .
 // Receiver     = Parameters .
-func (p *parser) fndcl(nointerface bool) *Node {
+func (p *parser) fndcl() *Node {
        if trace && Debug['x'] != 0 {
                defer p.trace("fndcl")()
        }
@@ -1950,7 +1950,6 @@ func (p *parser) fndcl(nointerface bool) *Node {
                f.Func.Nname = methodname1(f.Func.Shortname, recv.Right)
                f.Func.Nname.Name.Defn = f
                f.Func.Nname.Name.Param.Ntype = t
-               f.Func.Nname.Nointerface = nointerface
                declare(f.Func.Nname, PFUNC)
 
                funchdr(f)
index 76f3123ebfd6640dae453b89a826d965f2ec4025..b23b46608866dba4417664146c7d563b0df56e4f 100644 (file)
@@ -49,30 +49,29 @@ type Node struct {
 
        Esc uint16 // EscXXX
 
-       Op          Op
-       Nointerface bool
-       Ullman      uint8 // sethi/ullman number
-       Addable     bool  // addressable
-       Etype       EType // op for OASOP, etype for OTYPE, exclam for export, 6g saved reg
-       Bounded     bool  // bounds check unnecessary
-       Class       Class // PPARAM, PAUTO, PEXTERN, etc
-       Embedded    uint8 // ODCLFIELD embedded type
-       Colas       bool  // OAS resulting from :=
-       Diag        uint8 // already printed error about this
-       Noescape    bool  // func arguments do not escape; TODO(rsc): move Noescape to Func struct (see CL 7360)
-       Walkdef     uint8
-       Typecheck   uint8
-       Local       bool
-       Dodata      uint8
-       Initorder   uint8
-       Used        bool
-       Isddd       bool // is the argument variadic
-       Implicit    bool
-       Addrtaken   bool // address taken, even if not moved to heap
-       Assigned    bool // is the variable ever assigned to
-       Likely      int8 // likeliness of if statement
-       Hasbreak    bool // has break statement
-       hasVal      int8 // +1 for Val, -1 for Opt, 0 for not yet set
+       Op        Op
+       Ullman    uint8 // sethi/ullman number
+       Addable   bool  // addressable
+       Etype     EType // op for OASOP, etype for OTYPE, exclam for export, 6g saved reg
+       Bounded   bool  // bounds check unnecessary
+       Class     Class // PPARAM, PAUTO, PEXTERN, etc
+       Embedded  uint8 // ODCLFIELD embedded type
+       Colas     bool  // OAS resulting from :=
+       Diag      uint8 // already printed error about this
+       Noescape  bool  // func arguments do not escape; TODO(rsc): move Noescape to Func struct (see CL 7360)
+       Walkdef   uint8
+       Typecheck uint8
+       Local     bool
+       Dodata    uint8
+       Initorder uint8
+       Used      bool
+       Isddd     bool // is the argument variadic
+       Implicit  bool
+       Addrtaken bool // address taken, even if not moved to heap
+       Assigned  bool // is the variable ever assigned to
+       Likely    int8 // likeliness of if statement
+       Hasbreak  bool // has break statement
+       hasVal    int8 // +1 for Val, -1 for Opt, 0 for not yet set
 }
 
 // Val returns the Val for the node.
index 043022ba97920b90cb7cacf23304b2cce7698717..f0b0f080ff45e7f2dec87b52390dc08e4b85d158 100644 (file)
@@ -3423,7 +3423,7 @@ func typecheckfunc(n *Node) {
        t.SetNname(n.Func.Nname)
        rcvr := t.Recv()
        if rcvr != nil && n.Func.Shortname != nil {
-               addmethod(n.Func.Shortname.Sym, t, nil, true, n.Func.Nname.Nointerface)
+               addmethod(n.Func.Shortname.Sym, t, nil, true, n.Func.Pragma&Nointerface != 0)
        }
 
        for _, ln := range n.Func.Dcl {