From 1d92700d089eb2e225d1db6de780e4288fa68452 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 9 Feb 2016 08:46:55 -0700 Subject: fix build with GCC --- src/codegen.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index d1a57a82bc..1a166867a8 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -1733,6 +1733,7 @@ static LLVMValueRef gen_return_expr(CodeGen *g, AstNode *node) { case ReturnKindMaybe: zig_panic("TODO"); } + zig_unreachable(); } static LLVMValueRef gen_defer(CodeGen *g, AstNode *node) { @@ -2685,7 +2686,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, TypeTableEntry *type_entry, ConstE case TypeTableEntryIdStruct: { LLVMValueRef *fields = allocate(type_entry->data.structure.gen_field_count); - for (int i = 0; i < type_entry->data.structure.src_field_count; i += 1) { + for (uint32_t i = 0; i < type_entry->data.structure.src_field_count; i += 1) { TypeStructField *type_struct_field = &type_entry->data.structure.fields[i]; if (type_struct_field->gen_index == -1) { continue; @@ -2701,7 +2702,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, TypeTableEntry *type_entry, ConstE TypeTableEntry *child_type = type_entry->data.array.child_type; uint64_t len = type_entry->data.array.len; LLVMValueRef *values = allocate(len); - for (int i = 0; i < len; i += 1) { + for (uint64_t i = 0; i < len; i += 1) { ConstExprValue *field_value = const_val->data.x_array.fields[i]; values[i] = gen_const_val(g, child_type, field_value); } @@ -2793,6 +2794,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, TypeTableEntry *type_entry, ConstE zig_unreachable(); } + zig_unreachable(); } static void gen_const_globals(CodeGen *g) { @@ -3259,8 +3261,7 @@ static void define_builtin_types(CodeGen *g) { uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, entry->type_ref); entry->di_type = LLVMZigCreateDebugBasicType(g->dbuilder, buf_ptr(&entry->name), - debug_size_in_bits, debug_align_in_bits, - is_signed ? LLVMZigEncoding_DW_ATE_signed() : LLVMZigEncoding_DW_ATE_unsigned()); + debug_size_in_bits, debug_align_in_bits, dwarf_tag); entry->data.integral.is_signed = is_signed; entry->data.integral.bit_count = size_in_bits; g->primitive_type_table.put(&entry->name, entry); -- cgit v1.2.3