]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "[dev.ssa] cmd/compile: don't Compile if Unimplemented"
authorJosh Bleecher Snyder <josharian@gmail.com>
Fri, 17 Jul 2015 16:47:43 +0000 (16:47 +0000)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 21 Jul 2015 13:38:53 +0000 (13:38 +0000)
This reverts commit 766bcc92a5b693f336deffc347be52fe68af884a.

Change-Id: I55413c1aa80d82c856a3ea89b4ffccf80fb58013
Reviewed-on: https://go-review.googlesource.com/12361
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/print.go

index 889b9d8cf86dac2b9b59a81cebf468227abc74c9..e133076bced72c4371dfef80c795d9db51c18259 100644 (file)
@@ -108,18 +108,17 @@ func buildssa(fn *Node) (ssafn *ssa.Func, usessa bool) {
        // Link up variable uses to variable definitions
        s.linkForwardReferences()
 
+       // Main call to ssa package to compile function
+       ssa.Compile(s.f)
+
        // Calculate stats about what percentage of functions SSA handles.
        if false {
-               defer func() { fmt.Printf("SSA implemented: %t\n", !e.unimplemented) }()
+               fmt.Printf("SSA implemented: %t\n", !e.unimplemented)
        }
 
        if e.unimplemented {
                return nil, false
        }
-
-       // Main call to ssa package to compile function.
-       ssa.Compile(s.f)
-
        return s.f, usessa // TODO: return s.f, true once runtime support is in (gc maps, write barriers, etc.)
 }
 
index e46590224da450d4a49ed0a935a440982895c285..c8b90c6f93031c7630baff056d0bab708dcc40cc 100644 (file)
@@ -8,7 +8,6 @@ import (
        "bytes"
        "fmt"
        "io"
-       "os"
 )
 
 func printFunc(f *Func) {
@@ -69,22 +68,16 @@ func fprintFunc(w io.Writer, f *Func) {
                                n++
                        }
                        if m == n {
-                               fmt.Fprintln(os.Stderr, "dependency cycle in block", b)
+                               fmt.Fprintln(w, "dependency cycle!")
                                for _, v := range b.Values {
                                        if printed[v.ID] {
                                                continue
                                        }
-                                       fmt.Fprintf(os.Stderr, "    %v\n", v.LongString())
+                                       fmt.Fprint(w, "    ")
+                                       fmt.Fprintln(w, v.LongString())
                                        printed[v.ID] = true
                                        n++
                                }
-                               // Things are going to go very badly from here;
-                               // one of the optimization passes is likely to hang.
-                               // Frustratingly, panics here get swallowed by fmt,
-                               // and just we end up here again if we call Fatalf.
-                               // Use our last resort.
-                               os.Exit(1)
-                               return
                        }
                }