// 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.)
}
"bytes"
"fmt"
"io"
- "os"
)
func printFunc(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
}
}