]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: add more non-returning runtime calls
authorJosh Bleecher Snyder <josharian@gmail.com>
Sun, 11 Sep 2016 15:29:04 +0000 (08:29 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 12 Sep 2016 13:26:12 +0000 (13:26 +0000)
This list now matches the one in popt.go.

Change-Id: Ib24de531cc35252f0ef276e5c6d247654b021533
Reviewed-on: https://go-review.googlesource.com/28965
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/gc/ssa.go

index 549259aff888cbbdffa24c933366d6635fa16fe3..e2814685ff9a434c07f6c716892609727a7149a9 100644 (file)
@@ -585,16 +585,17 @@ func (s *state) stmt(n *Node) {
 
        case OCALLMETH, OCALLINTER:
                s.call(n, callNormal)
-               if n.Op == OCALLFUNC && n.Left.Op == ONAME && n.Left.Class == PFUNC &&
-                       (compiling_runtime && n.Left.Sym.Name == "throw" ||
-                               n.Left.Sym.Pkg == Runtimepkg && (n.Left.Sym.Name == "gopanic" || n.Left.Sym.Name == "selectgo" || n.Left.Sym.Name == "block")) {
-                       m := s.mem()
-                       b := s.endBlock()
-                       b.Kind = ssa.BlockExit
-                       b.SetControl(m)
-                       // TODO: never rewrite OPANIC to OCALLFUNC in the
-                       // first place. Need to wait until all backends
-                       // go through SSA.
+               if n.Op == OCALLFUNC && n.Left.Op == ONAME && n.Left.Class == PFUNC {
+                       if fn := n.Left.Sym.Name; compiling_runtime && fn == "throw" ||
+                               n.Left.Sym.Pkg == Runtimepkg && (fn == "throwinit" || fn == "gopanic" || fn == "panicwrap" || fn == "selectgo" || fn == "block") {
+                               m := s.mem()
+                               b := s.endBlock()
+                               b.Kind = ssa.BlockExit
+                               b.SetControl(m)
+                               // TODO: never rewrite OPANIC to OCALLFUNC in the
+                               // first place. Need to wait until all backends
+                               // go through SSA.
+                       }
                }
        case ODEFER:
                s.call(n.Left, callDefer)