]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove duplicate statement list function
authorKeith Randall <khr@golang.org>
Tue, 4 Oct 2016 16:49:33 +0000 (09:49 -0700)
committerKeith Randall <khr@golang.org>
Tue, 4 Oct 2016 17:05:27 +0000 (17:05 +0000)
Probably a holdover from linked list vs. slice.

Change-Id: Ib2540b08ef0ae48707d44a5d57bc23f8d65c760d
Reviewed-on: https://go-review.googlesource.com/30256
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/ssa.go

index 741a9d4e867d3d1733e840014cc2c9c42b1a1b7c..6ad25c4315680275667dec7c502f417f749d544e 100644 (file)
@@ -131,8 +131,8 @@ func buildssa(fn *Node) *ssa.Func {
        }
 
        // Convert the AST-based IR to the SSA-based IR
-       s.stmts(fn.Func.Enter)
-       s.stmts(fn.Nbody)
+       s.stmtList(fn.Func.Enter)
+       s.stmtList(fn.Nbody)
 
        // fallthrough to exit
        if s.curBlock != nil {
@@ -481,20 +481,14 @@ func (s *state) constInt(t ssa.Type, c int64) *ssa.Value {
        return s.constInt32(t, int32(c))
 }
 
-func (s *state) stmts(a Nodes) {
-       for _, x := range a.Slice() {
-               s.stmt(x)
-       }
-}
-
-// ssaStmtList converts the statement n to SSA and adds it to s.
+// stmtList converts the statement list n to SSA and adds it to s.
 func (s *state) stmtList(l Nodes) {
        for _, n := range l.Slice() {
                s.stmt(n)
        }
 }
 
-// ssaStmt converts the statement n to SSA and adds it to s.
+// stmt converts the statement n to SSA and adds it to s.
 func (s *state) stmt(n *Node) {
        s.pushLine(n.Lineno)
        defer s.popLine()
@@ -737,7 +731,7 @@ func (s *state) stmt(n *Node) {
                }
 
                s.startBlock(bThen)
-               s.stmts(n.Nbody)
+               s.stmtList(n.Nbody)
                if b := s.endBlock(); b != nil {
                        b.AddEdgeTo(bEnd)
                }
@@ -847,7 +841,7 @@ func (s *state) stmt(n *Node) {
 
                // generate body
                s.startBlock(bBody)
-               s.stmts(n.Nbody)
+               s.stmtList(n.Nbody)
 
                // tear down continue/break
                s.continueTo = prevContinue
@@ -886,7 +880,7 @@ func (s *state) stmt(n *Node) {
                }
 
                // generate body code
-               s.stmts(n.Nbody)
+               s.stmtList(n.Nbody)
 
                s.breakTo = prevBreak
                if lab != nil {
@@ -940,7 +934,7 @@ func (s *state) exit() *ssa.Block {
 
        // Run exit code. Typically, this code copies heap-allocated PPARAMOUT
        // variables back to the stack.
-       s.stmts(s.exitCode)
+       s.stmtList(s.exitCode)
 
        // Store SSAable PPARAMOUT variables back to stack locations.
        for _, n := range s.returns {