aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-03-26 04:58:48 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-03-26 04:58:48 -0400
commit451ce090674d6d5f2c23e6667047e1e479917c93 (patch)
treecbe8722f059086fdf30a76ce94d1ac16086dacd5 /src/ir.cpp
parent22e6bfca9602fdb79f669b494fa7f1c58094706c (diff)
downloadzig-451ce090674d6d5f2c23e6667047e1e479917c93.tar.gz
zig-451ce090674d6d5f2c23e6667047e1e479917c93.zip
new unreachable syntax
* `noreturn` is the primitive type. * `unreachable` is a control flow keyword. * `@unreachable()` builtin function is deleted. closes #214
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 73b09918fa..14fa780a40 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -3751,8 +3751,6 @@ static IrInstruction *ir_gen_builtin_fn_call(IrBuilder *irb, Scope *scope, AstNo
switch (builtin_fn->id) {
case BuiltinFnIdInvalid:
zig_unreachable();
- case BuiltinFnIdUnreachable:
- return ir_build_unreachable(irb, scope, node);
case BuiltinFnIdTypeof:
{
AstNode *arg_node = node->data.fn_call_expr.params.at(0);
@@ -5467,6 +5465,8 @@ static IrInstruction *ir_gen_node_raw(IrBuilder *irb, AstNode *node, Scope *scop
return ir_lval_wrap(irb, scope, ir_gen_break(irb, scope, node), lval);
case NodeTypeContinue:
return ir_lval_wrap(irb, scope, ir_gen_continue(irb, scope, node), lval);
+ case NodeTypeUnreachable:
+ return ir_lval_wrap(irb, scope, ir_build_unreachable(irb, scope, node), lval);
case NodeTypeDefer:
return ir_lval_wrap(irb, scope, ir_gen_defer(irb, scope, node), lval);
case NodeTypeSliceExpr: