diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-03-26 04:58:48 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-03-26 04:58:48 -0400 |
| commit | 451ce090674d6d5f2c23e6667047e1e479917c93 (patch) | |
| tree | cbe8722f059086fdf30a76ce94d1ac16086dacd5 /src/codegen.cpp | |
| parent | 22e6bfca9602fdb79f669b494fa7f1c58094706c (diff) | |
| download | zig-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/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 94aec5664d..5dea908a11 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -3786,7 +3786,7 @@ static void define_builtin_types(CodeGen *g) { TypeTableEntry *entry = new_type_table_entry(TypeTableEntryIdUnreachable); entry->type_ref = LLVMVoidType(); entry->zero_bits = true; - buf_init_from_str(&entry->name, "unreachable"); + buf_init_from_str(&entry->name, "noreturn"); entry->di_type = g->builtin_types.entry_void->di_type; g->builtin_types.entry_unreachable = entry; g->primitive_type_table.put(&entry->name, entry); @@ -4096,7 +4096,6 @@ static void define_builtin_fns(CodeGen *g) { create_builtin_fn(g, BuiltinFnIdCompileErr, "compileError", 1); create_builtin_fn(g, BuiltinFnIdCompileLog, "compileLog", SIZE_MAX); create_builtin_fn(g, BuiltinFnIdIntType, "intType", 2); - create_builtin_fn(g, BuiltinFnIdUnreachable, "unreachable", 0); create_builtin_fn(g, BuiltinFnIdSetFnVisible, "setFnVisible", 2); create_builtin_fn(g, BuiltinFnIdSetDebugSafety, "setDebugSafety", 2); create_builtin_fn(g, BuiltinFnIdAlloca, "alloca", 2); |
