aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-09-05 18:51:07 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-09-05 18:51:07 -0400
commit3ff465e2883b556cd08afc08b0a2098255314d4a (patch)
tree3315b7dd87d24b7e6de22db6b9cfc0b6e2e70f38 /src/codegen.cpp
parentc3362c1cb63ff8d8e79a16c76a574bbbd488967c (diff)
downloadzig-3ff465e2883b556cd08afc08b0a2098255314d4a.tar.gz
zig-3ff465e2883b556cd08afc08b0a2098255314d4a.zip
add OpaqueType builtin
closes #326
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index a53174ab89..eacb303956 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -469,7 +469,8 @@ static ZigLLVMDIScope *get_di_scope(CodeGen *g, Scope *scope) {
FnTableEntry *fn_table_entry = fn_scope->fn_entry;
if (!fn_table_entry->proto_node)
return get_di_scope(g, scope->parent);
- unsigned line_number = (unsigned)fn_table_entry->proto_node->line + 1;
+ unsigned line_number = (unsigned)(fn_table_entry->proto_node->line == 0) ?
+ 0 : (fn_table_entry->proto_node->line + 1);
unsigned scope_line = line_number;
bool is_definition = fn_table_entry->body_node != nullptr;
unsigned flags = 0;
@@ -3328,6 +3329,7 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable,
case IrInstructionIdTypeId:
case IrInstructionIdSetEvalBranchQuota:
case IrInstructionIdPtrTypeOf:
+ case IrInstructionIdOpaqueType:
zig_unreachable();
case IrInstructionIdReturn:
return ir_render_return(g, executable, (IrInstructionReturn *)instruction);
@@ -4732,6 +4734,7 @@ static void define_builtin_fns(CodeGen *g) {
create_builtin_fn(g, BuiltinFnIdShrExact, "shrExact", 2);
create_builtin_fn(g, BuiltinFnIdSetEvalBranchQuota, "setEvalBranchQuota", 1);
create_builtin_fn(g, BuiltinFnIdAlignCast, "alignCast", 2);
+ create_builtin_fn(g, BuiltinFnIdOpaqueType, "OpaqueType", 0);
}
static const char *bool_to_str(bool b) {