diff options
Diffstat (limited to 'src/cmd/compile/internal/ir/stmt.go')
-rw-r--r-- | src/cmd/compile/internal/ir/stmt.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/cmd/compile/internal/ir/stmt.go b/src/cmd/compile/internal/ir/stmt.go index 69a74b9fdd..3482d7972e 100644 --- a/src/cmd/compile/internal/ir/stmt.go +++ b/src/cmd/compile/internal/ir/stmt.go @@ -385,14 +385,11 @@ func NewSwitchStmt(pos src.XPos, tag Node, cases []*CaseClause) *SwitchStmt { // code generation to jump directly to another function entirely. type TailCallStmt struct { miniStmt - Target *Name + Call *CallExpr // the underlying call } -func NewTailCallStmt(pos src.XPos, target *Name) *TailCallStmt { - if target.Op() != ONAME || target.Class != PFUNC { - base.FatalfAt(pos, "tail call to non-func %v", target) - } - n := &TailCallStmt{Target: target} +func NewTailCallStmt(pos src.XPos, call *CallExpr) *TailCallStmt { + n := &TailCallStmt{Call: call} n.pos = pos n.op = OTAILCALL return n |