diff options
| author | gingerBill <bill@gingerbill.org> | 2018-10-13 13:19:52 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-10-13 13:19:52 +0100 |
| commit | 42b42db67544f6037cfb3aac2d486161bc0e2147 (patch) | |
| tree | 5b7bc7e04d2e59d9ca1beb7f8e774336cb4a0eb3 /src | |
| parent | 73e9dbbf8c4a68dc6c512eb2de568d59df046494 (diff) | |
Add `unimplemented` and `unreachable` procedures; make `os.exit` a diverging procedure
Diffstat (limited to 'src')
| -rw-r--r-- | src/ir.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index b51b9c184..7ceda6c10 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -1645,6 +1645,10 @@ irValue *ir_emit_bitcast(irProcedure *proc, irValue *data, Type *type) { return ir_emit(proc, ir_instr_conv(proc, irConv_bitcast, data, ir_type(data), type)); } +void ir_emit_unreachable(irProcedure *proc) { + ir_emit(proc, ir_instr_unreachable(proc)); +} + irValue *ir_emit_transmute(irProcedure *proc, irValue *value, Type *t); irValue *ir_address_from_load_or_generate_local(irProcedure *proc, irValue *val); irValue *ir_emit_struct_ep(irProcedure *proc, irValue *s, i32 index); @@ -1749,6 +1753,7 @@ irValue *ir_emit_call(irProcedure *p, irValue *value, Array<irValue *> args, Pro if (abi_rt != results) { result = ir_emit_transmute(p, result, rt); } + return result; } @@ -1838,10 +1843,6 @@ void ir_close_scope(irProcedure *proc, irDeferExitKind kind, irBlock *block) { -void ir_emit_unreachable(irProcedure *proc) { - ir_emit(proc, ir_instr_unreachable(proc)); -} - void ir_emit_return(irProcedure *proc, irValue *v) { ir_emit_defer_stmts(proc, irDeferExit_Return, nullptr); |