Commit 62ba15a4 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: add more non-returning runtime calls

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: default avatarCherry Zhang <cherryyz@google.com>
parent 8086e7c6
...@@ -585,16 +585,17 @@ func (s *state) stmt(n *Node) { ...@@ -585,16 +585,17 @@ func (s *state) stmt(n *Node) {
case OCALLMETH, OCALLINTER: case OCALLMETH, OCALLINTER:
s.call(n, callNormal) s.call(n, callNormal)
if n.Op == OCALLFUNC && n.Left.Op == ONAME && n.Left.Class == PFUNC && if n.Op == OCALLFUNC && n.Left.Op == ONAME && n.Left.Class == PFUNC {
(compiling_runtime && n.Left.Sym.Name == "throw" || if fn := n.Left.Sym.Name; compiling_runtime && fn == "throw" ||
n.Left.Sym.Pkg == Runtimepkg && (n.Left.Sym.Name == "gopanic" || n.Left.Sym.Name == "selectgo" || n.Left.Sym.Name == "block")) { n.Left.Sym.Pkg == Runtimepkg && (fn == "throwinit" || fn == "gopanic" || fn == "panicwrap" || fn == "selectgo" || fn == "block") {
m := s.mem() m := s.mem()
b := s.endBlock() b := s.endBlock()
b.Kind = ssa.BlockExit b.Kind = ssa.BlockExit
b.SetControl(m) b.SetControl(m)
// TODO: never rewrite OPANIC to OCALLFUNC in the // TODO: never rewrite OPANIC to OCALLFUNC in the
// first place. Need to wait until all backends // first place. Need to wait until all backends
// go through SSA. // go through SSA.
}
} }
case ODEFER: case ODEFER:
s.call(n.Left, callDefer) s.call(n.Left, callDefer)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment