aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-09-05 18:51:48 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-09-05 18:51:48 -0400
commit48c44615a4f03c105a8053db552320d26482436a (patch)
treea2fa30353c38f068ec5510b38ff3e4bb8df30477 /src/codegen.cpp
parent1449e71de87891757b35302a73f9f1ad03429030 (diff)
parent3ff465e2883b556cd08afc08b0a2098255314d4a (diff)
downloadzig-48c44615a4f03c105a8053db552320d26482436a.tar.gz
zig-48c44615a4f03c105a8053db552320d26482436a.zip
Merge branch 'c-to-zig'
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) {